[46376] pkgname (case-insens) = a classname results in too complicated to parse init string
diff --git a/tests/org.eclipse.jem.tests/javatests/InitParserTest46376.java b/tests/org.eclipse.jem.tests/javatests/InitParserTest46376.java new file mode 100644 index 0000000..f208c3d --- /dev/null +++ b/tests/org.eclipse.jem.tests/javatests/InitParserTest46376.java
@@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright (c) 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* + * $RCSfile: InitParserTest46376.java,v $ + * $Revision: 1.1 $ $Date: 2003/11/11 16:27:40 $ + */ + +/** + * This is to test for defect [46376]. + * + * SameName test. This is test where you have this: + * initParserTest46376.SameNameTestClass.java + * InitParserTest46376.java + * + * Before [46376] the Static parser would find throw NoClassDefFoundError on initParserTest46376 when looking for + * SameNameTestClass and never find the class. + * + * To compile in Eclipse we need to have one of the classes be in the default package. Eclipse complains if we didn't. + * But there is nothing to stop this from happening with packages too if they are spread across compile groups. + */ +public class InitParserTest46376 { + +}
diff --git a/tests/org.eclipse.jem.tests/javatests/initParserTest46376/SameNameTestClass.java b/tests/org.eclipse.jem.tests/javatests/initParserTest46376/SameNameTestClass.java new file mode 100644 index 0000000..7ecdcfa --- /dev/null +++ b/tests/org.eclipse.jem.tests/javatests/initParserTest46376/SameNameTestClass.java
@@ -0,0 +1,38 @@ +package initParserTest46376; +/******************************************************************************* + * Copyright (c) 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* + * $RCSfile: SameNameTestClass.java,v $ + * $Revision: 1.1 $ $Date: 2003/11/11 16:27:40 $ + */ +/** + * This is to test for defect [46376]. + * + * SameName test. This is test where you have this: + * InitParserTest46376.SameNameTestClass.java + * InitParserTest46376.java + * + * and + * + * new org.eclipse.jem.tests.proxy.initParser.SameNameTestClass.RealClass() + * + * Before [46376] the Static parser would find SameNameTestClass.java instead of the RealClass and would of failed. + * To compile in Eclipse we need to have one of the classes be in the default package. Eclipse complains if we didn't. + * But there is nothing to stop this from happening with packages too if they are spread across compile groups. + */ +public class SameNameTestClass { + + public boolean equals(Object other) { + // To make test easier, we simply looking if both of same type. + return other != null && other.getClass() == SameNameTestClass.class; + } + +}
diff --git a/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/InitParserSuite.java b/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/InitParserSuite.java index ea74fa5..1756797 100644 --- a/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/InitParserSuite.java +++ b/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/InitParserSuite.java
@@ -11,7 +11,7 @@ *******************************************************************************/ /* * $RCSfile: InitParserSuite.java,v $ - * $Revision: 1.2 $ $Date: 2003/10/27 17:32:36 $ + * $Revision: 1.3 $ $Date: 2003/11/11 16:27:40 $ */ import junit.framework.Test; import junit.framework.TestSuite; @@ -40,7 +40,8 @@ CharTest.class, JFCTest.class, BorderTest.class, - OverloadingTest.class + OverloadingTest.class, + SameName46376Test.class } ; public static String pkgName = "org.eclipse.jem.tests.proxy.initParser" ;
diff --git a/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/SameName46376Test.java b/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/SameName46376Test.java new file mode 100644 index 0000000..0e3c1c6 --- /dev/null +++ b/tests/org.eclipse.jem.tests/javatests/org/eclipse/jem/tests/proxy/initParser/SameName46376Test.java
@@ -0,0 +1,41 @@ +package org.eclipse.jem.tests.proxy.initParser; +/******************************************************************************* + * Copyright (c) 2003 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/* + * $RCSfile: SameName46376Test.java,v $ + * $Revision: 1.1 $ $Date: 2003/11/11 16:27:40 $ + */ + +/** + * This is to test for defect [46376]. + * + * SameName test. This is test where you have this: + * InitParserTest46376.SameNameTestClass.java + * InitParserTest46376.java + * + * and + * + * new org.eclipse.jem.tests.proxy.initParser.SameNameTestClass.RealClass() + * + * Before [46376] the Static parser would find SameNameTestClass.java instead of the RealClass and would of failed. + * To compile in Eclipse we need to have one of the classes be in the default package. Eclipse complains if we didn't. + * But there is nothing to stop this from happening with packages too if they are spread across compile groups. + */ +public class SameName46376Test extends AbstractInitParserTestCase { + + public SameName46376Test(String name) { + super(name); + } + + public void test46376() throws Throwable { + testHelper.testInitString("new initParserTest46376.SameNameTestClass()", new initParserTest46376.SameNameTestClass()); + } +}