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 2007/04/13 20:16:41 UTC

svn commit: r528573 [4/4] - in /incubator/uima/uimacpp/trunk/src: cas/ cas/uima/ test/data/ExampleCas/ test/src/

Added: incubator/uima/uimacpp/trunk/src/test/data/ExampleCas/testTypeSystem_withMultiRefs.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/test/data/ExampleCas/testTypeSystem_withMultiRefs.xml?view=auto&rev=528573
==============================================================================
--- incubator/uima/uimacpp/trunk/src/test/data/ExampleCas/testTypeSystem_withMultiRefs.xml (added)
+++ incubator/uima/uimacpp/trunk/src/test/data/ExampleCas/testTypeSystem_withMultiRefs.xml Fri Apr 13 11:16:39 2007
@@ -0,0 +1,559 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+ -->
+
+<typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier">
+  <types>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.EntityAnnotation</name>
+      <description/>
+      <supertypeName>uima.tcas.Annotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>links</name>
+          <description/>
+          <rangeTypeName>uima.cas.FSList</rangeTypeName>
+          <elementType>org.apache.uima.testTypeSystem.Link</elementType>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>mentionType</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.RelationAnnotation</name>
+      <description/>
+      <supertypeName>uima.tcas.Annotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>links</name>
+          <description/>
+          <rangeTypeName>uima.cas.FSList</rangeTypeName>
+          <elementType>org.apache.uima.testTypeSystem.Link</elementType>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>predicate</name>
+          <description/>
+          <rangeTypeName>uima.tcas.Annotation</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>relationArgs</name>
+          <description/>
+          <rangeTypeName>org.apache.uima.testTypeSystem.RelationArgs</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.RelationArgs</name>
+      <description/>
+      <supertypeName>uima.cas.TOP</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.BinaryRelationArgs</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.RelationArgs</supertypeName>
+      <features>
+        <featureDescription>
+          <name>domainValue</name>
+          <description/>
+          <rangeTypeName>uima.tcas.Annotation</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>rangeValue</name>
+          <description/>
+          <rangeTypeName>uima.tcas.Annotation</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.GenericRelationArgs</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.RelationArgs</supertypeName>
+      <features>
+        <featureDescription>
+          <name>args</name>
+          <description/>
+          <rangeTypeName>uima.cas.FSList</rangeTypeName>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Referent</name>
+      <description/>
+      <supertypeName>uima.cas.TOP</supertypeName>
+      <features>
+        <featureDescription>
+          <name>links</name>
+          <description/>
+          <rangeTypeName>uima.cas.FSList</rangeTypeName>
+          <elementType>org.apache.uima.testTypeSystem.Link</elementType>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>classes</name>
+          <description/>
+          <rangeTypeName>uima.cas.StringArray</rangeTypeName>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+        <featureDescription>
+          <name>canonicalForm</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>variantForms</name>
+          <description/>
+          <rangeTypeName>uima.cas.StringList</rangeTypeName>
+          <multipleReferencesAllowed>true</multipleReferencesAllowed>
+        </featureDescription>
+        <featureDescription>
+          <name>id</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Entity</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Referent</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Relation</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Referent</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Link</name>
+      <description/>
+      <supertypeName>uima.cas.TOP</supertypeName>
+      <features>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>from</name>
+          <description/>
+          <rangeTypeName>uima.cas.TOP</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>to</name>
+          <description/>
+          <rangeTypeName>uima.cas.TOP</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.HasOccurrence</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Link</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Argument</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Link</supertypeName>
+      <features>
+        <featureDescription>
+          <name>role</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>    
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.TopEntity</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.EntityAnnotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>confidence</name>
+          <description/>
+          <rangeTypeName>uima.cas.Float</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Person</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.GeographicEntity</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Location</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GeographicEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.RegionInternational</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Location</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Facility</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Location</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.GPE</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GeographicEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Continent</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GPE</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Nation</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GPE</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.NationalAdministrativeDivision</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GPE</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.UsState</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.NationalAdministrativeDivision</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.City</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GPE</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Organization</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.EducationalOrganization</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Organization</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.College</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.EducationalOrganization</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Weapon</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Timex</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+      <features>
+        <featureDescription>
+          <name>tid</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>value</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>functionInDocument</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>temporalFunction</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>anchorTimeId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Duration</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Timex</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.HistoricalDuration</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Duration</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Time</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Timex</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Date</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Timex</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.TimeOfYear</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Date</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Year</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Date</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Clothing</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Number</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.WholeNumber</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Number</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.SmallWholeNumber</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.WholeNumber</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.LargeWholeNumber</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.WholeNumber</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Measurement</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Money</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Measurement</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.BodyPart</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.PhoneNumber</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Tool</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.MiscellaneousEntity</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>    
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.URL</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopEntity</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.TopRelation</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.RelationAnnotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>confidence</name>
+          <description/>
+          <rangeTypeName>uima.cas.Float</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>    
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Physical</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopRelation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.PartOf</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Physical</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.SubPlace</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.PartOf</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.OrganizationalRelationship</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopRelation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Staff</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.OrganizationalRelationship</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.ManagerOf</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.Staff</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Subsidiary</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.OrganizationalRelationship</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.AgentArtifact</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopRelation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Owner</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.AgentArtifact</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.GpeAffiliation</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopRelation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.BasedIn</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.GpeAffiliation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.HoldsDuring</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.TopRelation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.LexicalAnnotation</name>
+      <description/>
+      <supertypeName>uima.tcas.Annotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>confidence</name>
+          <description/>
+          <rangeTypeName>uima.cas.Float</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Thing</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.LexicalAnnotation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.CharacteristicAnnotation</name>
+      <description/>
+      <supertypeName>uima.tcas.Annotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>componentId</name>
+          <description/>
+          <rangeTypeName>uima.cas.String</rangeTypeName>
+        </featureDescription>
+        <featureDescription>
+          <name>confidence</name>
+          <description/>
+          <rangeTypeName>uima.cas.Float</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Occupation</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.CharacteristicAnnotation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.NondefiningRole</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.CharacteristicAnnotation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.EventCharacteristic</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.CharacteristicAnnotation</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Method</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.EventCharacteristic</supertypeName>
+    </typeDescription>
+    <typeDescription>
+      <name>org.apache.uima.testTypeSystem.Symptom</name>
+      <description/>
+      <supertypeName>org.apache.uima.testTypeSystem.CharacteristicAnnotation</supertypeName>
+    </typeDescription>    
+    <typeDescription>
+      <name>sofa.test.CrossAnnotation</name>
+      <description></description>
+      <supertypeName>uima.tcas.Annotation</supertypeName>
+      <features>
+        <featureDescription>
+          <name>otherAnnotation</name>
+          <description></description>
+          <rangeTypeName>uima.tcas.Annotation</rangeTypeName>
+        </featureDescription>
+      </features>
+    </typeDescription>
+  </types>
+</typeSystemDescription>

Added: incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp?view=auto&rev=528573
==============================================================================
--- incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp (added)
+++ incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.cpp Fri Apr 13 11:16:39 2007
@@ -0,0 +1,604 @@
+/** \file test_xcasdeserialization.cpp .
+
+ * 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.
+
+-------------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------- */
+/*       Include dependencies                                              */
+/* ----------------------------------------------------------------------- */
+#include "uima/api.hpp"
+#include "uima/xmiwriter.hpp"
+#include "uima/xmideserializer.hpp"
+#include "uima/xcasdeserializer.hpp"
+#include "uima/casdefinition.hpp"
+#include "xercesc/framework/LocalFileInputSource.hpp"
+
+#include <fstream>
+
+#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;
+icu::UnicodeString str1("string1");
+icu::UnicodeString str2("string2");
+icu::UnicodeString str3("string3");
+icu::UnicodeString str4("string4");
+icu::UnicodeString str5("string5");
+
+UnicodeStringRef strings[] = {
+                               str1, str3, str2, str5, str4
+                             };
+
+int ints[] = {
+               1,2,3,4,5
+             };
+float floats[] = {
+                   (float)1.1, (float)2.2, (float)3.3, (float)4.4, (float)5.5
+                 };
+char chars[] = {
+                 'a','b','c','c','d'
+               };
+int shorts[] = {
+                 10,20,30,40,50
+               };
+int longs[] = {
+                10000,20000,30000,40000,50000
+              };
+double doubles[] = {
+                     21E10,
+                     31E10,
+                     41E10,
+                     51E10,
+                     61E10
+
+                   };
+
+bool val = false;
+UnicodeString ustr("this beer is good");
+int begin = 1;
+int end = 5;
+char * viewName = "EnglishDocument";
+#define BOOLEAN_ARRAY_SIZE 20
+void validateFS(CAS & cas)  {
+
+
+  Type testType = cas.getTypeSystem().getType("test.primitives.Example");
+  Feature intF = testType.getFeatureByBaseName("intFeature");
+  Feature floatF = testType.getFeatureByBaseName("floatFeature");
+  Feature stringF = testType.getFeatureByBaseName("stringFeature");
+  Feature booleanF = testType.getFeatureByBaseName("boolFeature");
+  Feature byteF = testType.getFeatureByBaseName("byteFeature");
+  Feature shortF = testType.getFeatureByBaseName("shortFeature");
+  Feature longF = testType.getFeatureByBaseName("longFeature");
+  Feature doubleF = testType.getFeatureByBaseName("doubleFeature");
+
+  Feature intArrayF = testType.getFeatureByBaseName("intArrayFeature");
+  Feature floatArrayF = testType.getFeatureByBaseName("floatArrayFeature");
+  Feature stringArrayF = testType.getFeatureByBaseName("stringArrayFeature");
+  Feature booleanArrayF = testType.getFeatureByBaseName("boolArrayFeature");
+  Feature byteArrayF = testType.getFeatureByBaseName("byteArrayFeature");
+  Feature shortArrayF = testType.getFeatureByBaseName("shortArrayFeature");
+  Feature longArrayF = testType.getFeatureByBaseName("longArrayFeature");
+  Feature doubleArrayF = testType.getFeatureByBaseName("doubleArrayFeature");
+  Feature intListF = testType.getFeatureByBaseName("intListFeature");
+  Feature floatListF = testType.getFeatureByBaseName("floatListFeature");
+  Feature stringListF = testType.getFeatureByBaseName("stringListFeature");
+  Feature fsListF = testType.getFeatureByBaseName("fsListFeature");
+  Feature fsArrayF = testType.getFeatureByBaseName("fsArrayFeature");
+
+  //get index repository
+  FSIndexRepository & indexRep = cas.getIndexRepository();
+
+  //   get a view
+  CAS * englishView = cas.getView(viewName);
+  ASSERT_OR_THROWEXCEPTION(EXISTS(englishView));
+  ASSERT_OR_THROWEXCEPTION(0==englishView->getDocumentText().compare(ustr));
+
+  ANIndex index = englishView->getAnnotationIndex(testType);
+  ANIterator iter = index.iterator();
+  AnnotationFS fs = iter.get();
+  ASSERT_OR_THROWEXCEPTION(fs.isValid());
+
+  size_t num;
+  
+  StringListFS strListFS = fs.getStringListFSValue(stringListF);
+  for (num=0; num< NUMBEROF(floats); num++) {
+    ASSERT_OR_THROWEXCEPTION(strListFS.getHead()==strings[num]);
+	strListFS = strListFS.getTail();
+  }
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(strings)==num);
+  
+  StringArrayFS stringArrayFS = fs.getStringArrayFSValue(stringArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(strings)==stringArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(strings); ++i) {
+    ASSERT_OR_THROWEXCEPTION(0==stringArrayFS.get(i).compare(strings[i]));
+  }
+  
+  IntListFS intListFS = fs.getIntListFSValue(intListF);
+  for (num=0; num< NUMBEROF(ints); num++) {
+    ASSERT_OR_THROWEXCEPTION(intListFS.getHead()==ints[num]);
+	intListFS = intListFS.getTail();
+  }
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(ints)==num);
+  
+  IntArrayFS intArrayFS = fs.getIntArrayFSValue(intArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(ints)==intArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(ints); ++i) {
+    ASSERT_OR_THROWEXCEPTION(intArrayFS.get(i)==ints[i]);
+  }
+
+  FloatListFS floatListFS = fs.getFloatListFSValue(floatListF);
+  for (num=0; num< NUMBEROF(floats); num++) {
+    ASSERT_OR_THROWEXCEPTION(floatListFS.getHead()==floats[num]);
+	floatListFS = floatListFS.getTail();
+  }
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(floats)==num);
+
+  FloatArrayFS floatArrayFS = fs.getFloatArrayFSValue(floatArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(floats)==floatArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(floats); ++i) {
+    ASSERT_OR_THROWEXCEPTION(floatArrayFS.get(i)==floats[i]);
+  }
+
+  ByteArrayFS byteArrayFS = fs.getByteArrayFSValue(byteArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(chars)==byteArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(chars); ++i) {
+    ASSERT_OR_THROWEXCEPTION(byteArrayFS.get(i)==chars[i]);
+  }
+
+  BooleanArrayFS boolArrayFS = fs.getBooleanArrayFSValue(booleanArrayF);
+  ASSERT_OR_THROWEXCEPTION(BOOLEAN_ARRAY_SIZE==boolArrayFS.size());
+  for (size_t i=0; i< BOOLEAN_ARRAY_SIZE; ++i) {
+    val = !val;
+    ASSERT_OR_THROWEXCEPTION(boolArrayFS.get(i)==val);
+  }
+
+  ShortArrayFS shortArrayFS = fs.getShortArrayFSValue(shortArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(shorts)==shortArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(shorts); ++i) {
+    ASSERT_OR_THROWEXCEPTION(shortArrayFS.get(i)==shorts[i]);
+  }
+
+  LongArrayFS longArrayFS = fs.getLongArrayFSValue(longArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(longs)==longArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(longs); ++i) {
+    ASSERT_OR_THROWEXCEPTION(longArrayFS.get(i)==longs[i]);
+  }
+
+  DoubleArrayFS doubleArrayFS = fs.getDoubleArrayFSValue(doubleArrayF);
+  ASSERT_OR_THROWEXCEPTION(NUMBEROF(doubles)==doubleArrayFS.size());
+  for (size_t i=0; i< NUMBEROF(doubles); ++i) {
+    ASSERT_OR_THROWEXCEPTION(doubleArrayFS.get(i) == doubles[i]);
+  }
+
+  FeatureStructure listFS = fs.getFSValue(fsListF);
+  num=0;
+  ListFS curNode(listFS);
+  while (!curNode.isEmpty()) {
+    num++;
+	FeatureStructure fs = curNode.getHead();
+	ASSERT_OR_THROWEXCEPTION(fs.getType().getName().compare(CAS::TYPE_NAME_ANNOTATION)==0);
+    curNode = curNode.getTail();
+  }
+  ASSERT_OR_THROWEXCEPTION(num==2);
+  
+  ArrayFS arrayFS = (ArrayFS) fs.getFSValue(fsArrayF);
+  ASSERT_OR_THROWEXCEPTION(3==arrayFS.size());
+  for (int t=0;t<3;t++) {
+    FeatureStructure fs = arrayFS.get(t);
+	ASSERT_OR_THROWEXCEPTION(fs.getType().getName().compare(CAS::TYPE_NAME_ANNOTATION)==0);
+  }
+
+  // check scalar values
+  ASSERT_OR_THROWEXCEPTION(0==fs.getStringValue(stringF).compare(strings[0]));
+  ASSERT_OR_THROWEXCEPTION(fs.getBeginPosition()==begin);
+  ASSERT_OR_THROWEXCEPTION(fs.getEndPosition()==end);
+  ASSERT_OR_THROWEXCEPTION(fs.getFloatValue(floatF)==floats[0]);
+  ASSERT_OR_THROWEXCEPTION(fs.getBooleanValue(booleanF)==val);
+  ASSERT_OR_THROWEXCEPTION(fs.getByteValue(byteF)=='z');
+  ASSERT_OR_THROWEXCEPTION(fs.getShortValue(shortF)==shorts[0]);
+  ASSERT_OR_THROWEXCEPTION(fs.getLongValue(longF)==longs[0]);
+  ASSERT_OR_THROWEXCEPTION(fs.getDoubleValue(doubleF)==doubles[0]);
+}
+
+void testMultipleSofas(internal::CASDefinition * casDef)  {
+  try {
+    ErrorInfo errorInfo;
+    CAS * cas = uima::Framework::createCAS(*casDef, errorInfo);
+    ASSERT_OR_THROWEXCEPTION(EXISTS(cas));
+
+    // set document text for the initial view
+    cas->setDocumentText(UnicodeString("This is a test"));
+    // create a new view and set its document text
+    CAS * cas2 = cas->createView("OtherSofa");
+    cas2->setDocumentText(UnicodeString("This is only a test"));
+
+    // create an annotation and add to index of both views
+    Type annotType = cas->getTypeSystem().getType(CAS::TYPE_NAME_ANNOTATION);
+    AnnotationFS anAnnot = cas->createAnnotation(annotType, 0, 5);
+    cas->getIndexRepository().addFS(anAnnot);
+    cas2->getIndexRepository().addFS(anAnnot);
+    FSIndex tIndex = cas->getAnnotationIndex();
+    FSIndex t2Index = cas2->getAnnotationIndex();
+    ASSERT_OR_THROWEXCEPTION(tIndex.getSize() == 2); // document annot and new Annotation
+    ASSERT_OR_THROWEXCEPTION(t2Index.getSize()== 2); 
+
+    //serialize
+    ofstream outputStream;
+    outputStream.open("temp.xmi");
+    ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+
+    XmiWriter writer(*cas,false);
+    writer.write(outputStream);
+    outputStream.close();
+
+    ostringstream str;
+    writer.write(str);
+    str.flush();
+
+    // deserialize into another CAS (repeat twice to check it still works after reset)
+    CAS * newCas = uima::Framework::createCAS(*casDef, errorInfo);
+    ASSERT_OR_THROWEXCEPTION(EXISTS(cas));
+
+    for (int i = 0; i < 2; i++) {
+      uima::XmiDeserializer::deserialize("temp.xmi",*newCas);
+      // check sofas
+      ASSERT_OR_THROWEXCEPTION(newCas->getDocumentText().compare(UnicodeString("This is a test"))==0);
+      CAS * newCas2 = newCas->getView("OtherSofa");
+      ASSERT_OR_THROWEXCEPTION(newCas2->getDocumentText().compare(UnicodeString("This is only a test"))==0);
+      ASSERT_OR_THROWEXCEPTION(newCas->getAnnotationIndex().getSize() == 2); // document annot and new Annotation
+      ASSERT_OR_THROWEXCEPTION(newCas2->getAnnotationIndex().getSize()== 2); 
+      newCas->reset();
+    }
+    delete cas;
+    delete newCas;
+  } catch (Exception e) {
+    ASSERT_OR_THROWEXCEPTION(e.getErrorInfo().getErrorId()==0);
+  }
+}
+
+void doTestNoInitialSofa(internal::CASDefinition * casDef) {
+  ErrorInfo errorInfo;
+  CAS * cas1 = Framework::createCAS(*casDef,errorInfo);
+  CAS * cas2 = Framework::createCAS(*casDef,errorInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas1) );
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas2) );
+  // create non-annotation type so as not to create the _InitialView Sofa
+  IntArrayFS intArrayFS = cas1->createIntArrayFS(5);
+  intArrayFS.set(0,1);
+  intArrayFS.set(1,2);
+  intArrayFS.set(2,3);
+  intArrayFS.set(3,4);
+  intArrayFS.set(4,5);
+  cas1->getIndexRepository().addFS(intArrayFS);
+
+  // Serialize Xmi
+  ofstream outputStream;
+  outputStream.open("temp.xmi");
+  ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+
+  XmiWriter writer(*cas1, false);
+  writer.write(outputStream);
+  outputStream.close();
+
+  // Deserialize xmi
+  cas2->reset();
+  XmiDeserializer::deserialize("temp.xmi", *cas2);
+
+  //reserialize cas1
+  stringstream str1;
+  writer.write(str1);
+
+  //reserialize cas2
+  stringstream str2;
+  XmiWriter writer2(*cas2,false);
+  writer2.write(str2);
+
+  //compare serialized xmi string
+  ASSERT_OR_THROWEXCEPTION(str1.str().compare(str2.str())==0);
+
+  delete cas1;
+  delete cas2;
+}
+
+void doTestDeserializeAndReserialize(internal::CASDefinition * casDef) {
+
+  ErrorInfo errInfo;
+  //LOG("deserialize xcas into cas1");
+  CAS * cas1 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas1) );
+  UnicodeString xcasFile("ExampleCas/cas.xml");
+  UnicodeString xcasfn = ResourceManager::resolveFilename(xcasFile, xcasFile);
+  XCASDeserializer::deserialize(xcasfn, *cas1);
+
+  // Serialize Xmi
+  ofstream outputStream;
+  outputStream.open("temp.xmi");
+  ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+
+  // reserialize as XMI
+  //LOG("serialize as xmi");
+  XmiWriter xmiw1(*cas1, false);
+  xmiw1.write(outputStream);
+  outputStream.close();
+
+  // deserialize XMI into another CAS
+  CAS * cas2 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas2) );
+  XmiDeserializer::deserialize("temp.xmi",*cas2);
+
+  // compare
+  //LOG("comparing cas1 and cas2 getDocumentText() ");
+  ASSERT_OR_THROWEXCEPTION(cas1->getAnnotationIndex().getSize() == cas2->getAnnotationIndex().getSize());
+  ASSERT_OR_THROWEXCEPTION(cas1->getDocumentText().length() == cas2->getDocumentText().length());
+  ASSERT_OR_THROWEXCEPTION(cas1->getDocumentText().compare(cas2->getDocumentText()) == 0 );
+
+  // check that array refs are not null
+  //LOG("comparing cas1 and cas2 array refs");
+  Type entityType = cas2->getTypeSystem().getType("org.apache.uima.testTypeSystem.Entity");
+  Feature classesFeat = entityType.getFeatureByBaseName("classes");
+  FSIterator iter = cas2->getIndexRepository().getIndex("testEntityIndex").iterator();
+  ASSERT_OR_THROWEXCEPTION(iter.isValid());
+  while (iter.isValid()) {
+    FeatureStructure fs = (FeatureStructure) iter.get();
+    ASSERT_OR_THROWEXCEPTION(fs.isValid());
+    StringArrayFS arrayFS = (StringArrayFS) fs.getFeatureValue(classesFeat);
+    ASSERT_OR_THROWEXCEPTION(arrayFS.isValid());
+    for (int i = 0; i < arrayFS.size(); i++) {
+      ASSERT_OR_THROWEXCEPTION(arrayFS.get(i).length() != 0);
+    }
+    iter.moveToNext();
+  }
+
+  delete cas1;
+  delete cas2;
+}
+
+void testOotsNewPrimitives(internal::CASDefinition * partialCasDef,
+				                 internal::CASDefinition * casDef,
+				                const char * inputXCas) {
+	ErrorInfo errInfo;
+	XmiSerializationSharedData sharedData;
+
+  //LOG("deserialize xcas into cas1 and serialize as XMI");
+  CAS * cas1 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas1) );
+  UnicodeString xFile(inputXCas);
+  UnicodeString xfn = ResourceManager::resolveFilename(xFile, xFile);
+  XCASDeserializer::deserialize(xfn, *cas1);
+
+	ofstream outputStream;
+	outputStream.open("oots.xmi");
+	ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+	XmiWriter writer(*cas1, false);
+	writer.write(outputStream);
+	outputStream.close();
+
+  //LOG("deserialize XMI into partial cas2 and serialize ");
+  CAS * cas2 = uima::Framework::createCAS(*partialCasDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas2) );
+  XmiDeserializer::deserialize("oots.xmi", *cas2, sharedData);
+  XmiWriter writer2(*cas2, false, &sharedData);
+  outputStream.open("oots2.xmi");
+  writer2.write(outputStream);
+  outputStream.close();
+
+  //LOG("deserialize XMI into complete typesystem cas3 ");
+  CAS * cas3 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas3) );
+  XmiDeserializer::deserialize("oots2.xmi", *cas3);
+
+  //LOG("compare" );
+  validateFS(*cas3);
+
+  delete cas1;
+  delete cas2;
+  delete cas3;
+}  
+
+
+void testOotsComplexCas(internal::CASDefinition * partialCasDef,
+				                  internal::CASDefinition * casDef,
+				                  const char * inputXCas) {
+	ErrorInfo errInfo;
+	XmiSerializationSharedData sharedData;
+
+  //LOG("deserialize xcas into cas1 and serialize as XMI");
+  CAS * cas1 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas1) );
+  UnicodeString xFile(inputXCas);
+  UnicodeString xfn = ResourceManager::resolveFilename(xFile, xFile);
+  XCASDeserializer::deserialize(xfn, *cas1);
+
+	ofstream outputStream;
+	outputStream.open("oots.xmi");
+	ASSERT_OR_THROWEXCEPTION(outputStream.is_open());
+	XmiWriter writer(*cas1, false);
+	writer.write(outputStream);
+	outputStream.close();
+
+  //LOG("deserialize XMI into partial cas2 and serialize ");
+  CAS * cas2 = uima::Framework::createCAS(*partialCasDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas2) );
+  XmiDeserializer::deserialize("oots.xmi", *cas2, sharedData);
+  XmiWriter writer2(*cas2, false, &sharedData);
+  outputStream.open("oots2.xmi");
+  writer2.write(outputStream);
+  outputStream.close();
+ 
+  //LOG("deserialize XMI into complete typesystem cas3 ");
+  CAS * cas3 = uima::Framework::createCAS(*casDef, errInfo);
+  ASSERT_OR_THROWEXCEPTION( EXISTS(cas3) );
+  XmiDeserializer::deserialize("oots2.xmi", *cas3);
+
+  //LOG("compare" );
+  ASSERT_OR_THROWEXCEPTION(cas1->getAnnotationIndex().getSize() == cas3->getAnnotationIndex().getSize());
+  ASSERT_OR_THROWEXCEPTION(cas1->getDocumentText().length() == cas3->getDocumentText().length());
+  ASSERT_OR_THROWEXCEPTION(cas1->getDocumentText().compare(cas3->getDocumentText()) == 0 );
+  //TODO more compare
+
+  delete cas1;
+  delete cas2;
+  delete cas3;
+}  
+/* ----------------------------------------------------------------------- */
+/*       Main routine                                                      */
+/* ----------------------------------------------------------------------- */
+
+int main(int argc, char * argv[]) /*
+---------------------------------- */
+{
+  LOG("UIMATEST_XMISERIALIZATION started");
+  int iRetVal = 0;
+
+  try {
+
+    ResourceManager::createInstance("testxmi");
+    ofstream outputStream;
+    ErrorInfo errorInfo;
+
+	
+    TextAnalysisEngineSpecifierBuilder builder;
+	
+	  //setup
+	  UnicodeString tsFile("ExampleCas/testTypeSystem.xml");
+    UnicodeString tsfn = ResourceManager::resolveFilename(tsFile, tsFile);
+    TypeSystem * ts = Framework::createTypeSystem( ((UnicodeStringRef)tsfn).asUTF8().c_str(),errorInfo);
+    ASSERT_OR_THROWEXCEPTION( EXISTS(ts) );
+
+	  UnicodeString tsFile2("ExampleCas/testTypeSystem_withMultiRefs.xml");
+    UnicodeString tsfn2 = ResourceManager::resolveFilename(tsFile2, tsFile2);
+    TypeSystem * ts2 = Framework::createTypeSystem( ((UnicodeStringRef)tsfn2).asUTF8().c_str(),errorInfo);
+    ASSERT_OR_THROWEXCEPTION( EXISTS(ts2) );
+
+    UnicodeString indexFile("ExampleCas/testIndexes.xml");
+    UnicodeString indexfn = ResourceManager::resolveFilename(indexFile, indexFile);
+	  size_t uiLen = indexfn.length();
+    auto_array<UChar> arBuffer( new UChar[uiLen + 1] );
+    assert( EXISTS(arBuffer.get()));
+    indexfn.extract(0, uiLen, arBuffer.get());
+    (arBuffer.get())[uiLen] = 0; // terminate the buffer with 0
+	  LocalFileInputSource fileIS((XMLCh const *) arBuffer.get());
+	  AnalysisEngineMetaData::TyVecpFSIndexDescriptions fsDesc;
+	  builder.parseFSIndexDescription(fsDesc,fileIS);
+    ASSERT_OR_THROWEXCEPTION( EXISTS(fsDesc.size() > 0) );
+
+	  internal::CASDefinition * casDef = internal::CASDefinition::createCASDefinition(*ts,fsDesc);
+    //test complete ts 
+	  LOG("UIMACPP_XMITEST Complex CAS with complete typesystem Start");
+		doTestDeserializeAndReserialize(casDef);
+	  delete casDef;
+	  LOG("UIMACPP_XMITEST Complex CAS with complete typesystem Finished");
+
+    //test complete ts with multiple refs
+	  LOG("UIMACPP_XMITEST Complex CAS with MultiRefs Start");
+	  casDef = internal::CASDefinition::createCASDefinition(*ts2,fsDesc);
+    doTestDeserializeAndReserialize(casDef);
+	  delete casDef;
+	  LOG("UIMACPP_XMITEST Complex CAS with MultiRefs Finished");
+
+	  casDef = internal::CASDefinition::createCASDefinition(*ts,fsDesc);
+    //testNoInitialSofa
+	  LOG("UIMACPP_XMITEST doTestNoInitialSofa Start"); 
+	  doTestNoInitialSofa(casDef);
+	  LOG("UIMACPP_XMITEST doTestNoInitialSofa Finished"); 
+
+	  //testMultipleSofas
+	  LOG("UIMACPP_XMITEST testMultipleSofas Start");
+	  testMultipleSofas(casDef);
+	  LOG("UIMACPP_XMITEST testMultipleSofas Finished");
+
+	  //test OOTS Missing Type 1
+	  TypeSystemDescription * baseTSDesc = new TypeSystemDescription();
+	  TypeSystem * baseTS = Framework::createTypeSystem(*baseTSDesc,"base",errorInfo);
+	  internal::CASDefinition * baseCasDef = internal::CASDefinition::createCASDefinition(*baseTS);
+
+    UnicodeString newpFile("ExampleCas/newprimitivesTypeSystem.xml");
+    UnicodeString newpfn = ResourceManager::resolveFilename(newpFile, newpFile);
+	  TypeSystem *primitivests = Framework::createTypeSystem( ((UnicodeStringRef)newpfn).asUTF8().c_str(),
+										errorInfo );
+	  internal::CASDefinition * primitivesCasDef = 
+	  internal::CASDefinition::createCASDefinition(*primitivests);
+
+    LOG("UIMACPP_XMITEST OOTS new primitives missing type Start");
+	  UnicodeString newpxcasFile("ExampleCas/newprimitives.xcas");
+    UnicodeString newpxcasfn = ResourceManager::resolveFilename(newpxcasFile, newpxcasFile);
+    testOotsNewPrimitives(baseCasDef, primitivesCasDef, ((UnicodeStringRef)newpxcasfn).asUTF8().c_str());
+     LOG("UIMACPP_XMITEST OOTS new primitives missing type Finished");
+
+    //test OOTS missing feature
+	  LOG("UIMACPP_XMITEST OOTS new primitives missing feature Start");
+	  UnicodeString newpPartialFile("ExampleCas/newprimitivesPartialTypeSystem.xml");
+    UnicodeString newpPartialfn = ResourceManager::resolveFilename(newpPartialFile, newpFile);
+	  TypeSystem * newpPartialts = Framework::createTypeSystem( ((UnicodeStringRef)newpPartialfn).asUTF8().c_str(),
+										errorInfo );
+	  internal::CASDefinition * newpPartialCasDef = 
+                    internal::CASDefinition::createCASDefinition(*newpPartialts);
+    testOotsNewPrimitives(newpPartialCasDef, primitivesCasDef, "ExampleCas/newprimitives.xcas");
+	  delete newpPartialts;
+	  delete newpPartialCasDef;
+	  LOG("UIMACPP_XMITEST OOTS new primitives missing features Finished");
+	
+	  //test OOTS complex cas missing types
+	  LOG("UIMACPP_XMITEST OOTS Complex CAS Missing Types Start");
+	  testOotsComplexCas(baseCasDef, casDef, "ExampleCas/cas.xml");
+	  LOG("UIMACPP_XMITEST OOTS Complex CAS Missing Types Finished");
+
+    UnicodeString partialTSFile("ExampleCas/partialTestTypeSystem.xml");
+    UnicodeString partialTSfn = ResourceManager::resolveFilename(partialTSFile, partialTSFile);
+	  TypeSystem * partialts = Framework::createTypeSystem( ((UnicodeStringRef)partialTSfn).asUTF8().c_str(),
+										errorInfo );
+	  internal::CASDefinition * partialTSCasDef = 
+	                internal::CASDefinition::createCASDefinition(*partialts);
+
+    //test OOTS complex cas missing types and features
+    LOG("UIMACPP_XMITEST OOTS Complex CAS with partial typesystem Start");
+	  testOotsComplexCas(partialTSCasDef, casDef, "ExampleCas/cas.xml");
+	  LOG("UIMACPP_XMITEST OOTS Complex CAS with partial typesystem Finished");
+
+		
+    delete partialts;
+    delete partialTSCasDef;
+	  delete primitivests;
+	  delete primitivesCasDef;
+	  delete casDef;
+    delete baseTSDesc;
+	  delete baseTS;
+	  delete baseCasDef;
+		
+
+    LOG("UIMATEST_XMISERIALIZATION finished");
+
+  } catch (Exception & exc) {
+    cerr << exc.asString() << endl;
+    iRetVal = 1;
+  } catch (...) {
+    cerr << "Unexpected exception " << endl;
+    iRetVal = 1;
+  }
+
+  return iRetVal;
+}
+
+/* <EOF> */

Added: incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.vcproj
URL: http://svn.apache.org/viewvc/incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.vcproj?view=auto&rev=528573
==============================================================================
--- incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.vcproj (added)
+++ incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.vcproj Fri Apr 13 11:16:39 2007
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="7.10"
+	Name="test_xmideserialization"
+	ProjectGUID="{2A4A561A-F304-4280-9238-DD2C1C82F8AE}"
+	Keyword="Win32Proj">
+	<Platforms>
+		<Platform
+			Name="Win32"/>
+	</Platforms>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(InputDir)\.."
+			IntermediateDirectory="..\Debug\$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;&quot;$(APR_HOME)\include&quot;;&quot;$(ICU_HOME)\include&quot;;&quot;$(XERCES_HOME)\include&quot;;&quot;$(UIMACPP_HOME)\include&quot;;&quot;$(UIMACPP_HOME)\include\apr&quot;;..\..\cas;..\..\framework"
+				PreprocessorDefinitions="UIMA_SUPPRESS_TIMING;WIN32;_CONSOLE"
+				MinimalRebuild="TRUE"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="xerces-c_2.lib icuuc.lib uimaD.lib"
+				OutputFile="$(OutDir)/test_xmideserialization.exe"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;$(APR_HOME)\Debug&quot;;&quot;$(XERCES_HOME)\lib&quot;;&quot;$(ICU_HOME)\lib&quot;;&quot;$(UIMACPP_HOME)\lib&quot;;..\..\..\install\lib"
+				GenerateDebugInformation="TRUE"
+				ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
+				SubSystem="1"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(InputDir)\.."
+			IntermediateDirectory="..\Release\$(ProjectName)"
+			ConfigurationType="1"
+			CharacterSet="2">
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="3"
+				AdditionalIncludeDirectories=".;&quot;$(APR_HOME)\include&quot;;&quot;$(ICU_HOME)\include&quot;;&quot;$(XERCES_HOME)\include&quot;;&quot;$(UIMACPP_HOME)\include&quot;;&quot;$(UIMACPP_HOME)\include\apr&quot;;..\..\cas;..\..\framework"
+				PreprocessorDefinitions="UIMA_SUPPRESS_TIMING;TRACEOFF;NDEBUG;WIN32;_CONSOLE"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="TRUE"
+				DebugInformationFormat="3"/>
+			<Tool
+				Name="VCCustomBuildTool"/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="xerces-c_2.lib icuuc.lib uima.lib"
+				OutputFile="$(OutDir)/test_xmideserialization.exe"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories="&quot;$(APR_HOME)\Release&quot;;&quot;$(XERCES_HOME)\lib&quot;;&quot;$(ICU_HOME)\lib&quot;;&quot;$(UIMACPP_HOME)\lib&quot;;..\..\..\install\lib"
+				GenerateDebugInformation="FALSE"
+				ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"/>
+			<Tool
+				Name="VCMIDLTool"/>
+			<Tool
+				Name="VCPostBuildEventTool"/>
+			<Tool
+				Name="VCPreBuildEventTool"/>
+			<Tool
+				Name="VCPreLinkEventTool"/>
+			<Tool
+				Name="VCResourceCompilerTool"/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
+				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+			<File
+				RelativePath="test_xmideserialization.cpp">
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

Propchange: incubator/uima/uimacpp/trunk/src/test/src/test_xmideserialization.vcproj
------------------------------------------------------------------------------
    svn:eol-style = CRLF