Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-dev] Anybody know how to execute EclipseLink unit tests in Eclipse?

I finally figure this out by myself.

For example, if you want to execute
org.eclipse.persistence.testing.tests.collections.CollectionsTestModel
in Eclipse via the JUnit integration, you need to add an empty test
method to the class, like this: public void test(){/*EMPTY*/}

Then by some magic of EclipseLink integration with JUnit all the tests
will execute correctly. You will see each tests showing up with green
light. However, it seems that the context of each test is lost so that
we cannot re-execute a single test from the list of executed tests.

I come to the conclusion that integration of EclipseLink test suites
with JUnit is not respecting JUnit contract and EclipseLink project so
far didn't intended to provide debugging usability of the tests under
Eclipse.

I still wonder how EclipseLink developers are debugging/tracing a single
unit test. Do they have to comment out part of the test suite?

-----Original Message-----
From: eclipselink-dev-bounces@xxxxxxxxxxx
[mailto:eclipselink-dev-bounces@xxxxxxxxxxx] On Behalf Of Sebastien
Tardif
Sent: Thursday, September 04, 2008 3:54 PM
To: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] Anybody know how to execute EclipseLink unit
testsin Eclipse?

Anybody knows how to execute EclipseLink unit test in Eclipse?
Anybody ever did it?

I have tried with different Eclipse version and with JUnit 3 and 4.

That always end-up not executing anything with errors like:

junit.framework.AssertionFailedError: No tests found in
org.eclipse.persistence.testing.tests.collections.CollectionsTestModel
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.TestSuite$1.runTest(TestSuite.java:90)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUn
it3TestReference.java:130)
	
Or

junit.framework.AssertionFailedError: Class
org.eclipse.persistence.testing.tests.aggregate.InMemoryQueryKeyToAggreg
ateTest has no public constructor TestCase(String name) or TestCase()
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.TestSuite$1.runTest(TestSuite.java:90)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUn
it3TestReference.java:130)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)

_______________________________________________
eclipselink-dev mailing list
eclipselink-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-dev


Back to the top