You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/07/06 16:50:59 UTC
svn commit: r553913 - in
/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima:
cas/test/CASTestSetup.java jcas/test/CASTestSetup.java
Author: schor
Date: Fri Jul 6 07:50:58 2007
New Revision: 553913
URL: http://svn.apache.org/viewvc?view=rev&rev=553913
Log:
[UIMA-479] For JUNIT things which are just setup and have no tests, remove the
extends TestCase. This prevents JUNIT from looking for tests in them. But it broke
the use of assertTrue. That was fixed by writing TestCase.asserTrue - since they are
static methods.
Now Maven and Eclispe JUNIT running are both OK.
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/jcas/test/CASTestSetup.java
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java?view=diff&rev=553913&r1=553912&r2=553913
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTestSetup.java Fri Jul 6 07:50:58 2007
@@ -32,7 +32,7 @@
import org.apache.uima.cas.admin.LinearTypeOrderBuilder;
import org.apache.uima.cas.admin.TypeSystemMgr;
-public class CASTestSetup extends TestCase implements AnnotatorInitializer {
+public class CASTestSetup implements AnnotatorInitializer {
// Type system constants.
public static final String TOKEN_TYPE = "Token";
@@ -154,18 +154,18 @@
try {
tsm.addType("some.new.Name", group1);
} catch (CASAdminException e) {
- assertTrue(e.getError() == CASAdminException.TYPE_IS_INH_FINAL);
+ TestCase.assertTrue(e.getError() == CASAdminException.TYPE_IS_INH_FINAL);
exc = true;
}
- assertTrue(exc);
+ TestCase.assertTrue(exc);
exc = false;
try {
tsm.addFeature("some.new.Name", group1, stringType);
} catch (CASAdminException e) {
- assertTrue(e.getError() == CASAdminException.TYPE_IS_FEATURE_FINAL);
+ TestCase.assertTrue(e.getError() == CASAdminException.TYPE_IS_FEATURE_FINAL);
exc = true;
}
- assertTrue(exc);
+ TestCase.assertTrue(exc);
}
public void initIndexes(FSIndexRepositoryMgr irm, TypeSystem ts) {
@@ -181,7 +181,7 @@
tob.add(new String[] { CAS.TYPE_NAME_ANNOTATION, SENT_TYPE, TOKEN_TYPE });
comp.addKey(tob.getOrder(), FSIndexComparator.STANDARD_COMPARE);
} catch (CASException e) {
- assertTrue(false);
+ TestCase.assertTrue(false);
}
irm.createIndex(comp, ANNOT_BAG_INDEX, FSIndex.BAG_INDEX);
irm.createIndex(comp, ANNOT_SET_INDEX, FSIndex.SET_INDEX);
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/jcas/test/CASTestSetup.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/jcas/test/CASTestSetup.java?view=diff&rev=553913&r1=553912&r2=553913
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/jcas/test/CASTestSetup.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/jcas/test/CASTestSetup.java Fri Jul 6 07:50:58 2007
@@ -30,7 +30,7 @@
import org.apache.uima.cas.admin.FSIndexRepositoryMgr;
import org.apache.uima.cas.admin.TypeSystemMgr;
-public class CASTestSetup extends TestCase implements AnnotatorInitializer {
+public class CASTestSetup implements AnnotatorInitializer {
// selectors for generating various bad setups to force error checking
public final int bad;
@@ -201,18 +201,18 @@
try {
tsm.addType("some.new.Name", group1);
} catch (CASAdminException e) {
- assertTrue(e.getError() == CASAdminException.TYPE_IS_INH_FINAL);
+ TestCase.assertTrue(e.getError() == CASAdminException.TYPE_IS_INH_FINAL);
exc = true;
}
- assertTrue(exc);
+ TestCase.assertTrue(exc);
exc = false;
try {
tsm.addFeature("some.new.Name", group1, typeString);
} catch (CASAdminException e) {
- assertTrue(e.getError() == CASAdminException.TYPE_IS_FEATURE_FINAL);
+ TestCase.assertTrue(e.getError() == CASAdminException.TYPE_IS_FEATURE_FINAL);
exc = true;
}
- assertTrue(exc);
+ TestCase.assertTrue(exc);
}
public void initIndexes(FSIndexRepositoryMgr irm, TypeSystem ts) {