Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/mgmtmntr
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26152
Added Files:
JobStatusTest.java
Log Message:
no message
--- NEW FILE: JobStatusTest.java ---
/*
* JobStatusTest.java
* JUnit based test
*
* Created on March 21, 2006, 10:56 PM
*/
package org.jmonks.batchserver.framework.mgmtmntr;
import junit.framework.*;
/**
*
* @author Suresh Pragada
*/
public class JobStatusTest extends TestCase
{
public JobStatusTest(String testName)
{
super(testName);
}
protected void setUp() throws Exception
{
}
protected void tearDown() throws Exception
{
}
public static Test suite()
{
TestSuite suite = new TestSuite(JobStatusTest.class);
return suite;
}
/**
* Test to make sure Job Status cannot be instantiated.
*/
public void testInstantiation()
{
try
{
JobStatus status=(JobStatus)JobStatus.class.newInstance();
fail("JobStatus should not be instantiated.");
}
catch(InstantiationException ex)
{
/**
* This is expected as JobStatus cannot be instantiated.
*/
}
catch(IllegalAccessException ex)
{
/**
* This is expected as the constructor of JobStatus is private.
*/
}
}
/**
* Test to make sure toString is return the correct string.
*/
public void testToString()
{
String running=JobStatus.RUNNING.toString();
assertEquals("RUNNING",running);
}
/**
* Test to make sure equal is working properly.
*/
public void testEquals()
{
JobStatus running1=JobStatus.RUNNING;
JobStatus running2=JobStatus.RUNNING;
assertTrue(running1==running2);
assertTrue(running1.equals(running2));
}
}
|