My favorites | Sign in
Project Home
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 2 attachment: Base64EncoderTest.java (610 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
*
*/
package org.vast.sweCommon;

import junit.framework.TestCase;

import java.io.ByteArrayOutputStream;


/**
* @author Jesper Zedlitz <jze@informatik.uni-kiel.de>
*
*/
public class Base64EncoderTest extends TestCase {
public void testRead() throws Exception {
String expectedResult = "SGVsbG8sIHdvcmxkIQ==";

ByteArrayOutputStream baos = new ByteArrayOutputStream();

Base64Encoder encoder = new Base64Encoder(baos);
encoder.write("Hello, world!".getBytes());

String result = baos.toString();
assertEquals(expectedResult, result);
}
}
Powered by Google Project Hosting