@Test public void testSendMessageHeaderThrowsNullPointerException() throws Throwable { VAPChannel vAPChannel = new VAPChannel(); ISOMsg m = new ISOMsg("testVAPChannelMti"); byte[] b = new byte[0]; m.setHeader(b); try { vAPChannel.sendMessageHeader(m, 100); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.DataOutputStream.write(byte[])\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()"); } assertEquals(0, m.getDirection(), "m.getDirection()"); } }
protected void sendMessageHeader(ISOMsg m, int len) throws IOException { ISOHeader h = !isOverrideHeader() && m.getHeader() != null ? m.getISOHeader() : new BASE1Header (srcid, dstid, headerFormat); if (h instanceof BASE1Header) ((BASE1Header)h).setLen(len); serverOut.write(h.pack()); }
VAPChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { ISOHeader h = !isOverrideHeader() && m.getHeader() != null ? m.getISOHeader() : new BASE1Header (srcid, dstid, headerFormat); if (h instanceof BASE1Header) ((BASE1Header)h).setLen(len); serverOut.write(h.pack()); } }
VAPChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { ISOHeader h = !isOverrideHeader() && m.getHeader() != null ? m.getISOHeader() : new BASE1Header (srcid, dstid, headerFormat); if (h instanceof BASE1Header) ((BASE1Header)h).setLen(len); serverOut.write(h.pack()); } VAPChannel();  VAPChannel(String host, int port, ISOPackager p);  VAPChannel(ISOPackager p);  VAPChannel(ISOPackager p, ServerSocket serverSocket); }
VAPChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { ISOHeader h = !isOverrideHeader() && m.getHeader() != null ? m.getISOHeader() : new BASE1Header (srcid, dstid, headerFormat); if (h instanceof BASE1Header) ((BASE1Header)h).setLen(len); serverOut.write(h.pack()); } VAPChannel();  VAPChannel(String host, int port, ISOPackager p);  VAPChannel(ISOPackager p);  VAPChannel(ISOPackager p, ServerSocket serverSocket); void setSrcId(String srcid); String getSrcId(); void setDstId(String dstid); String getDstId(); void send(ISOMsg m); void setConfiguration(Configuration cfg); }
VAPChannel extends BaseChannel { protected void sendMessageHeader(ISOMsg m, int len) throws IOException { ISOHeader h = !isOverrideHeader() && m.getHeader() != null ? m.getISOHeader() : new BASE1Header (srcid, dstid, headerFormat); if (h instanceof BASE1Header) ((BASE1Header)h).setLen(len); serverOut.write(h.pack()); } VAPChannel();  VAPChannel(String host, int port, ISOPackager p);  VAPChannel(ISOPackager p);  VAPChannel(ISOPackager p, ServerSocket serverSocket); void setSrcId(String srcid); String getSrcId(); void setDstId(String dstid); String getDstId(); void send(ISOMsg m); void setConfiguration(Configuration cfg);  }