1 58 package org.krysalis.barcode.output.eps; 59 60 import java.io.ByteArrayOutputStream ; 61 62 import org.apache.avalon.framework.configuration.DefaultConfiguration; 63 import org.apache.avalon.framework.logger.Logger; 64 import org.apache.avalon.framework.logger.NullLogger; 65 import org.krysalis.barcode.BarcodeGenerator; 66 import org.krysalis.barcode.BarcodeUtil; 67 68 import junit.framework.TestCase; 69 70 75 public class EPSOutputTest extends TestCase { 76 77 public EPSOutputTest(String name) { 78 super(name); 79 } 80 81 public void testEPS() throws Exception { 82 DefaultConfiguration cfg = new DefaultConfiguration("cfg"); 83 cfg.addChild(new DefaultConfiguration("intl2of5")); 84 Logger log = new NullLogger(); 85 86 BarcodeUtil util = BarcodeUtil.getInstance(); 87 BarcodeGenerator gen = util.createBarcodeGenerator(cfg, log); 88 89 ByteArrayOutputStream baout = new ByteArrayOutputStream (); 90 EPSCanvasProvider provider = new EPSCanvasProvider(baout); 91 92 gen.generateBarcode(provider, "123"); 94 provider.finish(); 95 96 assertTrue(baout.size() > 0); 97 } 98 99 } | Popular Tags |