From: <eg...@us...> - 2008-11-06 09:16:58
|
Revision: 13006 http://cdk.svn.sourceforge.net/cdk/?rev=13006&view=rev Author: egonw Date: 2008-11-06 09:16:47 +0000 (Thu, 06 Nov 2008) Log Message: ----------- Refactored CoverageTest to be JUnit4-based Modified Paths: -------------- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/Builder3dCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ControlCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/CoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DataCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DatadebugCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DictCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ForcefieldCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/FormulaCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IonpotCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IsomorphismCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiocmlCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiomdCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/NonotifyCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbcmlCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QmCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QsarcmlCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/SmartsCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/StructgenCoverageTest.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/Mbuilder3dTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdataTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdictTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MforcefieldTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiocmlTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiomdTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MnonotifyTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MpdbTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MqmTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MsmartsTests.java cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MstructgenTests.java Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/Builder3dCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/Builder3dCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/Builder3dCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "builder3d.javafiles"; - public Builder3dCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, Builder3dCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(Builder3dCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ControlCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ControlCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ControlCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,8 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,19 +34,10 @@ private final static String CLASS_LIST = "control.javafiles"; - public ControlCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, ControlCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(ControlCoverageTest.class); - } - public void testCoverage() { super.runCoverageTest(); } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/CoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/CoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/CoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -30,8 +30,7 @@ import java.util.Iterator; import java.util.List; -import junit.framework.Test; -import junit.framework.TestCase; +import org.junit.Assert; /** * This test class is <b>not</b> intended to be tested directly, @@ -39,38 +38,23 @@ * * @cdk.module test */ -abstract public class CoverageTest extends TestCase { +abstract public class CoverageTest { - private final String basePackageName = "org.openscience.cdk."; + private final static String BASEPACKAGENAME = "org.openscience.cdk."; - private ClassLoader classLoader; - private List<String> classesToTest; + private static ClassLoader classLoader; + private static List<String> classesToTest; - private String module; - - public CoverageTest(String name) { - super(name); - classesToTest = null; - } + private static String module; - protected void setUp() throws Exception { - classLoader = this.getClass().getClassLoader(); - } - - /** - * This method must be overwritten by subclasses. - */ - public static Test suite() { - return null; - } - - protected void loadClassList(String classList) throws Exception { + protected static void loadClassList(String classList, ClassLoader loader) throws Exception { + classLoader = loader; classesToTest = new ArrayList<String>(); module = classList.substring(0, classList.indexOf('.')); // get the src/core.javafiles file - InputStream stream = this.getClass().getClassLoader().getResourceAsStream(classList); - if (stream == null) fail("File not found in the classpath: " + classList); + InputStream stream = loader.getResourceAsStream(classList); + if (stream == null) Assert.fail("File not found in the classpath: " + classList); BufferedReader reader = new BufferedReader(new InputStreamReader(stream)); while (reader.ready()) { // load them one by one @@ -100,7 +84,7 @@ } } if (missingTestsCount > 0 || untestedClassesCount > 0) { - fail("The " + module + " module is not fully tested! Missing number of method tests: " + + Assert.fail("The " + module + " module is not fully tested! Missing number of method tests: " + missingTestsCount + " in number of classes: " + uncoveredClassesCount + "; " + "Missing test classes: " + untestedClassesCount); } @@ -259,7 +243,7 @@ return capitalizedName; } - private String convertSlash2Dot(String className) { + private static String convertSlash2Dot(String className) { StringBuffer sb = new StringBuffer(); for (int i=0; i<className.length(); i++) { if (className.charAt(i) == '/') { @@ -272,11 +256,11 @@ } private String getTestClassName(String className) { - return basePackageName + className + "Test"; + return BASEPACKAGENAME + className + "Test"; } private String getClassName(String className) { - return basePackageName + className; + return BASEPACKAGENAME + className; } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DataCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DataCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DataCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "data.javafiles"; - public DataCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, DataCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(DataCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DatadebugCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DatadebugCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DatadebugCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "datadebug.javafiles"; - public DatadebugCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, DatadebugCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(DatadebugCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DictCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DictCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/DictCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "dict.javafiles"; - public DictCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, DictCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(DictCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ForcefieldCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ForcefieldCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/ForcefieldCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "forcefield.javafiles"; - public ForcefieldCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, ForcefieldCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(ForcefieldCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/FormulaCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/FormulaCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/FormulaCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -20,10 +20,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that tests if all public methods in the formula * module are tested. @@ -34,23 +33,12 @@ private final static String CLASS_LIST = "formula.javafiles"; - public FormulaCoverageTest(String name) { - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, FormulaCoverageTest.class.getClassLoader()); } - protected void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); + @Test public void testCoverage() { + super.runCoverageTest(); } - public static Test suite() { - TestSuite suite = new TestSuite(); - suite.addTestSuite(FormulaCoverageTest.class); - return suite; - } - - public void testCoverage() { - assertTrue(super.runCoverageTest()); - } - } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IonpotCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IonpotCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IonpotCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -20,10 +20,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that uses tests whether all public methods in the core * module are tested. Unlike Emma, it does not test that all code is @@ -35,23 +34,12 @@ private final static String CLASS_LIST = "ionpot.javafiles"; - public IonpotCoverageTest(String name) { - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, IonpotCoverageTest.class.getClassLoader()); } - protected void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); + @Test public void testCoverage() { + super.runCoverageTest(); } - public static Test suite() { - TestSuite suite = new TestSuite(); - suite.addTestSuite(IonpotCoverageTest.class); - return suite; - } - - public void testCoverage() { - assertTrue(super.runCoverageTest()); - } - } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IsomorphismCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IsomorphismCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/IsomorphismCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -20,10 +20,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that uses tests whether all public methods in the core * module are tested. Unlike Emma, it does not test that all code is @@ -35,23 +34,12 @@ private final static String CLASS_LIST = "isomorphism.javafiles"; - public IsomorphismCoverageTest(String name) { - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, IsomorphismCoverageTest.class.getClassLoader()); } - protected void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); + @Test public void testCoverage() { + super.runCoverageTest(); } - public static Test suite() { - TestSuite suite = new TestSuite(); - suite.addTestSuite(IsomorphismCoverageTest.class); - return suite; - } - - public void testCoverage() { - assertTrue(super.runCoverageTest()); - } - } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiocmlCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiocmlCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiocmlCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "libiocml.javafiles"; - public LibiocmlCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, LibiocmlCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(LibiocmlCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiomdCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiomdCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/LibiomdCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "libiomd.javafiles"; - public LibiomdCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, LibiomdCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(LibiomdCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/NonotifyCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/NonotifyCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/NonotifyCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "nonotify.javafiles"; - public NonotifyCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, NonotifyCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(NonotifyCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "pdb.javafiles"; - public PdbCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, PdbCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(PdbCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbcmlCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbcmlCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/PdbcmlCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "pdbcml.javafiles"; - public PdbcmlCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, PdbcmlCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(PdbcmlCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QmCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QmCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QmCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "qm.javafiles"; - public QmCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, QmCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(QmCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QsarcmlCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QsarcmlCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/QsarcmlCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "qsarcml.javafiles"; - public QsarcmlCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, QsarcmlCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(QsarcmlCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/SmartsCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/SmartsCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/SmartsCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -23,10 +23,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that runs all the sample tests. * @@ -36,20 +35,11 @@ private final static String CLASS_LIST = "smarts.javafiles"; - public SmartsCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, SmartsCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(SmartsCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/StructgenCoverageTest.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/StructgenCoverageTest.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/coverage/StructgenCoverageTest.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -20,10 +20,9 @@ */ package org.openscience.cdk.coverage; +import org.junit.BeforeClass; +import org.junit.Test; -import junit.framework.Test; -import junit.framework.TestSuite; - /** * TestSuite that performs a simple coverage test of the structgen module. * @@ -33,20 +32,11 @@ private final static String CLASS_LIST = "structgen.javafiles"; - public StructgenCoverageTest(String name){ - super(name); + @BeforeClass public static void setUp() throws Exception { + loadClassList(CLASS_LIST, StructgenCoverageTest.class.getClassLoader()); } - public void setUp() throws Exception { - super.setUp(); - super.loadClassList(CLASS_LIST); - } - - public static Test suite() { - return new TestSuite(StructgenCoverageTest.class); - } - - public void testCoverage() { + @Test public void testCoverage() { super.runCoverageTest(); } } Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/Mbuilder3dTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/Mbuilder3dTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/Mbuilder3dTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -42,7 +42,7 @@ public static Test suite () { TestSuite suite = new TestSuite("The CDK builder3d module Tests"); - suite.addTest(Builder3dCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(Builder3dCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(ModelBuilder3dTest.class)); suite.addTest(new JUnit4TestAdapter(TemplateHandler3DTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdataTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdataTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdataTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -81,11 +81,10 @@ public static Test suite () { TestSuite suite= new TestSuite("The CDK data module Tests"); - suite.addTest(DataCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(DataCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(AminoAcidTest.class)); suite.addTest(new JUnit4TestAdapter(AtomContainerTest.class)); - //suite.addTest(AtomEnumerationTest.suite()); suite.addTest(new JUnit4TestAdapter(AtomParityTest.class)); suite.addTest(new JUnit4TestAdapter(AtomTest.class)); suite.addTest(new JUnit4TestAdapter(AtomTypeTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdictTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdictTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MdictTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -39,7 +39,7 @@ public static Test suite() { TestSuite suite= new TestSuite("All CDK dict module Tests"); - suite.addTest(DictCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(DictCoverageTest.class)); // from cdk.dict suite.addTest(new JUnit4TestAdapter(DictDBTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MforcefieldTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MforcefieldTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MforcefieldTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -42,7 +42,7 @@ public static Test suite () { TestSuite suite= new TestSuite("The CDK force field module Tests"); - suite.addTest(ForcefieldCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(ForcefieldCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(ForceFieldTests.class)); suite.addTest(new JUnit4TestAdapter(MMFF94PartialChargesTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiocmlTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiocmlTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiocmlTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -37,7 +37,7 @@ public static Test suite () { TestSuite suite= new TestSuite("libiocml module Tests"); - suite.addTest(LibiocmlCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(LibiocmlCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(ConvertorTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiomdTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiomdTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MlibiomdTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -37,7 +37,7 @@ public static Test suite () { TestSuite suite= new TestSuite("libiomd inchi module Tests"); - suite.addTest(LibiomdCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(LibiomdCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(MDMoleculeTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MnonotifyTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MnonotifyTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MnonotifyTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -76,7 +76,7 @@ public static Test suite () { TestSuite suite= new TestSuite("The cdk.debug Tests"); - suite.addTest(NonotifyCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(NonotifyCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(NNChemObjectBuilderTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MpdbTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MpdbTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MpdbTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -42,7 +42,7 @@ public static Test suite () { TestSuite suite= new TestSuite("The pdb module Tests"); - suite.addTest(PdbCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(PdbCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(AminoAcidsTest.class)); suite.addTest(new JUnit4TestAdapter(PDBReaderTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MqmTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MqmTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MqmTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -20,6 +20,7 @@ */ package org.openscience.cdk.modulesuites; +import junit.framework.JUnit4TestAdapter; import junit.framework.Test; import junit.framework.TestSuite; @@ -38,7 +39,7 @@ { TestSuite suite= new TestSuite("All CDK QM module Tests"); - suite.addTest(QmCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(QmCoverageTest.class)); // Individual Tests // suite.addTest(GraphRendererTest.suite()); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MsmartsTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MsmartsTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MsmartsTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -37,7 +37,7 @@ public static Test suite () { TestSuite suite= new TestSuite("The cdk.smarts Tests"); - suite.addTest(SmartsCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(SmartsCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(SMARTSTest.class)); Modified: cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MstructgenTests.java =================================================================== --- cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MstructgenTests.java 2008-11-06 09:15:23 UTC (rev 13005) +++ cdk/branches/cdk-1.2.x/src/test/org/openscience/cdk/modulesuites/MstructgenTests.java 2008-11-06 09:16:47 UTC (rev 13006) @@ -43,7 +43,7 @@ public static Test suite() { TestSuite suite= new TestSuite("JUnit tests for the structgen module"); - suite.addTest(StructgenCoverageTest.suite()); + suite.addTest(new JUnit4TestAdapter(StructgenCoverageTest.class)); suite.addTest(new JUnit4TestAdapter(StructGenMatcherTest.class)); suite.addTest(new JUnit4TestAdapter(StructGenAtomTypeGuesserTest.class)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |