New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



TestCase in java


Posted Date:     Total Responses: 0    Posted By: Mahesh   Member Level: Platinum   Points/Cash: 3   


import j2meunit.framework.AssertionFailedError;
import j2meunit.framework.Test;
import j2meunit.framework.TestCase;
import j2meunit.framework.TestFailure;
import j2meunit.framework.TestListener;
import j2meunit.framework.TestResult;

import j2meunit.util.StringUtil;
import j2meunit.util.Version;

import java.io.PrintStream;

import java.util.Enumeration;

package j2meunit.tests;

import j2meunit.framework.*;

public class TestTestCase extends TestCase
{
protected TF_TestCase testTestCase;
/**
* NullEnumerationTest constructor comment.
* @param name java.lang.String
*/
public TestTestCase()
{

}
/**
* Override to run the test and assert its state.
* @exception Throwable if any exception is thrown
*/
protected void runTest() throws java.lang.Throwable {
if (getName().equals("testSetupCalled"))
testSetupCalled();
else if (getName().equals("testTearDownCalled"))
testTearDownCalled();
else if (getName().equals("testTestRan"))
testTestRan();
}
protected void setUp()
{
testTestCase = new TF_TestCase("testOne");
testTestCase.run();
}
/**
* suite method comment.
*/
public j2meunit.framework.Test suite() {
return new TestSuite(new TestTestCase().getClass(), new String[] {"testSetupCalled", "testTearDownCalled", "testTestRan"});
}
protected void tearDown()
{
testTestCase = null;
}

public void testSetupCalled()
{
assertTrue("Setup should have been called.", testTestCase.getSetupCalled());
assertTrue("Setup should have been called first", testTestCase.isSetUPCalledFirst());
}

public void testTearDownCalled()
{
assertTrue("tearDown should have been called.", testTestCase.getTearDownCalled());
assertTrue("tearDown should have been called last", testTestCase.isTearDownCalledLast());
}

public void testTestRan()
{
assertTrue("The test should have been run.", testTestCase.getTestRun());
assertTrue("test should have been called after setup", testTestCase.isTestRunCalledAfterSetup());
}
}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: NullArityObjectOperation
Previous Project: ActionListener & FileIO

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.