[Batchserver-cvs] batchserver/test/org/jmonks/batchserver/framework MainTest.java, NONE, 1.1
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-09-05 21:49:11
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5213 Added Files: MainTest.java Log Message: no message --- NEW FILE: MainTest.java --- /* * MainTest.java * JUnit based test * * Created on September 5, 2006, 3:32 PM */ package org.jmonks.batchserver.framework; import java.util.HashMap; import java.util.Map; import junit.framework.*; /** * * @author w951h8m */ public class MainTest extends TestCase { public MainTest(String testName) { super(testName); } public static Test suite() { TestSuite suite = new TestSuite(MainTest.class); return suite; } /** * Test of process method by passing the empty configMap. */ public void testProcessNoArgs() { Map args=new HashMap(); ErrorCode returnCode=Main.process(args); assertNotNull(returnCode); int exitCode=returnCode.getCode(); assertEquals(ErrorCode.JOB_INVOKATION_CONFIGURAION_ERROR.getCode(), exitCode); } /** * Test of process method by passing the null configMap. */ public void testProcessNullArgs() { try { ErrorCode returnCode=Main.process(null); fail("Framework is accepting the null configMap"); } catch(IllegalArgumentException exception){} } /** * Test of process method by passing the wrong job name in config map. */ public void testProcessWrongJobName() { Map args=new HashMap(); args.put(Main.JOB_NAME_KEY_NAME, "NOT_AVAILABLE"); ErrorCode returnCode=Main.process(args); assertNotNull(returnCode); int exitCode=returnCode.getCode(); assertEquals(ErrorCode.JOB_IS_NOT_CONFIGURED.getCode(), exitCode); } } |