tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rineh...@apache.org
Subject svn commit: r509718 - in /incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest: ./ src/main/java/org/apache/tuscany/sca/test/exceptions/impl/ src/main/resources/wsdl/ src/test/java/org/apache/tuscany/sca/test/exceptions/
Date Tue, 20 Feb 2007 19:33:53 GMT
Author: rineholt
Date: Tue Feb 20 11:33:52 2007
New Revision: 509718

URL: http://svn.apache.org/viewvc?view=rev&rev=509718
Log:
add a test on throwing an undeclared exception

Modified:
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/
  (props changed)
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/resources/wsdl/StockExceptionTest.wsdl
    incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java

Propchange: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Feb 20 11:33:52 2007
@@ -11,4 +11,4 @@
 .settings
 .deployables
 .wtpmodules
-
+.checkstyle

Modified: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java?view=diff&rev=509718&r1=509717&r2=509718
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockExchangeJaxB.java
Tue Feb 20 11:33:52 2007
@@ -24,6 +24,7 @@
 import org.apache.tuscany.sca.test.exceptions.impl.jaxb.MarketClosedFault;
 import org.apache.tuscany.sca.test.exceptions.impl.jaxb.ObjectFactory;
 import org.apache.tuscany.sca.test.exceptions.impl.jaxb.StockOffer;
+import org.apache.tuscany.sca.test.exceptions.impl.jaxb.TestNotDeclaredAtSourceFault;
 import org.osoa.sca.annotations.Service;
 
 /**
@@ -44,7 +45,7 @@
      * 
      * @see org.apache.tuscany.sca.test.exceptions.impl.jaxb.StockExceptionTest#stockQuoteOffer(org.apache.tuscany.sca.test.exceptions.impl.jaxb.StockOffer)
      */
-    public StockOffer stockQuoteOffer(StockOffer input) throws InvalidSymbolFault_Exception,
MarketClosedFault {
+    public StockOffer stockQuoteOffer(StockOffer input) throws InvalidSymbolFault_Exception,
MarketClosedFault, TestNotDeclaredAtSourceFault{
 
         System.out.println("stockQuoteOffer '" + input + "'");
 
@@ -54,12 +55,18 @@
             return input;
 
         }
-        if ("CLOSED".equals(input.getName())) {
+        else if ("CLOSED".equals(input.getName())) {
             throw new MarketClosedFault("TO LATE!", 3);
+            
+        } else if( "testNotDeclaredAtSourceTest".equals(input.getName())){
+            
+            throw new TestNotDeclaredAtSourceFault("not declared", "fault info");
+            
         }
         ObjectFactory jaxbOjectFactory = new ObjectFactory();
 
         InvalidSymbolFault faultinfo = jaxbOjectFactory.createInvalidSymbolFault();
+        
         faultinfo.setOffer(input);
 
         throw new InvalidSymbolFault_Exception("bad symbol", faultinfo);

Modified: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java?view=diff&rev=509718&r1=509717&r2=509718
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDO.java
Tue Feb 20 11:33:52 2007
@@ -32,4 +32,6 @@
 
     void testInvalidSymbolSDOException() throws RemoteException, InvalidSymbolSDOException,
MarketClosedSDOException;
 
+    Object testNotDeclaredAtSourceTest();
+
 }

Modified: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java?view=diff&rev=509718&r1=509717&r2=509718
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/java/org/apache/tuscany/sca/test/exceptions/impl/StockTraderSDOImpl.java
Tue Feb 20 11:33:52 2007
@@ -63,12 +63,13 @@
         stockOffer.setPrice(100.00F); // offer to buy at max $100.00
 
         StockOffer stockOfferAccepted = exchangeJaxb.stockQuoteOffer(stockOffer);
-        
+
         return stockOfferAccepted;
 
     }
 
-    public void testInvalidSymbolSDOException() throws RemoteException, InvalidSymbolSDOException,
MarketClosedSDOException {
+    public void testInvalidSymbolSDOException() throws RemoteException, InvalidSymbolSDOException,
+        MarketClosedSDOException {
         StockOffer stockOffer = ScatesttoolFactory.INSTANCE.createStockOffer();
         // set up for a InvalidSymbolSDOException
         stockOffer.setName("");
@@ -76,8 +77,8 @@
 
         stockOffer.setPrice(11.0F); // offer to buy at max $100.00
         exchangeJaxb.stockQuoteOffer(stockOffer);
-            
-     }
+
+    }
 
     public void marketClosedSDOExceptionTest() {
         StockOffer stockOffer = ScatesttoolFactory.INSTANCE.createStockOffer();
@@ -90,14 +91,30 @@
             StockOffer stockOfferAccepted = exchangeJaxb.stockQuoteOffer(stockOffer);
             stockOfferAccepted.getPrice(); // the price actually bought.
         } catch (RemoteException e) {
-            // TODO Auto-generated catch block
+
             e.printStackTrace();
         } catch (InvalidSymbolSDOException e) {
-            // TODO Auto-generated catch block
+
             e.printStackTrace();
         } catch (MarketClosedSDOException e) {
-            // TODO Auto-generated catch block
+
             e.printStackTrace();
+        }
+    }
+
+    public Object  testNotDeclaredAtSourceTest() {
+        StockOffer stockOffer = ScatesttoolFactory.INSTANCE.createStockOffer();
+
+        // set up for a MarketClosedSDOException
+        stockOffer.setName("testNotDeclaredAtSourceTest");
+        stockOffer.setSymbol("TNDAS");
+        stockOffer.setPrice(Float.NaN); // offer to buy at max $100.00
+        try {
+            return  exchangeJaxb.stockQuoteOffer(stockOffer);
+            
+        } catch (Exception e) {
+            return e;
+           
         }
 
     }

Modified: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/resources/wsdl/StockExceptionTest.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/resources/wsdl/StockExceptionTest.wsdl?view=diff&rev=509718&r1=509717&r2=509718
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/resources/wsdl/StockExceptionTest.wsdl
(original)
+++ incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/main/resources/wsdl/StockExceptionTest.wsdl
Tue Feb 20 11:33:52 2007
@@ -58,27 +58,8 @@
             </element>
             
             <element name="MarketClosedFault"   type="xsd:int" />
-           
-           <!-- Fault wrapper -->
-           <element name="detail" type="tns:detail" minOccurs="0"/>
-            
-           <element name="ServiceWrapperFault">
-                <complexType>
-                    <sequence>
-                        <element name="faultreason"  type="xsd:string" />
-                        <element name="detail" minOccurs="1" type="tns:detail" />
-                    </sequence>
-                </complexType>
-            </element>
-            xs:complexType name="detail">
-
-
-			<complexType name="detail">
-			<sequence>
-			  <any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="1" /> 
-			  </sequence>
-			  <anyAttribute namespace="##other" processContents="lax" /> 
-			</complexType>
+			
+			<element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
      
         </schema>
     </wsdl:types>
@@ -100,6 +81,10 @@
         <wsdl:part element="tns:MarketClosedFault" name="fault" />
     </wsdl:message>
 
+   <wsdl:message name="TestNotDeclaredAtSourceFault">
+        <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
+    </wsdl:message>
+
 
     <wsdl:portType name="StockExceptionTest">
         <wsdl:operation name="stockQuoteOffer">
@@ -110,6 +95,8 @@
             <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException"
/>
              
             <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+            
+            <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException"
/>
         </wsdl:operation>
 
  
@@ -138,6 +125,12 @@
             <wsdl:fault name="MarketClosedException"> 
             	<wsdlsoap:fault name="MarketClosedException" use="literal" />
             </wsdl:fault>
+            
+            <wsdl:fault name="TestNotDeclaredAtSourceException"> 
+            	<wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
+            </wsdl:fault>
+
+
 
         </wsdl:operation>
 

Modified: incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java?view=diff&rev=509718&r1=509717&r2=509718
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java
(original)
+++ incubator/tuscany/branches/sca-java-integration/testing/sca/itest/exceptionXbindingTest/src/test/java/org/apache/tuscany/sca/test/exceptions/IntraCompositeTestCase.java
Tue Feb 20 11:33:52 2007
@@ -22,6 +22,7 @@
 
 import org.apache.tuscany.sca.test.exceptions.impl.StockTraderSDO;
 import org.apache.tuscany.sca.test.exceptions.sdohandgen.InvalidSymbolSDOException;
+import org.apache.tuscany.spi.databinding.TransformationException;
 import org.apache.tuscany.test.SCATestCase;
 import org.osoa.sca.CompositeContext;
 import org.osoa.sca.CurrentCompositeContext;
@@ -52,7 +53,7 @@
     public void testInvalidSymbolSDOException() {
         try {
             stockTrader.testInvalidSymbolSDOException();
-            throw new AssertionFailedError("Expected InvalidSymbolSDOException");
+            fail("Expected InvalidSymbolSDOException");
         } catch (InvalidSymbolSDOException e) {
             InvalidSymbolFault isf = e.getFaultInfo();
 
@@ -64,8 +65,17 @@
         } catch (Exception e) {
             e.printStackTrace();
             fail("Expected InvalidSymbolSDOException" + e);
-            
+
         }
+    }
+
+    public void testNotDeclaredAtSourceException() {
+
+        Object ret = stockTrader.testNotDeclaredAtSourceTest();
+
+        assertNotNull(ret);
+
+        assertEquals(TransformationException.class, ret.getClass());
 
     }
 



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


Mime
View raw message