@Test public void testLatin1() { ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING)); } }
@Test public void testLatin1() { ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING)); } }
@Test public void testLatin1() { ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING)); } }
@Test public void testLatin1() { ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING)); } }
@Test public void testLatin1() { ArrayAssert.assertEquals(LATIN1_UTF8_DATA, CharsetUtil.getUtf8Bytes(LATIN1_STRING)); } }
public void testConstruction() { ScuflModel model = new ScuflModel(); assertFalse(model.offline); ArrayAssert.assertEquals(new Processor[0], model.getProcessors()); ArrayAssert.assertEquals(new DataConstraint[0], model .getDataConstraints()); ArrayAssert.assertEquals(new ConcurrencyConstraint[0], model .getConcurrencyConstraints()); ArrayAssert.assertEquals(new ScuflModelEventListener[0], model .getListeners()); ArrayAssert.assertEquals(new Port[0], model.getWorkflowSinkPorts()); ArrayAssert.assertEquals(new Port[0], model.getWorkflowSourcePorts()); assertNotNull(model.getDescription()); // NOTE: the log level does not seem to be used for anything assertEquals(0, model.getLogLevel()); }
@Test public void testGetUtf8String() { ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in")); ArrayAssert.assertEquals(new byte[] {}, CharsetUtil.getUtf8Bytes(null)); testStringOfLength(0); testStringOfLength(10); testStringOfLength(100); testStringOfLength(1000); }
@Test public void testGetUtf8String() { ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in")); ArrayAssert.assertEquals(new byte[] {}, CharsetUtil.getUtf8Bytes(null)); testStringOfLength(0); testStringOfLength(10); testStringOfLength(100); testStringOfLength(1000); }
@Test public void testGetUtf8String() { ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in")); ArrayAssert.assertEquals(ArrayUtils.EMPTY_BYTE_ARRAY, CharsetUtil.getUtf8Bytes(null)); testStringOfLength(0); testStringOfLength(10); testStringOfLength(100); testStringOfLength(1000); }
@Test public void testGetUtf8String() { ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in")); ArrayAssert.assertEquals(ArrayUtils.EMPTY_BYTE_ARRAY, CharsetUtil.getUtf8Bytes(null)); testStringOfLength(0); testStringOfLength(10); testStringOfLength(100); testStringOfLength(1000); }
@Test public void testGetUtf8String() { ArrayAssert.assertEquals(new byte[] { 0x69, 0x6e }, CharsetUtil.getUtf8Bytes("in")); ArrayAssert.assertEquals(ArrayUtils.EMPTY_BYTE_ARRAY, CharsetUtil.getUtf8Bytes(null)); testStringOfLength(0); testStringOfLength(10); testStringOfLength(100); testStringOfLength(1000); }
@Test public void testHugeBody() throws Exception { byte[] body = new byte[1024*1024]; // 1 MB for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPut_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("PUT") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("PUT", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPut_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("PUT") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("PUT", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testHugeBody() throws Exception { byte[] body = new byte[1024*1024]; // 1 MB for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPost_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)(i % 255); } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPost_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)(i % 255); } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testHugeBody() throws Exception { byte[] body = new byte[1024*1024]; // 1 MB for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPut_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)i; } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("PUT") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("PUT", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }
@Test public void testPost_withBody() throws Exception { byte[] body = new byte[5000]; for (int i=0; i < body.length; ++i) { body[i] = (byte)(i % 255); } HttpRequest request = new HttpRequest(BASE_URL) .setMethod("POST") .setPostBody(body) .addHeader("content-type", "application/octet-stream"); HttpResponse response = fetcher.fetch(request); assertEquals("POST", response.getHeader("x-method")); ArrayAssert.assertEquals(body, response.getResponseAsBytes()); }