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 2016/05/04 18:18:57 UTC

svn commit: r1742314 - /uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java

Author: schor
Date: Wed May  4 18:18:57 2016
New Revision: 1742314

URL: http://svn.apache.org/viewvc?rev=1742314&view=rev
Log:
no Jira - add test for low level set int value

Modified:
    uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java

Modified: uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java?rev=1742314&r1=1742313&r2=1742314&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/FeatureStructureTest.java Wed May  4 18:18:57 2016
@@ -28,8 +28,11 @@ import org.apache.uima.cas.Feature;
 import org.apache.uima.cas.FeatureStructure;
 import org.apache.uima.cas.Type;
 import org.apache.uima.cas.TypeSystem;
+import org.apache.uima.cas.impl.FeatureImpl;
+import org.apache.uima.cas.impl.FeatureStructureImpl;
 import org.apache.uima.cas.impl.LowLevelCAS;
 import org.apache.uima.cas.impl.LowLevelTypeSystem;
+import org.apache.uima.cas.impl.TypeSystemImpl;
 import org.apache.uima.cas.text.AnnotationFS;
 
 /**
@@ -262,6 +265,16 @@ public class FeatureStructureTest extend
 		testString = "";
 		token.setStringValue(this.lemmaFeat, testString);
 		assertTrue(token.getStringValue(this.lemmaFeat).equals(testString));
+		
+    // test low level
+    LowLevelCAS llcas = cas.getLowLevelCAS();
+    token.setFeatureValue(tokenTypeFeat, word);
+    int fsRef = ((FeatureStructureImpl)token).getAddress();
+    int fc = ((FeatureImpl)tokenTypeFeat).getCode();
+    assertEquals(llcas.ll_getIntValue(fsRef, fc), word.hashCode());
+    FeatureStructureImpl word2 = cas.createFS(wordType);
+    llcas.ll_setIntValue(fsRef, fc, word2.hashCode());
+    assertEquals(token.getFeatureValue(tokenTypeFeat), word2);
 	}
 
 	public void testSetFloatValue() {