Examples of DerivedFault1


Examples of org.test.polymorphicfaults.DerivedFault1

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((BaseFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == DerivedFault1.class);
        DerivedFault1 df = (DerivedFault1) fault;
        assertTrue(df.getA() == 2);
        assertTrue(df.getB().equals("DerivedFault1"));
       
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 100);
            assertTrue(faultInfo.getB().equals("DF1"));
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

        if (tickerSymbol.equals("SMPL")) {
            throw new SimpleFault("Server throws SimpleFault", 100);
        } else if (tickerSymbol.equals("LEGC")) {
            throw new InvalidTickerFault_Exception("Server throws InvalidTickerFault_Exception", tickerSymbol, 123);
        } else if (tickerSymbol.equals("DF1")) {
            DerivedFault1 df = new DerivedFault1();
            df.setA(100);
            df.setB(tickerSymbol);
            throw new DerivedFault1_Exception("Server throws DerivedFault1_Exception", df);
        else if (tickerSymbol.equals("DF2")) {
            DerivedFault2 df = new DerivedFault2();
            df.setA(200);
            df.setB(tickerSymbol);
            df.setC(80.0F);
            throw new DerivedFault2_Exception("Server throws DerivedFault2_Exception", df);
        } else if (tickerSymbol.equals("BASE")) {
            BaseFault bf = new BaseFault();
            bf.setA(400);
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

        } else if (b.equals("BaseFault")) {
            BaseFault bf = new BaseFault();
            bf.setA(a)
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
        } else if (b.equals("DerivedFault1")) {
            DerivedFault1 df = new DerivedFault1();
            df.setA(a);
            df.setB(b);
            throw new BaseFault_Exception("Server throws BaseFault_Exception", df);
        } else if (b.equals("DerivedFault2")) {
            DerivedFault2 df = new DerivedFault2();
            df.setA(a);
            df.setB(b);
            df.setC(c);
            throw new BaseFault_Exception("Server throws BaseFault_Exception", df);
        } else if (b.equals("SOAPFaultException")) {
            try {
                SOAPFault soapFault = createSOAPFault();
                soapFault.setFaultString("hello world");
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

            fault.value = newFault;
            return;
        } else if (fault.value.getB().equals("exception")) {
            throw new EqualFault("Server throws EqualFault", newFault);           
        }
        DerivedFault1 df = new DerivedFault1();
        df.setA(a + 1);
        df.setB("Server: " + b);
        throw new EqualFault("Server throws EqualFault", df);
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((BaseFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == DerivedFault1.class);
        DerivedFault1 df = (DerivedFault1) fault;
        assertTrue(df.getA() == 2);
        assertTrue(df.getB().equals("DerivedFault1"));
       
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 100);
            assertTrue(faultInfo.getB().equals("DF1"));
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((BaseFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == DerivedFault1.class);
        DerivedFault1 df = (DerivedFault1) fault;
        assertTrue(df.getA() == 2);
        assertTrue(df.getB().equals("DerivedFault1"));
       
        // Repeat to verify behavior
        try{
            exception = null;
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "DerivedFault1", 2);
           
        }catch(BaseFault_Exception e){
            exception = e;
        } catch (ComplexFault_Exception e) {
            fail("Should not get ComplexFault_Exception in this testcase");
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        fault = ((BaseFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == DerivedFault1.class);
        df = (DerivedFault1) fault;
        assertTrue(df.getA() == 2);
        assertTrue(df.getB().equals("DerivedFault1"));
       
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 100);
            assertTrue(faultInfo.getB().equals("DF1"));
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
       
        // Repeat to verify behavior
        try{
            // the invoke will throw an exception, if the test is performed right
            float total = proxy.getQuote("DF1");
            fail( "Expected DerivedFault1_Exception but no fault was thrown");
        }catch(DerivedFault1_Exception e){
            DerivedFault1_Exception fault = (DerivedFault1_Exception) e;

            DerivedFault1 faultInfo = fault.getFaultInfo();
            assertTrue(faultInfo != null);
            assertTrue(faultInfo.getA() == 100);
            assertTrue(faultInfo.getB().equals("DF1"));
        } catch (Exception e) {
            fail("Wrong exception thrown.  Expected DerivedFault1_Exception but received " + e.getClass());
        }
    }
View Full Code Here

Examples of org.test.polymorphicfaults.DerivedFault1

        if (tickerSymbol.equals("SMPL")) {
            throw new SimpleFault("Server throws SimpleFault", 100);
        } else if (tickerSymbol.equals("LEGC")) {
            throw new InvalidTickerFault_Exception("Server throws InvalidTickerFault_Exception", tickerSymbol, 123);
        } else if (tickerSymbol.equals("DF1")) {
            DerivedFault1 df = new DerivedFault1();
            df.setA(100);
            df.setB(tickerSymbol);
            throw new DerivedFault1_Exception("Server throws DerivedFault1_Exception", df);
        else if (tickerSymbol.equals("DF2")) {
            DerivedFault2 df = new DerivedFault2();
            df.setA(200);
            df.setB(tickerSymbol);
            df.setC(80.0F);
            throw new DerivedFault2_Exception("Server throws DerivedFault2_Exception", df);
        } else if (tickerSymbol.equals("BASE")) {
            BaseFault bf = new BaseFault();
            bf.setA(400);
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.