/razpub/test_src/com/razie/pub/draw/test/TestStreams.java
http://razpub.googlecode.com/ · Java · 32 lines · 21 code · 7 blank · 4 comment · 0 complexity · c36342d9f69b3280eea0e08570f39d1e MD5 · raw file
- /**
- * Razvan's public code.
- * Copyright 2008 based on Apache license (share alike) see LICENSE.txt for details.
- */
- package com.razie.pub.draw.test;
-
- import java.io.ByteArrayOutputStream;
- import java.io.IOException;
-
- import junit.framework.TestCase;
- import razie.draw.HttpDrawStream;
- import razie.draw.JsonDrawStream;
-
- import com.razie.pub.base.log.Log;
-
- public class TestStreams extends TestCase {
-
- public void setUp() {
- }
-
- public void testAllStreams() throws IOException {
- ByteArrayOutputStream bytes = new ByteArrayOutputStream();
- HttpDrawStream http = new HttpDrawStream (bytes);
- http.write("11");
- assertTrue (bytes.toString().contains("HTTP"));
- JsonDrawStream json = new JsonDrawStream (bytes);
- json.write("11");
- assertTrue (bytes.toString().contains("/json"));
- }
-
- static final Log logger = Log.factory.create(TestStreams.class.getName());
- }