public static void main(String[] args) { stat.addDescription("ejb-ejb30-hello-dcode"); Client client = new Client(args); client.doTest(); stat.printSummary("ejb-ejb30-hello-dcodeID"); }
public static void main(String args[]) { // The stat reporter writes out the test info and results // into the top-level quicklook directory during a run. stat.addDescription("http-listener reader-threads unit tests."); String host = args[0]; String portS = args[1]; String contextRoot = args[2]; int port = new Integer(portS).intValue(); String name; try { goGet(host, port, "FILTER", contextRoot + "/ServletTest"); } catch (Throwable t) { System.out.println(t.getMessage()); } if (count != EXPECTED_COUNT) { stat.addStatus("web-readerThreadsConfig", stat.FAIL); } stat.printSummary("web/standalonewar---> expect " + EXPECTED_COUNT); }
public static void main(String[] args) { boolean stateTaxIntendedResult = true; boolean fedTaxIntendedResult = true; if (args[0] == null || args[1] == null) { System.out.println( "TaxCal client: Argument missing. Please provide target" + "endpoint address as argument"); System.exit(1); } else { stateTaxEndpoint = args[0]; fedTaxEndpoint = args[1]; if (args.length > 2) { stateTaxIntendedResult = (new Boolean(args[2])).booleanValue(); fedTaxIntendedResult = (new Boolean(args[3])).booleanValue(); } } stat.addDescription("This is to test ejb based webservice"); try { TaxCalClient client = new TaxCalClient(); Context ic = new InitialContext(); taxCalService = (TaxCalEjbService) ic.lookup("java:comp/env/service/TaxCalEjbService"); client.callStateTaxService(stateTaxIntendedResult); client.callFedTaxService(fedTaxIntendedResult); } catch (Exception e) { e.printStackTrace(); } stat.printSummary(testSuite); }
public static void main(String[] args) throws Exception { int expectedCount = Integer.parseInt(args[0]); SimpleReporterAdapter stat = new SimpleReporterAdapter(); String testSuite = "rar-accesibility"; InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/SimpleSessionHome"); SimpleSessionHome simpleSessionHome = (SimpleSessionHome) javax.rmi.PortableRemoteObject.narrow(objRef, SimpleSessionHome.class); stat.addDescription("Running rar_accessibility connector test "); SimpleSession bean = simpleSessionHome.create(); try { if (bean.test1(expectedCount)) { stat.addStatus(testSuite + " test : ", stat.PASS); } else { stat.addStatus(testSuite + " test : ", stat.FAIL); } } catch (Exception e) { e.printStackTrace(); } stat.printSummary(); }
public static void main(String args[]) { // The stat reporter writes out the test info and results // into the top-level quicklook directory during a run. stat.addDescription("Unit test for IT 13555"); WebTest webTest = new WebTest(args); int port = new Integer(webTest.portS).intValue(); String name; try { webTest.goGet(webTest.host, port, webTest.contextRoot + "/test"); } catch (Throwable t) { System.out.println(t.getMessage()); stat.addStatus(" Test " + TEST_NAME + " UNPREDICTED-FAILURE", stat.FAIL); } finally { try { if (webTest.sock != null) { webTest.sock.close(); } } catch (IOException ioe) { // ignore } } stat.printSummary(TEST_NAME + " ---> PASS"); }
public static void main(String[] args) { stat.addDescription("txtests"); Client client = new Client(args); System.out.println("[txtests] doTest()..."); client.doTest(); System.out.println("[txtests] DONE doTest()..."); stat.printSummary("txtests"); }
public String doTest() { stat.addDescription("This is to test connector 1.5 " + "contracts."); String res = "NOT RUN"; debug("doTest() ENTER..."); boolean pass = false; try { try { InitialContext ic = new InitialContext(); System.out.println( "appclient lookup of java:app/jdbc/app-level-ds : " + ic.lookup("java:app/jdbc/app-level-ds")); } catch (Exception e) { e.printStackTrace(); } res = "ALL TESTS PASSED"; int testCount = 1; while (!done()) { notifyAndWait(); if (!done()) { debug("Running..."); pass = checkResults(expectedResults()); debug("Got expected results = " + pass); // do not continue if one test failed if (!pass) { res = "SOME TESTS FAILED"; stat.addStatus("ID Connector 1.6 test - " + testCount, stat.FAIL); } else { stat.addStatus("ID Connector 1.6 test - " + testCount, stat.PASS); } } else { break; } testCount++; } } catch (Exception ex) { System.out.println("Importing transaction test failed."); ex.printStackTrace(); res = "TEST FAILED"; } stat.printSummary("connector1.6ID"); debug("EXITING... STATUS = " + res); return res; }
public static void main(String[] args) { stat.addDescription("Unit test for resource injection into " + "ServletRequestListener"); WebTest webTest = new WebTest(args); try { webTest.doTest(); stat.addStatus(TEST_NAME, stat.PASS); } catch (Exception ex) { ex.printStackTrace(); stat.addStatus(TEST_NAME, stat.FAIL); } stat.printSummary(); }
public String doTest() { RpaRemote hr = null; String res = null; Context ic = null; LoginContext lc = null; RpaHome home = null; String testId = "Sec:: LDAP realm"; try { stat.addDescription("Security:: LDAP realm"); ic = new InitialContext(); // create EJB using factory from container java.lang.Object objref = ic.lookup("rpaLoginBean"); System.err.println("Looked up home!!"); home = (RpaHome) PortableRemoteObject.narrow(objref, RpaHome.class); System.err.println("Narrowed home!!"); hr = home.create("LizHurley"); System.out.println("Got the EJB!!"); // invoke 3 overloaded methods on the EJB System.out.println("Calling authorized method - addItem"); hr.addItem("lipstick", 30); hr.addItem("mascara", 40); hr.addItem("lipstick2", 50); hr.addItem("sandals", 200); System.out.println(hr.getTotalCost()); hr.deleteItem("lipstick2"); java.lang.String[] shoppingList = hr.getItems(); System.out.println("Shopping list for LizHurley"); for (int i = 0; i < shoppingList.length; i++) { System.out.println(shoppingList[i]); } System.out.println("Total Cost for Ms Hurley = " + hr.getTotalCost()); stat.addStatus(testId, stat.PASS); System.out.println("LDAP Realm:RpaLoginBean Test Passed"); } catch (Exception re) { re.printStackTrace(); stat.addStatus(testId, stat.FAIL); System.out.println("LDAP Realm:RpaLoginBean Test Failed"); System.exit(-1); } finally { stat.printSummary(); } return res; }
public static void main(String[] args) throws Exception { SimpleReporterAdapter stat = new SimpleReporterAdapter(); String testSuite = "StatementWrapper "; InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome"); SimpleBMPHome simpleBMPHome = (SimpleBMPHome) javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class); SimpleBMP simpleBMP = simpleBMPHome.create(); stat.addDescription("JDBC Statement Wrapper Tests"); if (simpleBMP.statementTest()) { stat.addStatus(testSuite + " statementTest : ", stat.PASS); } else { stat.addStatus(testSuite + " statementTest : ", stat.FAIL); } if (simpleBMP.preparedStatementTest()) { stat.addStatus(testSuite + " preparedStatementTest : ", stat.PASS); } else { stat.addStatus(testSuite + " preparedStatementTest : ", stat.FAIL); } if (simpleBMP.callableStatementTest()) { stat.addStatus(testSuite + " callableStatementTest : ", stat.PASS); } else { stat.addStatus(testSuite + " callableStatementTest : ", stat.FAIL); } if (simpleBMP.metaDataTest()) { stat.addStatus(testSuite + " metaDataTest : ", stat.PASS); } else { stat.addStatus(testSuite + " metaDataTest : ", stat.FAIL); } if (simpleBMP.resultSetTest()) { stat.addStatus(testSuite + " resultSetTest : ", stat.PASS); } else { stat.addStatus(testSuite + " resultSetTest : ", stat.FAIL); } stat.printSummary(); }
public static void main(String[] args) { stat.addDescription( "Unit test for ensuring binary compatibility " + "of GlassFish-style valves compiled against the old Valve " + "interface"); WebTest webTest = new WebTest(args); try { webTest.doTest(); stat.addStatus(TEST_NAME, stat.PASS); } catch (Exception ex) { ex.printStackTrace(); stat.addStatus(TEST_NAME, stat.FAIL); } stat.printSummary(); }
public static void main(String[] argv) throws Exception { SimpleReporterAdapter stat = new SimpleReporterAdapter(); String testSuite = "ReconfigMaxPoolSize "; InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome"); SimpleBMPHome simpleBMPHome = (SimpleBMPHome) javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class); SimpleBMP simpleBMP = simpleBMPHome.create(); stat.addDescription("Reconfig MaxPoolSize tests"); /* * Tests 1,2 use non-xa pool - so the 3rd param "useXA" is false * Tests 3,4 use xa pool - so the 3rd param "useXA" is true */ if ("1".equals(argv[0])) { if (simpleBMP.test1(10, true, false)) { stat.addStatus(testSuite + " test1 : ", stat.PASS); } else { stat.addStatus(testSuite + " test1 : ", stat.FAIL); } } else if ("2".equals(argv[0])) { if (simpleBMP.test1(19, false, false)) { stat.addStatus(testSuite + " test2 : ", stat.PASS); } else { stat.addStatus(testSuite + " test2 : ", stat.FAIL); } } else if ("3".equals(argv[0])) { if (simpleBMP.test1(10, false, true)) { stat.addStatus(testSuite + " test3 : ", stat.PASS); } else { stat.addStatus(testSuite + " test3 : ", stat.FAIL); } } else if ("4".equals(argv[0])) { if (simpleBMP.test1(19, false, true)) { stat.addStatus(testSuite + " test4 : ", stat.PASS); } else { stat.addStatus(testSuite + " test4 : ", stat.FAIL); } } System.out.println("jdbc reconfig-maxpoolsize status: "); stat.printSummary(); }
public static void main(String[] args) throws Exception { SimpleReporterAdapter stat = new SimpleReporterAdapter(); String testSuite = "notxconn"; InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/SimpleSessionHome"); SimpleSessionHome simpleSessionHome = (SimpleSessionHome) javax.rmi.PortableRemoteObject.narrow(objRef, SimpleSessionHome.class); stat.addDescription("Running notxops testSuite2 "); SimpleSession simpleSession = simpleSessionHome.create(); if (simpleSession.test1()) { stat.addStatus(testSuite + " test1 : ", stat.PASS); } else { stat.addStatus(testSuite + " test1 : ", stat.FAIL); } stat.printSummary(); }
public static void main(String[] args) { stat.addDescription("Unit test for CR 6716503"); WebTest webTest = new WebTest(args); try { if ("first".equals(webTest.run)) { TEST_NAME = TEST_ROOT_NAME + "-first"; webTest.firstRun(); } else { TEST_NAME = TEST_ROOT_NAME + "-second"; webTest.secondRun(); } } catch (Exception ex) { ex.printStackTrace(); stat.addStatus(TEST_NAME, stat.FAIL); } stat.printSummary(); }
public static void main(String[] args) { stat.addDescription("Unit test for IT 12891, 17377"); WebTest webTest = new WebTest(args); try { webTest.doTest("hello", 200); webTest.doTest("hello", 200); webTest.doTest("hello2", 500); webTest.doTest("hello2", 200); webTest.doTest("pages/test.jsp", 200); stat.addStatus(TEST_NAME, stat.PASS); } catch (Exception ex) { ex.printStackTrace(); stat.addStatus(TEST_NAME, stat.FAIL); } stat.printSummary(); }
public static void main(String args[]) { // The stat reporter writes out the test info and results // into the top-level quicklook directory during a run. stat.addDescription("Test BodyTag behavior when tag is reused"); String host = args[0]; String portS = args[1]; String contextRoot = args[2]; int port = new Integer(portS).intValue(); try { goGet(host, port, contextRoot + "/test.jsp"); stat.addStatus("BodyTag test", pass ? stat.PASS : stat.FAIL); } catch (Throwable t) { System.out.println(t.getMessage()); stat.addStatus("Test UNPREDICTED-FAILURE", stat.FAIL); } stat.printSummary("BodyTag Reuse"); }
public static void main(String[] args) { stat.addDescription(testId); TestClient client = new TestClient(); client.doTest(args); stat.printSummary(testId); }
public static void main(String[] args) { stat.addDescription("Unit test for Bugzilla 30067"); WebTest webTest = new WebTest(args); webTest.doTest(); stat.printSummary(); }
public static void main(String[] args) { stat.addDescription(testSuite); Client client = new Client(args); client.doTests(); stat.printSummary(); }
public static void main(String[] args) { stat.addDescription("Unit test for one session cookie header"); WebTest webTest = new WebTest(args); webTest.doTest(); stat.printSummary(TEST_NAME); }
public static void main(String[] args) { stat.addDescription("Unit test for jsp:attribute with omit"); WebTest webTest = new WebTest(args); webTest.doTest(); stat.printSummary(); }
public static void main(String[] args) { stat.addDescription("Unit test for @WebServlet"); WebTest webTest = new WebTest(args); webTest.doTest(); stat.printSummary(TEST_NAME); }
public static void main(String[] args) throws Exception { stat.addDescription("connection-factory-definitionclient-embedra"); Client client = new Client(args); client.doTestDD(); stat.printSummary("connection-factory-definitionclient-embedra"); }
public static void main(String[] args) throws Exception { SimpleReporterAdapter stat = new SimpleReporterAdapter(); String testSuite = "CustomValidation "; InitialContext ic = new InitialContext(); Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome"); SimpleBMPHome convalBMPHome = (SimpleBMPHome) javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class); SimpleBMP convalBMP = convalBMPHome.create(); stat.addDescription("Custom Validation Tests"); if (args != null && args.length > 0) { String param = args[0]; switch (Integer.parseInt(param)) { case 1: { if (convalBMP.test1()) { stat.addStatus(testSuite + "test-1 ", stat.PASS); } else { stat.addStatus(testSuite + "test-1 ", stat.FAIL); } break; } case 3: { if (convalBMP.test1()) { stat.addStatus(testSuite + "test-3 ", stat.PASS); System.out.println("test-3 returned true as validation is enabled "); } else { stat.addStatus(testSuite + "test-3 ", stat.FAIL); } break; } case 4: { if (convalBMP.test1()) { stat.addStatus(testSuite + "test-4 ", stat.PASS); System.out.println("test-4 returned true as validation is enabled "); } else { stat.addStatus(testSuite + "test-4 ", stat.FAIL); } break; } case 2: { try { if (convalBMP.test1()) { stat.addStatus(testSuite + "test-2 ", stat.FAIL); } else { stat.addStatus(testSuite + "test-2 ", stat.PASS); System.out.println("test-2 returned false as validation is not enabled "); } } catch (Exception e) { stat.addStatus(testSuite + "test1 ", stat.PASS); } break; } } stat.printSummary(); } }