You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/09/14 16:20:48 UTC
svn commit: r575693 -
/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java
Author: twgoetz
Date: Fri Sep 14 07:20:48 2007
New Revision: 575693
URL: http://svn.apache.org/viewvc?rev=575693&view=rev
Log:
No Jira: just formatting. I must have messed this up the last time I changed it.
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java?rev=575693&r1=575692&r2=575693&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/CASTest.java Fri Sep 14 07:20:48 2007
@@ -35,125 +35,125 @@
*/
public class CASTest extends TestCase {
- private CAS cas;
+ private CAS cas;
- private TypeSystem ts;
+ private TypeSystem ts;
- /**
+ /**
* Constructor for CASTest.
*
* @param arg0
*/
- public CASTest(String arg0) {
- super(arg0);
- }
-
- public void setUp() {
- try {
- this.cas = CASInitializer.initCas(new CASTestSetup());
- this.ts = this.cas.getTypeSystem();
- } catch (Exception e) {
- assertTrue(false);
- }
- }
-
- public void tearDown() {
- this.cas = null;
- this.ts = null;
- }
-
- public void testGetTypeSystem() {
- assertTrue(this.cas.getTypeSystem() != null);
- }
-
- public void testCreateFS() {
- // Can create FS of type "Top"
- assertTrue(this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_TOP)) != null);
- boolean caughtExc = false;
- // Can't create int FS.
- try {
- this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_INTEGER));
- } catch (CASRuntimeException e) {
- caughtExc = true;
- assertTrue(e.getMessageKey().equals(CASRuntimeException.NON_CREATABLE_TYPE));
- }
- assertTrue(caughtExc);
- caughtExc = false;
- // Can't create array with CAS.createFS().
- try {
- this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_FS_ARRAY));
- } catch (CASRuntimeException e) {
- caughtExc = true;
- assertTrue(e.getMessageKey().equals(CASRuntimeException.NON_CREATABLE_TYPE));
- }
- assertTrue(caughtExc);
- caughtExc = false;
-
- // Check that we can create structures that are larger than the internal
- // heap page size.
- final int arraySize = 1000000;
- // Make sure that the structure we're trying to create is actually larger
- // than the page size we're testing with.
- assertTrue(arraySize > Heap.DEFAULT_PAGE_SIZE);
- IntArrayFS array = null;
- try {
- array = this.cas.createIntArrayFS(arraySize);
- } catch (CASRuntimeException e) {
- assertTrue(false);
- }
- try {
- array.set(arraySize - 1, 1);
- } catch (ArrayIndexOutOfBoundsException e) {
- assertTrue(false);
- }
-
- // Can't create array subtype with CAS.createFS().
- // try {
- // this.cas.createFS(this.ts.getType(CASTestSetup.INT_ARRAY_SUB));
- // } catch (CASRuntimeException e) {
- // caughtExc = true;
- // assertTrue(e.getError() == CASRuntimeException.NON_CREATABLE_TYPE);
- // }
- // assertTrue(caughtExc);
- }
-
- public void testCreateCAS() {
- TypeSystemMgr tsm = CASFactory.createTypeSystem();
- tsm.commit();
- }
-
- public void testCreateArrayFS() {
- // Has its own test class.
- }
-
- public void testCreateIntArrayFS() {
- // Has its own test class.
- }
-
- public void testCreateStringArrayFS() {
- // Has its own test class.
- }
-
- // public void testCreateFilteredIterator() {
- // }
- //
- // public void testCommitFS() {
- // }
- //
- // public void testGetConstraintFactory() {
- // }
- //
- // public void testCreateFeaturePath() {
- // }
- //
- // public void testGetIndexRepository() {
- // }
- //
- // public void testFs2listIterator() {
- // }
- //
- public static void main(String[] args) {
- junit.textui.TestRunner.run(CASTest.class);
- }
+ public CASTest(String arg0) {
+ super(arg0);
+ }
+
+ public void setUp() {
+ try {
+ this.cas = CASInitializer.initCas(new CASTestSetup());
+ this.ts = this.cas.getTypeSystem();
+ } catch (Exception e) {
+ assertTrue(false);
+ }
+ }
+
+ public void tearDown() {
+ this.cas = null;
+ this.ts = null;
+ }
+
+ public void testGetTypeSystem() {
+ assertTrue(this.cas.getTypeSystem() != null);
+ }
+
+ public void testCreateFS() {
+ // Can create FS of type "Top"
+ assertTrue(this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_TOP)) != null);
+ boolean caughtExc = false;
+ // Can't create int FS.
+ try {
+ this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_INTEGER));
+ } catch (CASRuntimeException e) {
+ caughtExc = true;
+ assertTrue(e.getMessageKey().equals(CASRuntimeException.NON_CREATABLE_TYPE));
+ }
+ assertTrue(caughtExc);
+ caughtExc = false;
+ // Can't create array with CAS.createFS().
+ try {
+ this.cas.createFS(this.ts.getType(CAS.TYPE_NAME_FS_ARRAY));
+ } catch (CASRuntimeException e) {
+ caughtExc = true;
+ assertTrue(e.getMessageKey().equals(CASRuntimeException.NON_CREATABLE_TYPE));
+ }
+ assertTrue(caughtExc);
+ caughtExc = false;
+
+ // Check that we can create structures that are larger than the internal
+ // heap page size.
+ final int arraySize = 1000000;
+ // Make sure that the structure we're trying to create is actually larger
+ // than the page size we're testing with.
+ assertTrue(arraySize > Heap.DEFAULT_PAGE_SIZE);
+ IntArrayFS array = null;
+ try {
+ array = this.cas.createIntArrayFS(arraySize);
+ } catch (CASRuntimeException e) {
+ assertTrue(false);
+ }
+ try {
+ array.set(arraySize - 1, 1);
+ } catch (ArrayIndexOutOfBoundsException e) {
+ assertTrue(false);
+ }
+
+ // Can't create array subtype with CAS.createFS().
+ // try {
+ // this.cas.createFS(this.ts.getType(CASTestSetup.INT_ARRAY_SUB));
+ // } catch (CASRuntimeException e) {
+ // caughtExc = true;
+ // assertTrue(e.getError() == CASRuntimeException.NON_CREATABLE_TYPE);
+ // }
+ // assertTrue(caughtExc);
+ }
+
+ public void testCreateCAS() {
+ TypeSystemMgr tsm = CASFactory.createTypeSystem();
+ tsm.commit();
+ }
+
+ public void testCreateArrayFS() {
+ // Has its own test class.
+ }
+
+ public void testCreateIntArrayFS() {
+ // Has its own test class.
+ }
+
+ public void testCreateStringArrayFS() {
+ // Has its own test class.
+ }
+
+ // public void testCreateFilteredIterator() {
+ // }
+ //
+ // public void testCommitFS() {
+ // }
+ //
+ // public void testGetConstraintFactory() {
+ // }
+ //
+ // public void testCreateFeaturePath() {
+ // }
+ //
+ // public void testGetIndexRepository() {
+ // }
+ //
+ // public void testFs2listIterator() {
+ // }
+ //
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(CASTest.class);
+ }
}