private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); throwIfPresent(deserializationException); }
@Test @Category(NeedsRunner.class) public void testNoException() throws Exception { Pipeline p = pipelineWith(new CustomTestCoder(null, null, null, null, null)); p.run().waitUntilFinish(); }
@Ignore("DirectRunner doesn't decode coders so this test does not pass.") @Test @Category(NeedsRunner.class) public void testDeserializationNPException() throws Exception { Pipeline p = pipelineWith( new CustomTestCoder(null, null, null, NULL_POINTER_EXCEPTION, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.lang.NullPointerException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Test @Category(NeedsRunner.class) public void testSerializationIOException() throws Exception { Pipeline p = pipelineWith(new CustomTestCoder(null, null, IO_EXCEPTION, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.io.IOException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Test @Category(NeedsRunner.class) public void testDecodingNPException() throws Exception { Pipeline p = pipelineWith( new CustomTestCoder(NULL_POINTER_EXCEPTION, null, null, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.lang.NullPointerException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Override public String decode(InputStream inStream) throws CoderException, IOException { throwIfPresent(decodingException); return StringUtf8Coder.of().decode(inStream); }
@Override public void encode(String value, OutputStream outStream) throws CoderException, IOException { throwIfPresent(encodingException); StringUtf8Coder.of().encode(value, outStream); }
@Ignore("DirectRunner doesn't decode coders so this test does not pass.") @Test @Category(NeedsRunner.class) public void testDeserializationIOException() throws Exception { Pipeline p = pipelineWith(new CustomTestCoder(null, null, null, IO_EXCEPTION, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.io.IOException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Test @Category(NeedsRunner.class) public void testEncodingNPException() throws Exception { Pipeline p = pipelineWith( new CustomTestCoder(null, NULL_POINTER_EXCEPTION, null, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.lang.NullPointerException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
private void writeObject(ObjectOutputStream out) throws IOException { throwIfPresent(serializationException); out.defaultWriteObject(); }
@Test @Category(NeedsRunner.class) public void testEncodingIOException() throws Exception { Pipeline p = pipelineWith(new CustomTestCoder(null, IO_EXCEPTION, null, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.io.IOException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Test @Category(NeedsRunner.class) public void testDecodingIOException() throws Exception { Pipeline p = pipelineWith(new CustomTestCoder(IO_EXCEPTION, null, null, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.io.IOException: Super Unique Message!!!")); p.run().waitUntilFinish(); }
@Test @Category(NeedsRunner.class) public void testSerializationNPException() throws Exception { Pipeline p = pipelineWith( new CustomTestCoder(null, null, NULL_POINTER_EXCEPTION, null, EXCEPTION_MESSAGE)); thrown.expect(Exception.class); thrown.expect(new ExceptionMatcher("java.lang.NullPointerException: Super Unique Message!!!")); p.run().waitUntilFinish(); }