Examples of Pcx


Examples of it.stefanobertini.zebra.cpcl.labelmode.Pcx

public class PcxTest {

    @Test
    public void testFromPrinter() {
  Pcx command = new Pcx(new Position(1, 2));
  command.loadImageFromPrinter("FILE.TXT");

  byte[] data = command.getCommandByteArray();
  byte[] expected = "PCX 1 2 !<FILE.TXT\r\n".getBytes();

  assertArrayEquals(expected, data);
    }
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Pcx

  assertArrayEquals(expected, data);
    }

    @Test
    public void testFromFile() throws Exception {
  Pcx command = new Pcx(new Position(1, 2));
  command.loadImageFromFile(new File("./target/test-classes/test.pcx"));

  byte[] data = command.getCommandByteArray();
  ByteArrayOutputStream expected = new ByteArrayOutputStream();
  expected.write("PCX 1 2\r\n".getBytes());
  for (byte i = 0; i < 32; i++) {
      expected.write(i);
  }
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Pcx

  assertArrayEquals(expected.toByteArray(), data);
    }

    @Test
    public void testFromResource() throws Exception {
  Pcx command = new Pcx(new Position(1, 2));
  command.loadImageFromResource("test.pcx");

  byte[] data = command.getCommandByteArray();
  ByteArrayOutputStream expected = new ByteArrayOutputStream();
  expected.write("PCX 1 2\r\n".getBytes());
  for (byte i = 0; i < 32; i++) {
      expected.write(i);
  }
View Full Code Here

Examples of it.stefanobertini.zebra.cpcl.labelmode.Pcx

  assertArrayEquals(expected.toByteArray(), data);
    }

    @Test(expected = ValidationException.class)
    public void testValidation() {
  Pcx command = new Pcx(new Position(1, 2));

  command.getCommandByteArray();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.