Package org.testng

Examples of org.testng.SkipException


    public void testSimplePutFieldsWriteObjectEmptyReadObject() throws Throwable {
        final Serializable serializable = new TestSerializablePutFieldsWriteObjectEmptyReadObject();
        runReadWriteTest(new ReadWriteTest() {
            public void runWrite(final Marshaller marshaller) throws Throwable {
                if (! (marshaller instanceof RiverMarshaller)) {
                    throw new SkipException("Test not relevant for " + marshaller);
                }
                marshaller.writeObject(serializable);
            }

            public void runRead(final Unmarshaller unmarshaller) throws Throwable {
View Full Code Here


                marshaller.writeObject(ext);
            }

            public void runRead(final Unmarshaller unmarshaller) throws Throwable {
                if (unmarshaller instanceof ObjectInputStreamUnmarshaller) {
                    throw new SkipException("Test not relevant for " + unmarshaller);
                }
                final TestExternalizableConstructed extn = (TestExternalizableConstructed) unmarshaller.readObject();
                assertTrue("No EOF", unmarshaller.read() == -1);
                assertTrue("readExternal was not run", extn.ran);
            }
View Full Code Here

                });
            }

            public void runWrite(final Marshaller marshaller) throws Throwable {
                if (marshaller instanceof ObjectOutputStreamMarshaller) {
                    throw new SkipException("Test not relevant for " + marshaller);
                }
                marshaller.writeObject(orig);
                marshaller.writeObject(orig);
            }
View Full Code Here

                });
            }

            public void runWrite(final Marshaller marshaller) throws Throwable {
                if (marshaller instanceof ObjectOutputStreamMarshaller) {
                    throw new SkipException("Test not relevant for " + marshaller);
                }
                marshaller.writeObject(orig);
                marshaller.writeObject(orig);
            }

            public void runRead(final Unmarshaller unmarshaller) throws Throwable {
                if (unmarshaller instanceof ObjectInputStreamUnmarshaller) {
                    throw new SkipException("Substituting class name on read does not work with " + unmarshaller);
                }
                final Object repl = unmarshaller.readObject();
                assertEquals(ReplacementClass.class, repl.getClass());
                assertSame(repl, unmarshaller.readObject());
                assertEquals(((ReplacementClass) repl).blah, "Testing!");
View Full Code Here

        final TestSerializable t = new TestSerializable();
        ByteArrayOutputStream baos = new ByteArrayOutputStream(10240);
        ByteOutput byteOutput = Marshalling.createByteOutput(baos);
        Marshaller marshaller = testMarshallerProvider.create(configuration.clone(), byteOutput);
        if (marshaller instanceof ObjectOutputStreamMarshaller) {
            throw new SkipException(marshaller + " doesn't support start()");
        }
        System.out.println("Marshaller = " + marshaller + " (version set to " + configuration.getVersion() + ")");
        marshaller.writeObject(t);
        marshaller.finish();
        byte[] bytes = baos.toByteArray();
        ByteInput byteInput = Marshalling.createByteInput(new ByteArrayInputStream(bytes));
        Unmarshaller unmarshaller = testUnmarshallerProvider.create(configuration.clone(), byteInput);
        if (unmarshaller instanceof ObjectInputStreamUnmarshaller) {
            throw new SkipException(unmarshaller + " doesn't support start()");
        }
        System.out.println("Unmarshaller = " + unmarshaller + " (version set to " + configuration.getVersion() + ")");
        assertEquals(t, unmarshaller.readObject());
        unmarshaller.finish();
        baos.reset();
View Full Code Here

     * Verify that use of customized StreamHeader works correctly.
     */
    @Test
    public void testStreamHeader() throws Throwable {
        if (testMarshallerProvider instanceof ObjectOutputStreamTestMarshallerProvider) {
            throw new SkipException("Can't set StreamHeader in compatibility tests");
        }
        if (testUnmarshallerProvider instanceof ObjectInputStreamTestUnmarshallerProvider) {
            throw new SkipException("Can't set StreamHeader in compatibility tests");
        }
        final Serializable serializable = new TestSerializable();
        final TestStreamHeader streamHeader = new TestStreamHeader();
        configuration.setStreamHeader(streamHeader);
        ByteArrayOutputStream baos = new ByteArrayOutputStream(10240);
View Full Code Here

     * Verify that use of customized ObjectResolver works correctly.
     */
    @Test
    public void testObjectResolver() throws Throwable {
        if (testMarshallerProvider instanceof ObjectOutputStreamTestMarshallerProvider) {
            throw new SkipException("Can't use ObjectResolver in compatibility tests");
        }
        if (testUnmarshallerProvider instanceof ObjectInputStreamTestUnmarshallerProvider) {
            throw new SkipException("Can't use ObjectResolver in compatibility tests");
        }
        final TestObjectResolver objectResolver = new TestObjectResolver();
        final TestSerializable serializable = new TestSerializable();
        runReadWriteTest(new ReadWriteTest() {
            public void configure(final MarshallingConfiguration configuration) throws Throwable {
View Full Code Here

    }
   
    @Test
    public void testObjectPreResolver() throws Throwable {
        if (testMarshallerProvider instanceof ObjectOutputStreamTestMarshallerProvider) {
            throw new SkipException("Can't use objectPreResolver in compatibility tests");
        }
        if (testUnmarshallerProvider instanceof ObjectInputStreamTestUnmarshallerProvider) {
            throw new SkipException("Can't use objectPreResolver in compatibility tests");
        }
        final TestObjectPreResolver objectResolver = new TestObjectPreResolver();
        final TestSerializable serializable = new TestSerializable();
        final Integer expectedObj = new Integer(17);
        runReadWriteTest(new ReadWriteTest() {
View Full Code Here

     * Verify that objects with writeReplace()/readResolve() interact correctly with ObjectResolvers.
     */
    @Test
    public void testObjectResolverWithInterleavedWriteReplace() throws Throwable {
        if (testMarshallerProvider instanceof ObjectOutputStreamTestMarshallerProvider) {
            throw new SkipException("Can't use ObjectResolver in compatibility tests");
        }
        if (testUnmarshallerProvider instanceof ObjectInputStreamTestUnmarshallerProvider) {
            throw new SkipException("Can't use ObjectResolver in compatibility tests");
        }
        final TestObjectResolverForInterleavedWriteReplace objectResolver = new TestObjectResolverForInterleavedWriteReplace();
        final TestSerializableWithInterleavedWriteReplace o = new TestSerializableWithInterleavedWriteReplace(3, TestEnum.FIRST);
        TestSerializableWithInterleavedWriteReplace.reset();
        runReadWriteTest(new ReadWriteTest() {
View Full Code Here

    * results in sending a handle on the second write.
    */
    @Test
    public void testExternalizerWithRepeatedWrites() throws Throwable {
        if (testMarshallerProvider instanceof ObjectOutputStreamTestMarshallerProvider) {
            throw new SkipException("Can't use ClassExternalizerFactory in compatibility tests");
        }
        if (testUnmarshallerProvider instanceof ObjectInputStreamTestUnmarshallerProvider) {
            throw new SkipException("Can't use ClassExternalizerFactory in compatibility tests");
        }
        TestExternalizerFactory externalizerFactory = new TestExternalizerFactory();
        Object o = new TestExternalizableInt(7);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ByteOutput byteOutput = Marshalling.createByteOutput(baos);
View Full Code Here

TOP

Related Classes of org.testng.SkipException

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.