Package junit.framework

Examples of junit.framework.Test


    public static void main(String[] args) {
        TestRunner runner = new TestRunner();

        try {
            for (int i=0; i<50000; i++) {
                Test test = new JUnit4TestAdapter(MdcInjectionFilterTest.class);
                runner.doRun(test);
                System.out.println("i = " + i + " " + new Date());
            }
            System.out.println("done");
        } catch (Exception e) {
View Full Code Here


    test.add(factory.open(fileURI), (Resource) level, fileURI);
  }

  static private Test getTest(TestSuite s, String nm, String syntaxTestURI) {
    Enumeration already = s.tests();
    Test t;
    while (already.hasMoreElements()) {
      t = (Test) already.nextElement();
      if ((syntaxTestURI != null
        ? ((SyntaxTest) t).getName()
        : ((TestSuite) t).getName())
View Full Code Here

    @Override
    public void run(final TestResult result) {
        final ExecutorService exec = Executors.newFixedThreadPool(nthreads);
        final Enumeration<Test> tests = tests();
        while(tests.hasMoreElements()) {
            final Test test = tests.nextElement();
            exec.execute(new Runnable() {
                public void run() {
                    try {
                        test.run(result);
                    } catch (Throwable e) {
                        e.printStackTrace();
                    }
                }
            });
View Full Code Here

    public void execute(String testClassName) {
        TestDescriptorInternal testInternal = new DefaultTestClassDescriptor(idGenerator.generateId(), testClassName);
        resultProcessor.started(testInternal, new TestStartEvent(timeProvider.getCurrentTime()));

        Test adapter = createTest(testClassName);
        TestResult result = new TestResult();
        result.addListener(listener);
        adapter.run(result);

        resultProcessor.completed(testInternal.getId(), new TestCompleteEvent(timeProvider.getCurrentTime()));
    }
View Full Code Here

                // - set the report location
                final File report = new File(this.reportDirectory, this.project.getArtifactId() + ".txt");
                formatter.setReportFile(report);
                final TestResult result = new TestResult();
                result.addListener(formatter);
                final Test suite = CartridgeTest.suite();
                formatter.startTestSuite(this.project.getName());
                suite.run(result);
                this.getLog().info("");
                this.getLog().info("Results:");
                this.getLog().info(formatter.endTestSuite(suite));
                cartridgeTest.shutdown();
                if (result.failureCount() > 0 || result.errorCount() > 0)
View Full Code Here

     */
    public static Test suite(String serverHost, int serverPort)
    {
        System.out.println("*** TestPreStoppedSlaveServer.suite(serverHost,serverPort)");
    
        Test t = TestConfiguration.existingServerSuite(TestPreStoppedSlaveServer.class,false,serverHost,serverPort);
        System.out.println("*** Done TestConfiguration.existingServerSuite(TestPreStoppedSlaveServer.class,false,serverHost,serverPort)");
        return t;
   }
View Full Code Here

    private AbstractWysiwygTestCase getFirstWysiwygTest(Test test)
    {
        if (test instanceof TestSuite) {
            if (((TestSuite) test).tests().hasMoreElements()) {
                // Normally this should be the first one.
                Test currentTest = ((TestSuite) test).tests().nextElement();
                if (currentTest instanceof AbstractWysiwygTestCase) {
                    return (AbstractWysiwygTestCase) currentTest;
                }
            }
        } else if (test instanceof TestSetup) {
View Full Code Here

        TestSuite suite = new TestSuite("LDAPAuthenticationTest");
        suite.addTest(baseSuite("LDAPAuthenticationTest:embedded",
            "testLDAPConnection"));
        suite.addTest(TestConfiguration.clientServerDecorator(
            baseSuite("LDAPAuthenticationTest:client", "testLDAPConnection")));
        Test test = decorateWithPolicy(suite);
        return test;           
    }
View Full Code Here

        return test;           
    }

    public static Test baseSuite(String name, String fixture) {
        TestSuite suite = new TestSuite(name);
        Test test = new LDAPAuthenticationTest(fixture);
        setBaseProps(suite, test);

        // This test needs to run in a new single use database as we're setting
        // a number of properties
        return TestConfiguration.singleUseDatabaseDecorator(suite);
View Full Code Here

   // TestRunner overrides ------------------------------------------

   public Test getTest(String suiteClassName)
   {
      Test t = super.getTest(suiteClassName);
      if (methods.isEmpty())
      {
         return t;
      }
      else
View Full Code Here

TOP

Related Classes of junit.framework.Test

Copyright © 2018 www.massapicom. 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.