public void dump (PrintStream p, String indent) { String inner = indent + " "; p.println (indent + "<" + getTagName() + ">"); p.println (inner + "<action>" + action + "</action>"); getCardHolder().dump (p, inner); p.println (inner + "<amount>" + amount + "</amount>"); p.println (inner + "<currency>" + currency + "</currency>"); p.println (inner + "<terminal>" + terminal + "</terminal>"); p.println (inner + "<purchasePlan>"+ purchasePlan + "</purchasePlan>"); p.println (inner + "<numberOfPayments>" + numberOfPayments + "</numberOfPayments>" ); if (response != null && response instanceof Loggeable) ((Loggeable)response).dump (p, inner); p.println (indent + "</" + getTagName() + ">"); } protected String getTagName() {
@Test public void testDump6() throws Throwable { PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-8"); new CardHolder("testCardHolderPan", "4Cha").dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump() throws Throwable { CardHolder cardHolder = new CardHolder("testCardHolderPan", "4Cha"); cardHolder.setSecurityCode("testCardHolderSecurityCode"); PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-8"); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump5() throws Throwable { CardHolder cardHolder = new CardHolder(); cardHolder.setTrack1("testCardHolderTrack1"); cardHolder.setEXP("9913"); PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-8"); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump2() throws Throwable { CardHolder cardHolder = new CardHolder("k'X9|DH:!;uQ<kG8!P?- ,\"Y!u`r;jB^)>3AbS9,"); cardHolder.setTrack1("testCardHolderTrack1"); cardHolder.setSecurityCode(null); PrintStream p = new PrintStream(new ByteArrayOutputStream()); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump3() throws Throwable { CardHolder cardHolder = new CardHolder(); cardHolder.setTrack1("testCardHolderTrack1"); cardHolder.setEXP("99-8"); PrintStream p = new PrintStream(new ByteArrayOutputStream(), true, "UTF-8"); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump4() throws Throwable { PrintStream p = new PrintStream(new ByteArrayOutputStream()); CardHolder cardHolder = new CardHolder(); cardHolder.setEXP("9912"); cardHolder.setSecurityCode("testCardHolderSecurityCode"); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDump1() throws Throwable { CardHolder cardHolder = new CardHolder("testCardHolderPan", "4Cha"); cardHolder.setTrack1(null); cardHolder.setSecurityCode("testCardHolderSecurityCode"); cardHolder.setTrailer("testCardHolderTrailler"); PrintStream p = new PrintStream(new ByteArrayOutputStream()); cardHolder.dump(p, "testCardHolderIndent"); assertTrue("Test completed without Exception", true); }
@Test public void testDumpThrowsNullPointerException() throws Throwable { try { new CardHolder("k'X9|DH:!;uQ<kG8!P?- ,\"Y!u`r;jB^)>3AbS9,").dump(null, "testCardHolderIndent"); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { assertNull("ex.getMessage()", ex.getMessage()); } }