Examples of TestCase


Examples of jp.vmi.selenium.selenese.TestCase

        String s1name = "suite1";
        TestSuite s1 = Binder.newTestSuite(filename(root, s1name), s1name, runner);
        String s2name = "suite2";
        TestSuite s2 = Binder.newTestSuite(filename(root, s2name), s2name, runner);
        String c1name = "case1";
        TestCase c1 = Binder.newTestCase(filename(root, c1name), c1name, runner, "http://localhost");
        c1.addCommand(cf.newCommand(0, "echo", "c1"));
        String c2name = "case2";
        TestCase c2 = Binder.newTestCase(filename(root, c2name), c2name, runner, "http://localhost");
        c2.addCommand(cf.newCommand(0, "echo", "c2"));
        s2.addSelenese(c2);
        s1.addSelenese(c1);
        s1.addSelenese(s2);
        runner.setHtmlResultDir(root.getPath());
        s1.execute(null, runner);
View Full Code Here

Examples of junit.framework.TestCase

  static public Test suite() {
    TestSuite s = new TestSuite("TimedTest");
    s.addTest(WGTests.suite());
    final long startTime[] = new long[1];
    s.addTest(new TestCase("start timer") {
      public void runTest() {
        startTime[0] = System.currentTimeMillis();
      }
    });
    WGTests.doLargeTests = true;
    s.addTest(WGTests.suite());
    s.addTest(new TestCase("end timer") {
      public void runTest() {
        System.err.println(
(        System.currentTimeMillis() - startTime[0])
+ " ms");
      }
View Full Code Here

Examples of junit.framework.TestCase

      this.methods = new ArrayList(methods);
      this.methods.add("warning");

      for(Enumeration e = original.tests(); e.hasMoreElements();)
      {
         TestCase tc = (TestCase)e.nextElement();
         if (methods.contains(tc.getName()))
         {
            tests.add(tc);
         }
      }

      if (tests.isEmpty())
      {
         tests.add(new TestCase("warning")
         {
            protected void runTest()
            {
               fail("The SelectiveTestSuite did not select any test.");
            }
View Full Code Here

Examples of junit.framework.TestCase

                        Attr att = (Attr) atts.item(j);
                        configParams.put(att.getName(), att.getValue());
                    }
                }
                if (n.getNodeName().equals("testcase")) {
                    TestCase tc = createTestCaseFromNode((Element) n);
                    addTest(tc);
                }
            }
        }
    }
View Full Code Here

Examples of junit.framework.TestCase

  private static Method extractMethod(Test test) {
    if (test instanceof AbstractTester) {
      AbstractTester<?> tester = (AbstractTester<?>) test;
      return Platform.getMethod(tester.getClass(), tester.getTestMethodName());
    } else if (test instanceof TestCase) {
      TestCase testCase = (TestCase) test;
      return Platform.getMethod(testCase.getClass(), testCase.getName());
    } else {
      throw new IllegalArgumentException(
          "unable to extract method from test: not a TestCase.");
    }
  }
View Full Code Here

Examples of junit.framework.TestCase

        
         // get the external tests
         Enumeration<TestCase> e = getTests();
         while(e.hasMoreElements())
         {
            TestCase t = e.nextElement();
            // run the external test
            result.runProtected(this, getProctectable(t));
         }

         // run the test case as usual
         super.run(result);

         //
         e = getTests();
         while(e.hasMoreElements())
         {
            TestCase t = e.nextElement();
            // run the external test again
            result.runProtected(this, getProctectable(t));
         }
      }
      catch(Exception e)
View Full Code Here

Examples of junit.framework.TestCase

      while(testCases.hasMoreElements())
      {
         Test t = testCases.nextElement();
         if (t instanceof TestCase)
         {
            TestCase tc = (TestCase)t;
            if(!excludes.contains(tc.getName()))
               filtered.add(tc);
         }
      }
      return Collections.enumeration(filtered);
   }
View Full Code Here

Examples of junit.framework.TestCase

}
   
    /** Bootstrap for the self-test code.
     */
    public static void main( String[] argc ) throws Exception {
        TestCase test = new TestJspTaglibs( "test-jsptaglibs.txt" );
        test.run();
    }
View Full Code Here

Examples of junit.framework.TestCase

     */
    public static Test suite() {
        final TrackEnumerationTestSuite suite = new TrackEnumerationTestSuite();
        final RandomSelectionTest test = new RandomSelectionTest("Random",
                suite.copyDir);
        suite.addTest(new TestCase("Setup") {
            protected void runTest() throws Throwable {
                suite.initialize();
                test.dir = suite.copyDir;
            }
        });
        suite.addTest(test);
        suite.addTest(new OfFunctionTest(suite));
        suite.addTest(new SaveRunTest(suite));
        suite.addTest(new TestCase("Delete") {
            protected void runTest() throws Throwable {
                Assert.assertTrue("Delete copy "
                        + suite.copyDir.getAbsolutePath(), Utils
                        .deleteDirectory(suite.copyDir));
            }
View Full Code Here

Examples of junit.framework.TestCase

        return fileNames;
    }

    private static TestCase createTestCase(HttpTestContainer container, HttpTestEntry entry) {
        final HttpTestRunner runner = new HttpTestRunner(container, entry);
        return new TestCase(entry.getName()) {
            protected void setUp() throws Exception {
                runner.setUp();
            }

            @Override
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.