Package org.switchyard.serial.protostuff.ProtostuffSerializationData

Examples of org.switchyard.serial.protostuff.ProtostuffSerializationData.FlatTireException


    }

    @Test
    public void testCustomExceptions() throws Exception {
        final OutOfGasException expectedOutOfGasException = new OutOfGasException("Dagnabit!");
        final FlatTireException expectedFlatTireException = new FlatTireException(new Wheel(Wheel.Location.BACK_RIGHT));
        Car car = new Car();
        car.setProblems(Arrays.asList(new Exception[]{expectedOutOfGasException, expectedFlatTireException}));
        car = serDeser(car, Car.class);
        final List<Exception> actualExceptions = car.getProblems();
        final OutOfGasException actualOutOfGasException = (OutOfGasException)actualExceptions.get(0);
        final FlatTireException actualFlatTireException = (FlatTireException)actualExceptions.get(1);
        Assert.assertEquals(expectedOutOfGasException.getExplicitive(), actualOutOfGasException.getExplicitive());
        Assert.assertSame(expectedFlatTireException.getWheel().getLocation(), actualFlatTireException.getWheel().getLocation());
        Assert.assertEquals("Really?", actualFlatTireException.getMessage());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.serial.protostuff.ProtostuffSerializationData.FlatTireException

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.