You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2006/12/01 18:07:15 UTC
svn commit: r481301 - in /incubator/tuscany/java/sdo/impl/src/test:
java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java resources/open.xsd
Author: kelvingoodson
Date: Fri Dec 1 09:07:14 2006
New Revision: 481301
URL: http://svn.apache.org/viewvc?view=rev&rev=481301
Log:
TUSCANY-396 -- ignore the above comments of today, it was an error in my test case. EMF is fixed as i had thought
Modified:
incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java
incubator/tuscany/java/sdo/impl/src/test/resources/open.xsd
Modified: incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java?view=diff&rev=481301&r1=481300&r2=481301
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java (original)
+++ incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/OpenTypeTestCase.java Fri Dec 1 09:07:14 2006
@@ -81,33 +81,17 @@
assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
}
- // TODO introduce this test once the EMF issue behind TUSCANY-396 has been fixed
- public void dont_testOpenType_Tuscany_396() throws IOException {
- Type quoteType = th.getType(TEST_NAMESPACE, "OpenQuote");
- DataObject quote = df.create(quoteType);
-
- quote.setString("symbol", "s1");
-
- for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) {
- Property property = (Property) iter.next();
- }
- Property companyProperty = xsdh.getGlobalProperty(TEST_NAMESPACE, "company", true);
- DataObject company = quote.createDataObject(companyProperty);
- company.setString("name", "FlyByNightTechnology");
+ public void testOpenType_Tuscany_396() throws IOException {
+ Type quoteType = th.getType(TEST_NAMESPACE, "OpenQuote2");
+ DataObject quote = df.create(quoteType);
Property priceProperty = xsdh.getGlobalProperty(TEST_NAMESPACE, "price", true);
+ // the importance of this is that the maxOccurs=1 attribute on the xsd:any
+ // allows is to use the !isMany getters and setters for open content
quote.set(priceProperty, new BigDecimal("1000.0"));
-
- for (Iterator iter = quote.getInstanceProperties().iterator(); iter.hasNext();) {
- Property property = (Property) iter.next();
- }
-
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- xmlh.save(quote, TEST_NAMESPACE, "openStockQuote", baos);
- assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(TEST_DATA)));
- }
+ }
protected void setUp() throws Exception {
super.setUp();
Modified: incubator/tuscany/java/sdo/impl/src/test/resources/open.xsd
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/test/resources/open.xsd?view=diff&rev=481301&r1=481300&r2=481301
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/test/resources/open.xsd (original)
+++ incubator/tuscany/java/sdo/impl/src/test/resources/open.xsd Fri Dec 1 09:07:14 2006
@@ -40,5 +40,12 @@
<xsd:any maxOccurs="unbounded" namespace="##any"/>
</xsd:sequence>
</xsd:complexType>
+
+ <xsd:complexType name="OpenQuote2">
+ <xsd:sequence>
+ <xsd:element name="symbol" type="xsd:string"/>
+ <xsd:any maxOccurs="1" namespace="##any"/>
+ </xsd:sequence>
+ </xsd:complexType>
</xsd:schema>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org