Package junit.framework

Examples of junit.framework.TestCase


    }

    public static void main(String[] argv) {

        TestResult result = new TestResult();
        TestCase   testA  = new TestMultiInsert("testMultiInsert");

        testA.run(result);
        System.out.println("TestMultiInsert error count: " + result.failureCount());
        Enumeration e = result.failures();
        while(e.hasMoreElements()) System.out.println(e.nextElement());
    }
View Full Code Here


    }

    public static void main(String[] argv) {

        TestResult result = new TestResult();
        TestCase   testA  = new TestSql("testMetaData");
        TestCase   testB  = new TestSql("testDoubleNaN");
        TestCase   testC  = new TestSql("testAny");

        testA.run(result);
        testB.run(result);
        testC.run(result);
        System.out.println("TestSql error count: " + result.failureCount());
    }
View Full Code Here

    }

    public static void main(String[] argv) {

        TestResult result = new TestResult();
        TestCase   testA  = new TestMerge("testMerge1");
        TestCase   testB  = new TestMerge("testMerge2");
        TestCase   testC  = new TestMerge("testMerge3");
        TestCase   testD  = new TestMerge("testMerge4");
        TestCase   testE  = new TestMerge("testMerge5");
        TestCase   testF  = new TestMerge("testMerge6");
        TestCase   testG  = new TestMerge("testMerge7");
        TestCase   testH  = new TestMerge("testMerge8");
        TestCase   testI  = new TestMerge("testMerge9");

        testA.run(result);
        testB.run(result);
        testC.run(result);
        testD.run(result);
        testE.run(result);
        testF.run(result);
        testG.run(result);
        testH.run(result);
        testI.run(result);
        System.out.println("TestMerge error count: " + result.failureCount());

        Enumeration e = result.failures();

        while (e.hasMoreElements()) {
View Full Code Here

            final Class<? extends TransformerFactory> transformerFactoryClass) {

        for (final Class sbf : sourceBuilderFactories) {
            for (final Class rbf : resultBuilderFactories) {
                String testName = "test" + processorName + shortName(sbf) + shortName(rbf);
                suite.addTest(new TestCase(testName) {
                    @Override
                    public void runTest() throws Throwable {
                        String oldTransformerFactory =
                            TransformerFactory.newInstance().getClass().getName();
                        System.setProperty(TransformerFactory.class.getName(),
View Full Code Here

     * Test if proxy generation is omitted, if types are compatible.
     */
    public void testAvoidUnnecessaryProxy() {
        final MutablePicoContainer mpc = new DefaultPicoContainer();
        mpc.registerComponent(new AssimilatingComponentAdapter(TestCase.class, new InstanceComponentAdapter(TestCase.class, this)));
        final TestCase self = (TestCase) mpc.getComponentInstanceOfType(TestCase.class);
        assertFalse(Proxy.isProxyClass(self.getClass()));
        assertSame(this, self);
    }
View Full Code Here

     * Test if proxy generation is omitted, if types are compatible and that the component key is not changed.
     */
    public void testAvoidedProxyDoesNotChangeComponentKey() {
        final MutablePicoContainer mpc = new DefaultPicoContainer();
        mpc.registerComponent(new AssimilatingComponentAdapter(TestCase.class, new InstanceComponentAdapter(getClass(), this)));
        final TestCase self = (TestCase) mpc.getComponentInstance(getClass());
        assertNotNull(self);
        assertSame(this, self);
    }
View Full Code Here

      testClass.getTestMethodList().add(this);
    }
   
    private void init(Test test) {
      if(TestCase.class.isAssignableFrom(test.getClass())) {
        TestCase tc= (TestCase) test;

        m_methodName= tc.getName();
        m_signature= m_methodClass.getName() + "." + m_methodName + "()";
        try {
          m_method= test.getClass().getMethod(tc.getName(), new Class[0]);
        }
        catch(Exception ex) {
          throw new TestNGException("cannot retrieve JUnit method", ex);
        }
      }
View Full Code Here

            }
        } ) )
        {
            final String name = child.getName();

            suite.addTest( new TestCase( name + " [FO]" )
            {
                public void runTest() throws Exception
                {
                    testFo( child );
                }
            } );
            suite.addTest( new TestCase( name + " [HTML]" )
            {
                public void runTest() throws Exception
                {
                    testHtml( child );
                }
            } );
            suite.addTest( new TestCase( name + " [TEXT]" )
            {
                public void runTest() throws Exception
                {
                    testText( child );
                }
View Full Code Here

                return name.endsWith( ".xls" ) && !failingFiles.contains( name );
            }
        } ) )
        {
            final String name = child.getName();
            suite.addTest( new TestCase( name + " [FO]" )
            {
                @Override
                public void runTest() throws Exception
                {
                    testFo( child );
                }
            } );
            suite.addTest( new TestCase( name + " [HTML]" )
            {
                @Override
                public void runTest() throws Exception
                {
                    testHtml( child );
View Full Code Here

    return makeDescription(getTest());
  }

  private static Description makeDescription(Test test) {
    if (test instanceof TestCase) {
      TestCase tc= (TestCase) test;
      return Description.createTestDescription(tc.getClass(), tc.getName());
    } else if (test instanceof TestSuite) {
      TestSuite ts= (TestSuite) test;
      String name= ts.getName() == null ? createSuiteDescription(ts) : ts.getName();
      Description description= Description.createSuiteDescription(name);
      int n= ts.testCount();
View Full Code Here

TOP

Related Classes of junit.framework.TestCase

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.