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 2007/02/13 17:10:43 UTC

svn commit: r507075 - /incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java

Author: kelvingoodson
Date: Tue Feb 13 08:10:42 2007
New Revision: 507075

URL: http://svn.apache.org/viewvc?view=rev&rev=507075
Log:
Disabling the new test in from TUSCANY-1085 since it is causing delays to the build

Modified:
    incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java

Modified: incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java?view=diff&rev=507075&r1=507074&r2=507075
==============================================================================
--- incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java (original)
+++ incubator/tuscany/java/sdo/impl/src/test/java/org/apache/tuscany/sdo/test/SimpleDynamicTestCase.java Tue Feb 13 08:10:42 2007
@@ -27,12 +27,15 @@
 import java.math.BigDecimal;
 import java.net.URL;
 
+import org.apache.tuscany.sdo.util.SDOUtil;
+
 import junit.framework.TestCase;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.Property;
 import commonj.sdo.Type;
 import commonj.sdo.helper.DataFactory;
+import commonj.sdo.helper.HelperContext;
 import commonj.sdo.helper.TypeHelper;
 import commonj.sdo.helper.XMLHelper;
 import commonj.sdo.helper.XSDHelper;
@@ -46,13 +49,16 @@
     private final String TEST_MODEL2 = "/simple2.xsd";
     private final String TEST_NAMESPACE2 = "http://www.example.com/simple2";
     private final String QUOTE_XML2 = "/quote2.xml";
+    
+    HelperContext hc;
+    TypeHelper th;
 
     /**
      * Simple Dynamic SDO 2 test.
      */
     public void testDynamic() throws IOException {
-        Type quoteType = TypeHelper.INSTANCE.getType(TEST_NAMESPACE, "Quote");
-        DataObject quote = DataFactory.INSTANCE.create(quoteType);
+        Type quoteType = th.getType(TEST_NAMESPACE, "Quote");
+        DataObject quote = hc.getDataFactory().create(quoteType);
 
         quote.setString("symbol", "fbnt");
         quote.setString("companyName", "FlyByNightTechnology");
@@ -67,7 +73,7 @@
         child.setBigDecimal("price", new BigDecimal("2000.0"));
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        XMLHelper.INSTANCE.save(quote, TEST_NAMESPACE, "stockQuote", baos);
+        hc.getXMLHelper().save(quote, TEST_NAMESPACE, "stockQuote", baos);
         
         assertFalse(quote.isSet("undefined"));
         assertSame(quote.get("undefined"), null);
@@ -75,9 +81,15 @@
         assertTrue(TestUtil.equalXmlFiles(new ByteArrayInputStream(baos.toByteArray()), getClass().getResource(QUOTE_XML)));
     }
 
-    public void testResolveXSDWithoutSchemaLocation() throws IOException {
-        Type quote2Type = TypeHelper.INSTANCE.getType(TEST_NAMESPACE2, "Quote2");
-        DataObject quote2 = DataFactory.INSTANCE.create(quote2Type);
+    public void dontTestResolveXSDWithoutSchemaLocation() throws IOException {
+
+        URL url = getClass().getResource(TEST_MODEL2);
+        InputStream inputStream = url.openStream();
+        hc.getXSDHelper().define(inputStream, null);
+        inputStream.close();
+    	
+    	Type quote2Type = th.getType(TEST_NAMESPACE2, "Quote2");
+        DataObject quote2 = hc.getDataFactory().create(quote2Type);
         
         quote2.setString("symbol", "fbnt");
         quote2.setString("companyName", "FlyByNightTechnology");
@@ -92,22 +104,22 @@
         child.setBigDecimal("price", new BigDecimal("2000.0"));
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        XMLHelper.INSTANCE.save(quote2, TEST_NAMESPACE2, "stockQuote", System.out);
+        hc.getXMLHelper().save(quote2, TEST_NAMESPACE2, "stockQuote", System.out);
     }
 
     protected void setUp() throws Exception {
         super.setUp();
+        
+        hc = SDOUtil.createHelperContext();
+        th = hc.getTypeHelper();
 
         // Populate the meta data for the test (Stock Quote) model
         URL url = getClass().getResource(TEST_MODEL);
         InputStream inputStream = url.openStream();
-        XSDHelper.INSTANCE.define(inputStream, url.toString());
+        hc.getXSDHelper().define(inputStream, url.toString());
         inputStream.close();
 
-        url = getClass().getResource(TEST_MODEL2);
-        inputStream = url.openStream();
-        XSDHelper.INSTANCE.define(inputStream, null);
-        inputStream.close();
+
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org