Author: robbinspg
Date: Tue Aug 21 14:59:26 2007
New Revision: 568299
URL: http://svn.apache.org/viewvc?rev=568299&view=rev
Log:
TUSCANY-1564 Add testcase
Added:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
(with props)
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
(with props)
Modified:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/main.cpp
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest.h
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest2.cpp
Modified: incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/main.cpp
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/main.cpp?rev=568299&r1=568298&r2=568299&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/main.cpp
(original)
+++ incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/main.cpp Tue
Aug 21 14:59:26 2007
@@ -190,6 +190,7 @@
TEST ( sdotest::jira1112() );
TEST ( sdotest::elementFormDefaultQualified() );
TEST ( sdotest::elementFormDefaultQualifiedSequence() );
+ TEST ( sdotest::xsiTypeAbstract() );
} catch(...)
Modified: incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest.h
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest.h?rev=568299&r1=568298&r2=568299&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest.h
(original)
+++ incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest.h Tue
Aug 21 14:59:26 2007
@@ -214,4 +214,5 @@
static int jira1112();
static int elementFormDefaultQualified();
static int elementFormDefaultQualifiedSequence();
+ static int xsiTypeAbstract();
};
Modified:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest2.cpp
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest2.cpp?rev=568299&r1=568298&r2=568299&view=diff
==============================================================================
--- incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest2.cpp
(original)
+++ incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/sdotest2.cpp
Tue Aug 21 14:59:26 2007
@@ -1996,4 +1996,37 @@
cout << "Exception in elementFormDefaultQualifiedSequence: " << e <<
endl;
return 0;
}
+}
+
+int sdotest::xsiTypeAbstract()
+{
+
+ try {
+ XSDHelperPtr xsh = HelperProvider::getXSDHelper();
+ XMLHelperPtr xmh = HelperProvider::getXMLHelper(xsh->getDataFactory());
+ xsh->defineFile("xsiTypeAbstract.xsd");
+ unsigned int i,j;
+ if ((i = xsh->getErrorCount()) > 0)
+ {
+ cout << "xsiTypeAbstract.xsd reported some errors: " <<endl;
+ for (j=0;j<i;j++)
+ {
+ cout << xsh->getErrorMessage(j) <<endl;
+ }
+ }
+
+
+ DataObjectPtr x = xsh->getDataFactory()->create("","X");
+ DataObjectPtr concrete =
xsh->getDataFactory()->create("","concreteType");
+ x->setDataObject("abstract", concrete);
+
+ XMLDocumentPtr doc = xmh->createDocument(x, "", "X");
+ xmh->save(doc, "xsiTypeAbstract_out.xml", 2);
+ return comparefiles("xsiTypeAbstract_out.xml"
,"xsiTypeAbstract_expected.xml");
+ }
+ catch (SDORuntimeException e)
+ {
+ cout << "Exception in xsiTypeAbstract: " << e << endl;
+ return 0;
+ }
}
Added:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd?rev=568299&view=auto
==============================================================================
---
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
(added)
+++
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
Tue Aug 21 14:59:26 2007
@@ -0,0 +1,44 @@
+<?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.
+-->
+
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <xsd:element name="abstract" type="abstractType"/>
+
+ <xsd:complexType name="abstractType" abstract="true"/>
+
+ <xsd:complexType name="concreteType">
+ <xsd:complexContent>
+ <xsd:extension base="abstractType">
+ <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="prop1" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:element name="X">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element ref="abstract"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+</xsd:schema>
\ No newline at end of file
Propchange:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract.xsd
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
URL:
http://svn.apache.org/viewvc/incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml?rev=568299&view=auto
==============================================================================
---
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
(added)
+++
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
Tue Aug 21 14:59:26 2007
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<X xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <abstract xsi:type="concreteType"/>
+</X>
Propchange:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/tuscany/branches/sdo-cpp-pre2.1/runtime/core/test/xsiTypeAbstract_expected.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]