Examples of NetworkPrintDriver


Examples of it.stefanobertini.zebra.NetworkPrintDriver

  }
    }

    @Test
    public void testConnect() throws Exception {
  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.open();
    }
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

  driver.open();
    }

    @Test(expected = ConnectException.class)
    public void testConnectError() throws Exception {
  driver = new NetworkPrintDriver("127.0.0.1", BAD_PORT);
  driver.open();
    }
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

    @Test
    public void testSendMessage() throws Exception {
  byte[] received;

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket);
  serverSocketThread.start();
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

    public void testSendMessageDebugStream() throws Exception {

  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  PrintStream debugStream = new PrintStream(bos);

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.setDebugStream(debugStream);
  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket);
  serverSocketThread.start();
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

    @Test
    public void testReceiveOk() throws Exception {
  String expectedAnswer = "TEST-ANSWER";
  String answer;

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket, ("\"" + expectedAnswer + "\"").getBytes(), 500);
  serverSocketThread.start();
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

    @Test
    public void testReceiveTimeout() throws Exception {
  String expectedAnswer = "";
  String answer;

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket, expectedAnswer.getBytes(), 50);
  serverSocketThread.start();
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

    @Test
    public void testReceiveOkCustomTimeout() throws Exception {
  String expectedAnswer = "TEST-ANSWER";
  String answer;

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.setDefaultAnswerWaitMillis(600);

  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket, expectedAnswer.getBytes(), 500);
View Full Code Here

Examples of it.stefanobertini.zebra.NetworkPrintDriver

  byte[] expected;

  expected = "ABORT\r\nEND\r\n".getBytes();

  driver = new NetworkPrintDriver("127.0.0.1", PORT);
  driver.setDefaultAnswerWaitMillis(600);

  driver.open();

  ServerSocketThread serverSocketThread = new ServerSocketThread(serverSocket);
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.