import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
/**
* @author Ari Pollak
*/
-public final class EAN8WriterTestCase extends TestCase {
+public final class EAN8WriterTestCase extends Assert {
+ @Test
public void testEncode() throws WriterException {
String testStr = "0001010001011010111101111010110111010101001110111001010001001011100101000";
BitMatrix result = new EAN8Writer().encode("96385074", BarcodeFormat.EAN_8, testStr.length(), 0);
for (int i = 0; i < testStr.length(); i++) {
- assertEquals("Element " + i,
- testStr.charAt(i) == '1',
- result.get(i, 0));
+ assertEquals("Element " + i, testStr.charAt(i) == '1', result.get(i, 0));
}
}