Package org.test.polymorphicfaults

Examples of org.test.polymorphicfaults.ComplexFault


        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == ComplexFault.class);
        ComplexFault cf = (ComplexFault) fault;
        assertTrue(cf.getA() == 2);
        assertTrue(cf.getB().equals("Complex"))
        assertTrue(cf.getC() == 2);
        assertTrue(cf.getD() == 5);
    }
View Full Code Here


     * Throws wrapper exceptions for derived fault beans
     */
    public int throwFault(int a, String b, float c) throws
        BaseFault_Exception, ComplexFault_Exception {
        if(b.equals("Complex")) {
            ComplexFault cf = new ComplexFault();
            cf.setA(a);
            cf.setB(b);
            cf.setC(c);
            cf.setD(5);
            throw new ComplexFault_Exception("Server throws ComplexFault_Exception", cf);
        } else if (b.equals("BaseFault")) {
            BaseFault bf = new BaseFault();
            bf.setA(a)
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == ComplexFault.class);
        ComplexFault cf = (ComplexFault) fault;
        assertTrue(cf.getA() == 2);
        assertTrue(cf.getB().equals("Complex"))
        assertTrue(cf.getC() == 2);
        assertTrue(cf.getD() == 5);
    }
View Full Code Here

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

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == ComplexFault.class);
        cf = (ComplexFault) fault;
        assertTrue(cf.getA() == 2);
        assertTrue(cf.getB().equals("Complex"))
        assertTrue(cf.getC() == 2);
        assertTrue(cf.getD() == 5);
    }
View Full Code Here

     * Throws wrapper exceptions for derived fault beans
     */
    public int throwFault(int a, String b, float c) throws
        BaseFault_Exception, ComplexFault_Exception {
        if(b.equals("Complex")) {
            ComplexFault cf = new ComplexFault();
            cf.setA(a);
            cf.setB(b);
            cf.setC(c);
            cf.setD(5);
            throw new ComplexFault_Exception("Server throws ComplexFault_Exception", cf);
        } else if (b.equals("BaseFault")) {
            BaseFault bf = new BaseFault();
            bf.setA(a)
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here

     * Throws wrapper exceptions for derived fault beans
     */
    public int throwFault(int a, String b, float c) throws
        BaseFault_Exception, ComplexFault_Exception {
        if(b.equals("Complex")) {
            ComplexFault cf = new ComplexFault();
            cf.setA(a);
            cf.setB(b);
            cf.setC(c);
            cf.setD(5);
            throw new ComplexFault_Exception("Server throws ComplexFault_Exception", cf);
        } else if (b.equals("BaseFault")) {
            BaseFault bf = new BaseFault();
            bf.setA(a)
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertSame(ComplexFault.class, fault.getClass());
        ComplexFault cf = (ComplexFault) fault;
        assertEquals(2, cf.getA());
        assertEquals("Complex", cf.getB())
        assertEquals(2F, cf.getC());
        assertEquals(5, cf.getD());
       
       
        // Repeat to verify behavior
        try{
            exception = null;
           
            // the invoke will throw an exception, if the test is performed right
            int total = proxy.throwFault(2, "Complex", 2)// "Complex" will cause service to throw ComplexFault_Exception
           
        }catch(BaseFault_Exception e){
            fail("Should not get BaseFault_Exception in this testcase");
        } catch (ComplexFault_Exception e) {
            exception = e;
        }

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertSame(ComplexFault.class, fault.getClass());
        cf = (ComplexFault) fault;
        assertEquals(2, cf.getA());
        assertEquals("Complex", cf.getB())
        assertEquals(2F, cf.getC());
        assertEquals(5, cf.getD());
    }
View Full Code Here

        TestLogger.logger.debug("----------------------------------");
       
        assertNotNull(exception);
        Object fault = ((ComplexFault_Exception)exception).getFaultInfo();
        assertTrue(fault.getClass() == ComplexFault.class);
        ComplexFault cf = (ComplexFault) fault;
        assertTrue(cf.getA() == 2);
        assertTrue(cf.getB().equals("Complex"))
        assertTrue(cf.getC() == 2);
        assertTrue(cf.getD() == 5);
    }
View Full Code Here

     * Throws wrapper exceptions for derived fault beans
     */
    public int throwFault(int a, String b, float c) throws
        BaseFault_Exception, ComplexFault_Exception {
        if(b.equals("Complex")) {
            ComplexFault cf = new ComplexFault();
            cf.setA(a);
            cf.setB(b);
            cf.setC(c);
            cf.setD(5);
            throw new ComplexFault_Exception("Server throws ComplexFault_Exception", cf);
        } else if (b.equals("BaseFault")) {
            BaseFault bf = new BaseFault();
            bf.setA(a)
            throw new BaseFault_Exception("Server throws BaseFault_Exception", bf);
View Full Code Here

TOP

Related Classes of org.test.polymorphicfaults.ComplexFault

Copyright © 2018 www.massapicom. 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.