Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SecurityException from junit.framework.JUnit4TestAdapter

807580Apr 1 2008 — edited Oct 8 2009
Hi all,
I have a small code using JUnit 4.4. I get the following error when I run the code. Any idea? Any help is greatly appreciated.
java.lang.SecurityException: class "junit.framework.JUnit4TestAdapter"'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)
My code:
import static org.junit.Assert.assertTrue;
import junit.framework.JUnit4TestAdapter;

import org.junit.Before;
import org.junit.Test;

public class MyClass {

	private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(MyClass.class);


	@Before
	public void setUp() throws Exception {
		System.setProperty("FILENAME", qUnitTestConstants.EnvFile);
    }
	
	@Test public void success(){

		String name = "name";
		assertTrue(name.equals("name"));
	}

	public static junit.framework.Test suite() {
		return new JUnit4TestAdapter(MyClass.class);
	}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2009
Added on Apr 1 2008
5 comments
715 views