Results 1 to 10 of 10
- 05-24-2010, 02:23 AM #1
Mark Dexter persistence tutorial Junit problems
i've just started the second tutorial in the Mark Dexter eclipse tutorials
and having a problem with using Junit 4.
I cant get it to work with Junit 4
my AllTest class worked fine with Junit 3
so as directed i have changed the syntax of the class file thus:
i added Junit 4 source files to the build path ( although quick fix wouldnt do this for me, i had to do it manually.Java Code:package org.persistence.tutorial; import org.junit.runner.*; import org.junit.runners.*; @RunWith(Suite.class) @Suite.SuiteClasses(value={ BookTest.class, PersonTest.class, MyLibraryTest.class, }) public class AllTests { }
Then i opened the run configurations dialogue and selected Junit 4 as the test runner.
but it will not run the test i get a list of console output. see below.
I cant understand what I have missed. I have followed the instructions to the letter.. excepting that quickfix would not automatically add junit 4 to the buildpath for me. I had to do it manually.
could this be something to do with using Stanford Universities version of Eclipse. i am currently running Version: 3.4.2 of eclipse
here is the console output i get when i try to run the all test class.
Java Code:java.lang.SecurityException: class "junit.framework.JUnit4TestCaseFacade"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(Unknown Source) at java.lang.ClassLoader.preDefineClass(Unknown Source) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at org.junit.internal.runners.OldTestClassRunner$OldTestClassAdaptingListener.asDescription(OldTestClassRunner.java:41) at org.junit.internal.runners.OldTestClassRunner$OldTestClassAdaptingListener.startTest(OldTestClassRunner.java:31) at junit.framework.TestResult.startTest(TestResult.java:151) at junit.framework.TestResult.run(TestResult.java:103) 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.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76) at org.junit.internal.runners.CompositeRunner.run(CompositeRunner.java:29) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
:p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts
- 05-24-2010, 09:24 AM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
- 05-24-2010, 10:09 AM #3
- 05-24-2010, 01:12 PM #4
okay the Junit4 icon and the JRE system library never appear in package explorer,
they have never appeared there. I noticed this in the first tutorials but no issues arose as a result of them not being there.
i checked again that Junit 4 is in the build path, and it is.
but i removed it any way, rebooted eclipse and put it back again.
i deleted the AllTest class and and opened a new Junit test case in the test subfolder.
eclipse automatically checked the Junit 4 options and I wrote the class again from scratch.
still got loads of red console output and no test.
I checked around a few other things, but :confused:
heres a screen shot of the libraries on my build path.
it looks kid of right to me, but to be honest i dont know if it is or not.:p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts
- 05-24-2010, 01:34 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 05-24-2010, 03:45 PM #6
- 05-24-2010, 03:46 PM #7
- 05-24-2010, 03:50 PM #8
Solved
Last edited by sonny; 05-24-2010 at 03:52 PM. Reason: added relevent quote
:p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts
- 05-24-2010, 04:03 PM #9
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,427
- Blog Entries
- 7
- Rep Power
- 17
- 05-24-2010, 04:09 PM #10
:p I still have my "L" plates on...... directions and explanations are far more help than blaring your Horn! :p Watching:CS106a on YouTube \Reading The Art & Science of Java by Eric S Roberts
Similar Threads
-
Persistence technology
By Hugo in forum AWT / SwingReplies: 6Last Post: 05-09-2010, 12:08 PM -
Persistence causing problems with JButton 2D Array
By easyp in forum New To JavaReplies: 2Last Post: 04-21-2010, 06:34 PM -
How to use Switch case A, B C, D, E,F mark change to 5,4,3,2,1,0 mark java
By theseven in forum New To JavaReplies: 1Last Post: 02-12-2010, 01:50 PM -
Name persistence is not bound in this Context
By tascoa in forum Java ServletReplies: 1Last Post: 12-15-2009, 10:01 PM -
Container Managed Persistence
By Java Tip in forum Java TipReplies: 0Last Post: 12-27-2007, 10:16 AM


LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks