You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ea...@apache.org on 2010/09/16 18:07:05 UTC
svn commit: r997816 - in /uima/uimacpp/trunk: ./ docs/ src/cas/
src/test/data/ExampleCas/ src/test/src/
Author: eae
Date: Thu Sep 16 16:07:04 2010
New Revision: 997816
URL: http://svn.apache.org/viewvc?rev=997816&view=rev
Log:
Merge uimacpp-2.3.0 branch back into trunk
Modified:
uima/uimacpp/trunk/ (props changed)
uima/uimacpp/trunk/README.4sdk
uima/uimacpp/trunk/RELEASE_NOTES.html
uima/uimacpp/trunk/docs/builddocs.cmd
uima/uimacpp/trunk/docs/builddocs.sh
uima/uimacpp/trunk/docs/overview_and_setup.html
uima/uimacpp/trunk/docs/uimacpp.dox
uima/uimacpp/trunk/docs/uimacppdocs.mak (contents, props changed)
uima/uimacpp/trunk/src/cas/xmiwriter.cpp
uima/uimacpp/trunk/src/test/data/ExampleCas/newprimitivesTypeSystem.xml
uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp
Propchange: uima/uimacpp/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Sep 16 16:07:04 2010
@@ -0,0 +1,2 @@
+/incubator/uima/uimacpp/branches/uimacpp-2.3.0:831288-933272
+/uima/uimacpp/branches/uimacpp-2.3.0:933273-997790
Modified: uima/uimacpp/trunk/README.4sdk
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/README.4sdk?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/README.4sdk (original)
+++ uima/uimacpp/trunk/README.4sdk Thu Sep 16 16:07:04 2010
@@ -1,5 +1,5 @@
- Apache UIMA C++ (Unstructured Information Management Architecture) v2.2.2
+ Apache UIMA C++ (Unstructured Information Management Architecture) v2.3.0
-------------------------------------------------------------------------
Getting Started
Modified: uima/uimacpp/trunk/RELEASE_NOTES.html
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/RELEASE_NOTES.html?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/RELEASE_NOTES.html (original)
+++ uima/uimacpp/trunk/RELEASE_NOTES.html Thu Sep 16 16:07:04 2010
@@ -95,6 +95,9 @@ tutorial and other interlock with Java?
<li>Fixed bug with termination when deployed from Java as separate process</li>
<li>Fixed bug with timing statistics reported to JMX when deployed from Java</li>
<li>Fixed bug with capability specs returned in getMeta reply</li>
+<li>Fixed bug where elementType was not returned in getMeta</li>
+<li>Fixed bug with out-of-typesystem data sending back invalid XML strings</li>
+<li>Fixed bug where feature reference updates were not sent back</li>
</ul>
</p>
@@ -103,6 +106,7 @@ tutorial and other interlock with Java?
<ul>
<li>Added -lenient option to ignore out-of-typesystem data for Xmi format input files</li>
<li>Options added to support multi-threaded stress testing of a C++ annotator</li>
+<li>Output CAS files written in XMI format</li>
</ul>
</p>
Modified: uima/uimacpp/trunk/docs/builddocs.cmd
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/docs/builddocs.cmd?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/docs/builddocs.cmd (original)
+++ uima/uimacpp/trunk/docs/builddocs.cmd Thu Sep 16 16:07:04 2010
@@ -29,17 +29,17 @@ REM under the License.
:build
@echo building uimacpp docs in ..\docs
- nmake -f uimacppdocs.mak build DEL=DEL RD="RM /s /q" MDFILES=html\*.md5 MAPFILES=html\*.map DOTFILES=html\*.dot DOCDIR=.
+ nmake -f uimacppdocs.mak build CP=copy DEL=DEL RD="RM /s /q" MDFILES=html\*.md5 MAPFILES=html\*.map DOTFILES=html\*.dot HTMLDIR=.\html\
goto TheEnd
:rebuild
@echo rebuilding uimacpp docs in ..\docs
- nmake -f uimacppdocs.mak rebuild DEL=DEL RD="RM /s /q" MDFILES=html\*.md5 MAPFILES=html\*.map DOTFILES=html\*.dot DOCDIR=.
+ nmake -f uimacppdocs.mak rebuild CP=copy DEL=DEL RD="RM /s /q" MDFILES=html\*.md5 MAPFILES=html\*.map DOTFILES=html\*.dot HTMLDIR=.\html\
goto TheEnd
:clean
@echo cleaning uimacpp docs in ..\docs
- nmake -f uimacppdocs.mak clean DEL=DEL RD="RM /s /q" DOCDIR=.
+ nmake -f uimacppdocs.mak clean RD="RM /s /q" HTMLDIR=.\html\
goto TheEnd
:TheEnd
Modified: uima/uimacpp/trunk/docs/builddocs.sh
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/docs/builddocs.sh?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/docs/builddocs.sh (original)
+++ uima/uimacpp/trunk/docs/builddocs.sh Thu Sep 16 16:07:04 2010
@@ -17,7 +17,7 @@
#!/bin/sh
#REM Builds the UIMACPP doxygen docs.
-#REM Requires Doxygen 1.3.6 and Graphviz 1.8.10 installed and in the PATH
+#REM Requires Doxygen 1.3.6 installed and in the PATH
#REM This script must be run from the uimacpp/docs subdirectory
if [ -z "$1" ] ; then
@@ -28,11 +28,11 @@ else
fi
if [ $cmd = "build" ] ; then
echo "building docs... "
- make -f uimacppdocs.mak build DEL=rm RD='rm -rf' MDFILES=html/*.md5 MAPFILES=html/*.map DOTFILES=html/*.dot DOCDIR=.
+ make -f uimacppdocs.mak build CP=cp DEL='rm -f' RD='rm -rf' MDFILES=html/*.md5 MAPFILES=html/*.map DOTFILES=html/*.dot HTMLDIR=./html/
elif [ $cmd = "rebuild" ] ; then
echo "rebuilding docs..."
- make -f uimacppdocs.mak rebuild DEL=rm RD='rm -rf' MDFILES=html/*.md5 MAPFILES=html/*.map DOTFILES=html/*.dot DOCDIR=.
+ make -f uimacppdocs.mak rebuild CP=cp DEL='rm -f' RD='rm -rf' MDFILES=html/*.md5 MAPFILES=html/*.map DOTFILES=html/*.dot HTMLDIR=./html/
elif [ $cmd = "clean" ] ; then
echo "cleaning docs dir..."
- make -f uimacppdocs.mak clean DEL=rm RD='rm -rf' DOCDIR=.
+ make -f uimacppdocs.mak clean DEL='rm -f' RD='rm -rf' HTMLDIR=./html/
fi
Modified: uima/uimacpp/trunk/docs/overview_and_setup.html
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/docs/overview_and_setup.html?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/docs/overview_and_setup.html (original)
+++ uima/uimacpp/trunk/docs/overview_and_setup.html Thu Sep 16 16:07:04 2010
@@ -110,6 +110,11 @@ of the annotator is done via the JVM.
<li>No custom flow controller for aggregates.</li>
<li>No support for remote delegates in a C++ aggregate.</li>
<li>No UIMA AS client API</li>
+<li>Import by name not supported when run as a native process
+<ul>
+<b>Note:</b> Import by location supports absolute and relative paths. Relative paths are with respect to the directory of the descriptor doing the import. When run as a native process, relative paths are also searched off directories specified in UIMACPP_DATAPATH.
+</ul>
+</li>
</ul>
</p>
Modified: uima/uimacpp/trunk/docs/uimacpp.dox
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/docs/uimacpp.dox?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/docs/uimacpp.dox (original)
+++ uima/uimacpp/trunk/docs/uimacpp.dox Thu Sep 16 16:07:04 2010
@@ -1136,7 +1136,7 @@ HIDE_UNDOC_RELATIONS = YES
# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
-HAVE_DOT = YES
+HAVE_DOT = NO
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for each documented class showing the direct and
@@ -1188,7 +1188,7 @@ CALL_GRAPH = NO
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
# will graphical hierarchy of all classes instead of a textual one.
-GRAPHICAL_HIERARCHY = YES
+GRAPHICAL_HIERARCHY = NO
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
# generated by dot. Possible values are png, jpg, or gif
Modified: uima/uimacpp/trunk/docs/uimacppdocs.mak
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/docs/uimacppdocs.mak?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/docs/uimacppdocs.mak (original)
+++ uima/uimacpp/trunk/docs/uimacppdocs.mak Thu Sep 16 16:07:04 2010
@@ -1,60 +1,43 @@
-# ---------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ---------------------------------------------------------------------------
-
-#This makefile builds the UIMACPP documentation
-#Requires Doxygen 1.3.6 and Graphviz 1.8.10 installed and
-#PATH environment variable must include
-#doxygen/bin;graphviz/bin;graphviz/bin/tools
-#Must be run from the uimacpp/docs subdirectory
-
-#use these to run in WIN environment
-#RM=RD /s /q
-#DEL=del
-#MDFILES=..\docs\html\*.md5
-#MAPFILES=..\docs\html\*.map
-#DOTFILES=..\docs\html\*.dot
-#DOCDIR=..\docs
-
-#use these to run in LINUX environment
-#RM=rm -rf
-#DEL=rm
-#MDFILES=../docs/html/*.md5
-#MAPFILES=../docs/html/*.map
-#DOTFILES=../docs/html/*.dot
-#DOCDIR=../docs
-
-DOXYGENCMD=doxygen
-
-build : ../docs/html/index.html
-
-../docs/html/index.html : uimacpp.dox
- @echo building docs....
- $(DOXYGENCMD) uimacpp.dox
- $(DEL) $(MDFILES)
- $(DEL) $(MAPFILES)
- $(DEL) $(DOTFILES)
-
-rebuild : clean build
-
-clean :
- @echo deleting $(DOCDIR)/html
- $(RM) $(DOCDIR)/html
- @echo deleting tags file
- $(RM) $(DOCDIR)/uimadoxytags.tag
-
-
-
+# ---------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ---------------------------------------------------------------------------
+
+#This makefile builds the UIMACPP documentation
+#Requires Doxygen 1.3.6
+#PATH must include doxygen command
+#Must be run from the uimacpp/docs subdirectory
+
+DOXYGENCMD=doxygen
+
+build : ../docs/html/index.html
+
+../docs/html/index.html : uimacpp.dox
+ @echo building docs....
+ $(DOXYGENCMD) uimacpp.dox
+ $(DEL) $(MDFILES)
+ $(DEL) $(MAPFILES)
+ $(DEL) $(DOTFILES)
+# can't get doxygen to build correctly without graphical hierarchy
+ $(CP) $(HTMLDIR)hierarchy.html $(HTMLDIR)inherits.html
+
+rebuild : clean build
+
+clean :
+ @echo deleting $(DOCDIR)/html
+ $(RD) $(HTMLDIR)
+ @echo deleting tags file
+ $(DEL) uimadoxytags.tag
+
Propchange: uima/uimacpp/trunk/docs/uimacppdocs.mak
------------------------------------------------------------------------------
svn:eol-style = native
Modified: uima/uimacpp/trunk/src/cas/xmiwriter.cpp
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/src/cas/xmiwriter.cpp?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/src/cas/xmiwriter.cpp (original)
+++ uima/uimacpp/trunk/src/cas/xmiwriter.cpp Thu Sep 16 16:07:04 2010
@@ -741,7 +741,10 @@ namespace uima {
//attributes
for (size_t a=0; a < oed->attributes.size(); a++) {
XmlAttribute * attr = oed->attributes.at(a);
- os << " " << attr->name << "=\"" << attr->value << "\"";
+ icu::UnicodeString us;
+ icu::UnicodeString av(attr->value.c_str());
+ normalize( av, us );
+ os << " " << attr->name << "=\"" << us << "\"";
}
//child elements
map<string,vector<string>*>::iterator ite ;
@@ -749,8 +752,11 @@ namespace uima {
ite != oed->childElements.end(); ite++) {
vector<string> * values = ite->second;
for (size_t v=0; v < values->size();v++) {
+ icu::UnicodeString us;
+ icu::UnicodeString av(values->at(v).c_str());
+ normalize( av, us );
strcontent << " <" << ite->first
- << ">" << values->at(v)
+ << ">" << us
<< "</" << ite->first << ">";
}
}
@@ -974,6 +980,11 @@ void XmiWriter::write(ostream & os) {
}
indexes->push_back(sofa);
enqueuedFS[tyfs] = indexes;
+ // and look for references
+ // currently this is done for every FS.
+ // This could be done more efficiently
+ // when enqueueing the incoming FS.
+ findReferencedFSs(fs, false);
return false;
}
// new FS, enqueue it and note the indexed Sofa
@@ -1192,7 +1203,10 @@ void XmiWriter::serializeOutOfTypeSystem
// Add other attributes
for (size_t a=0; a < oed->attributes.size();a++) {
XmlAttribute * attr = oed->attributes.at(a);
- os << " " << attr->name << "=\"" << attr->value << "\"";
+ icu::UnicodeString us;
+ icu::UnicodeString av(attr->value.c_str());
+ normalize( av, us );
+ os << " " << attr->name << "=\"" << us << "\"";
}
if (oed->childElements.size() > 0) {
os << ">";
@@ -1201,8 +1215,11 @@ void XmiWriter::serializeOutOfTypeSystem
for (ite = oed->childElements.begin(); ite != oed->childElements.end();ite++ ) {
vector<string> * values = ite->second;
for (size_t v=0; v < values->size(); v++) {
+ icu::UnicodeString us;
+ icu::UnicodeString av(values->at(v).c_str());
+ normalize( av, us );
os << " <" << ite->first << ">";
- os << values->at(v);
+ os << us;
os << "</" << ite->first << ">";
}
}
Modified: uima/uimacpp/trunk/src/test/data/ExampleCas/newprimitivesTypeSystem.xml
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/src/test/data/ExampleCas/newprimitivesTypeSystem.xml?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/src/test/data/ExampleCas/newprimitivesTypeSystem.xml (original)
+++ uima/uimacpp/trunk/src/test/data/ExampleCas/newprimitivesTypeSystem.xml Thu Sep 16 16:07:04 2010
@@ -74,6 +74,17 @@
<name>stringArrayFeature</name>
<description></description>
<rangeTypeName>uima.cas.StringArray</rangeTypeName>
+ </featureDescription>
+ <featureDescription>
+ <name>stringArrayFeatureMultiRef</name>
+ <description></description>
+ <rangeTypeName>uima.cas.StringArray</rangeTypeName>
+ <multipleReferencesAllowed> true </multipleReferencesAllowed>
+ </featureDescription>
+ <featureDescription>
+ <name>otherAnnotation</name>
+ <description></description>
+ <rangeTypeName>uima.tcas.Annotation</rangeTypeName>
</featureDescription>
<featureDescription>
<name>boolArrayFeature</name>
Modified: uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp
URL: http://svn.apache.org/viewvc/uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp?rev=997816&r1=997815&r2=997816&view=diff
==============================================================================
--- uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp (original)
+++ uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp Thu Sep 16 16:07:04 2010
@@ -33,12 +33,11 @@
#include <fstream>
-#ifdef NDEBUG
+#ifndef NDEBUG
#define ASSERT_OR_THROWEXCEPTION(x) assert(x)
#else
#define ASSERT_OR_THROWEXCEPTION(x) if (!(x)) { cerr << __FILE__ << ": Error in line " << __LINE__ << endl; exit(1); }
#endif
-
#define LOG(x) cout << __FILE__ << __LINE__ << ": " << x << endl
using namespace uima;
@@ -511,6 +510,115 @@ void testOotsComplexCas(internal::CASDef
delete cas2;
delete cas3;
}
+
+
+void doTestFSRefReserialization(internal::CASDefinition * casDef) {
+
+ ErrorInfo errInfo;
+ XmiSerializationSharedData sharedData;
+
+ CAS * cas = uima::Framework::createCAS(*casDef, errInfo);
+ ASSERT_OR_THROWEXCEPTION( EXISTS(cas) );
+ CAS * view = cas->createView("AView");
+ view->setDocumentText(UnicodeString("sample text for AView"));
+
+ Type testType = view->getTypeSystem().getType("test.primitives.Example");
+ ASSERT_OR_THROWEXCEPTION( testType.isValid() );
+ Feature stringF = testType.getFeatureByBaseName("stringFeature");
+ ASSERT_OR_THROWEXCEPTION( stringF.isValid() );
+ Feature beginF = testType.getFeatureByBaseName("begin");
+ ASSERT_OR_THROWEXCEPTION( beginF.isValid() );
+ Feature endF = testType.getFeatureByBaseName("end");
+ ASSERT_OR_THROWEXCEPTION( endF.isValid() );
+ Feature stringArrayF = testType.getFeatureByBaseName("stringArrayFeatureMultiRef");
+ ASSERT_OR_THROWEXCEPTION( stringArrayF.isValid() );
+ Feature otherF = testType.getFeatureByBaseName("otherAnnotation");
+ ASSERT_OR_THROWEXCEPTION( otherF.isValid() );
+ Type annotType = cas->getTypeSystem().getType(CAS::TYPE_NAME_ANNOTATION);
+
+ //get index repository
+ FSIndexRepository & indexRep = view->getIndexRepository();
+
+ //create FS but festures that are FS refs unset
+ FeatureStructure fs = view->createFS(testType);
+ ASSERT_OR_THROWEXCEPTION( fs.isValid() );
+ fs.setStringValue(stringF, "example");
+ indexRep.addFS(fs);
+
+ // Serialize Xmi
+ ofstream outputStream;
+ outputStream.open("temp.xmi");
+ ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+ XmiWriter xmiwriter(*cas, false);
+ xmiwriter.write(outputStream);
+ outputStream.close();
+
+ // deserialize XMI into another CAS
+ CAS * cas1 = uima::Framework::createCAS(*casDef, errInfo);
+ ASSERT_OR_THROWEXCEPTION( EXISTS(cas1) );
+ XmiDeserializer::deserialize("temp.xmi",*cas1, sharedData);
+
+ CAS * view1 = cas1->getView("AView");
+ // compare
+ ASSERT_OR_THROWEXCEPTION(view1->getAnnotationIndex().getSize() == view->getAnnotationIndex().getSize());
+ ANIterator iter = view1->getAnnotationIndex().iterator();
+ ASSERT_OR_THROWEXCEPTION(iter.isValid());
+ FeatureStructure fs1;
+
+ fs1 = (FeatureStructure) iter.get(); //document annotation
+ ASSERT_OR_THROWEXCEPTION(fs1.isValid());
+ iter.moveToNext();
+ fs1 = (FeatureStructure) iter.get(); //example fs
+ ASSERT_OR_THROWEXCEPTION(fs1.isValid());
+ ASSERT_OR_THROWEXCEPTION(fs1.getIntValue(beginF) == fs.getIntValue(beginF));
+ ASSERT_OR_THROWEXCEPTION(fs1.getStringValue(stringF).compare(fs.getStringValue(stringF)) == 0);
+
+ //create FS and set FS ref feature
+ AnnotationFS otherFS = view1->createAnnotation(annotType, 0,10);
+ fs1.setFSValue(otherF, otherFS);
+ //create a StringArray FS and set StringArrayFS ref feature
+ StringArrayFS strArrayFS = view1->createStringArrayFS(5);
+ strArrayFS.set(0,UnicodeString("first string"));
+ strArrayFS.set(1, UnicodeString("second string"));
+ fs1.setFSValue(stringArrayF, strArrayFS);
+
+ //serialize
+ outputStream.open("temp.xmi");
+ ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+ XmiWriter xmiwriter1(*cas1, false, &sharedData);
+ xmiwriter1.write(outputStream);
+ outputStream.close();
+
+ //deserialize and check that FS reference feature is as expected.
+ CAS * cas2 = uima::Framework::createCAS(*casDef, errInfo);
+ ASSERT_OR_THROWEXCEPTION( EXISTS(cas2) );
+ XmiSerializationSharedData sharedData1;
+ XmiDeserializer::deserialize("temp.xmi",*cas2, sharedData1);
+ CAS * view2 = cas2->getView("AView");
+
+ // check that array refs are not null
+ ASSERT_OR_THROWEXCEPTION(view2->getAnnotationIndex().getSize() == view1->getAnnotationIndex().getSize());
+ iter = view2->getAnnotationIndex().iterator();
+ ASSERT_OR_THROWEXCEPTION(iter.isValid());
+ FeatureStructure fs2;
+ fs2 = (FeatureStructure) iter.get();
+ ASSERT_OR_THROWEXCEPTION(fs2.isValid());
+ iter.moveToNext();
+ fs2 = (FeatureStructure) iter.get();
+ ASSERT_OR_THROWEXCEPTION(fs2.isValid());
+ ASSERT_OR_THROWEXCEPTION(fs2.getStringValue(stringF).compare("example") == 0);
+ AnnotationFS otherfs2 = (AnnotationFS) fs2.getFSValue(otherF);
+ ASSERT_OR_THROWEXCEPTION(otherfs2.isValid());
+ StringArrayFS strArrayFS1 = fs2.getStringArrayFSValue(stringArrayF);
+ ASSERT_OR_THROWEXCEPTION(strArrayFS1.isValid());
+ ASSERT_OR_THROWEXCEPTION(strArrayFS1.size() == 5);
+
+ delete cas;
+ delete cas1;
+ delete cas2;
+}
+
+
/* ----------------------------------------------------------------------- */
/* Main routine */
/* ----------------------------------------------------------------------- */
@@ -526,7 +634,6 @@ int main(int argc, char * argv[]) /*
// iRetVal = _CrtSetBreakAlloc(662909);
//#endif
try {
-
ResourceManager::createInstance("testxmi");
ofstream outputStream;
ErrorInfo errorInfo;
@@ -637,12 +744,12 @@ int main(int argc, char * argv[]) /*
LOG("UIMACPP_XMITEST OOTS Complex CAS with partial typesystem Finished");
//test that some xml doc fails
- LOG("UIMACPP_XMITEST Valid XML but not Xmi Cas doc Start");
+ LOG("UIMACPP_XMITEST Valid XML but not Xmi Cas doc Start");
UnicodeString someXmlFile("ExampleCas/cas.xml");
- UnicodeString xmlfn = ResourceManager::resolveFilename(someXmlFile, someXmlFile);
+ UnicodeString xmlfn = ResourceManager::resolveFilename(someXmlFile, someXmlFile);
CAS * pCas = Framework::createCAS(*casDef,errorInfo);
- bool bExceptionThrown = false;
+ bool bExceptionThrown = false;
try {
XmiDeserializer::deserialize(xmlfn, *pCas);
} catch (Exception e) {
@@ -651,9 +758,15 @@ int main(int argc, char * argv[]) /*
bExceptionThrown =true;
}
ASSERT_OR_THROWEXCEPTION(bExceptionThrown);
- LOG("UIMACPP_XMITEST Valid XML but not Xmi Cas doc Finished");
- delete pCas;
+ LOG("UIMACPP_XMITEST Valid XML but not Xmi Cas doc Finished");
+ delete pCas;
+ //test serialization of FS reference in incoming FS
+ //when reserializing the CAS
+ doTestFSRefReserialization(primitivesCasDef);
+ LOG("UIMACPP_XMITEST Test reserialization of FS reference Finished");
+
+
delete partialts;
delete partialTSCasDef;
delete primitivests;