Thread: [Batchserver-cvs] batchserver/test/org/jmonks/batchserver/framework/config PoolJobControllerConfigTe
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-03-10 01:28:31
|
Update of /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27419 Modified Files: BasicJobControllerConfigTest.java Added Files: PoolJobControllerConfigTest.java Log Message: no message Index: BasicJobControllerConfigTest.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/test/org/jmonks/batchserver/framework/config/BasicJobControllerConfigTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicJobControllerConfigTest.java 9 Mar 2006 04:42:55 -0000 1.1 --- BasicJobControllerConfigTest.java 10 Mar 2006 01:28:24 -0000 1.2 *************** *** 8,15 **** package org.jmonks.batchserver.framework.config; - import junit.framework.*; import java.util.HashMap; - import java.util.Iterator; import java.util.Map; /** --- 8,15 ---- package org.jmonks.batchserver.framework.config; import java.util.HashMap; import java.util.Map; + import junit.framework.*; + /** *************** *** 40,75 **** /** ! * Test of getBasicJobProcessorClassName method, of class org.jmonks.batchserver.framework.config.BasicJobControllerConfig. */ public void testGetBasicJobProcessorClassName() { } /** ! * Test of getBasicJobProcessorConfigProperties method, of class org.jmonks.batchserver.framework.config.BasicJobControllerConfig. */ public void testGetBasicJobProcessorConfigProperties() { } /** ! * Test of getJobControllerConfigPropertyPrefix method, of class org.jmonks.batchserver.framework.config.BasicJobControllerConfig. */ public void testGetJobControllerConfigPropertyPrefix() { } /** ! * Test of overrideConfigProperties method, of class org.jmonks.batchserver.framework.config.BasicJobControllerConfig. */ public void testOverrideConfigProperties() { - } - /** - * Test of toString method, of class org.jmonks.batchserver.framework.config.BasicJobControllerConfig. - */ - public void testToString() - { } --- 40,106 ---- /** ! * Test to make sure that controller config never returns null. */ public void testGetBasicJobProcessorClassName() { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); + assertNotNull(factoryConfig); + JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); + assertNotNull(factory); + JobConfig jobConfig=factory.getJobConfig("process_file_xyz"); + assertNotNull(jobConfig); + BasicJobControllerConfig controllerConfig=(BasicJobControllerConfig)jobConfig.getJobControllerConfig(); + assertNotNull(controllerConfig); + String jobProcessorName=controllerConfig.getBasicJobProcessorClassName(); + assertNotNull(jobProcessorName); } /** ! * Test to make sure that basic job processor config properties are not null. */ public void testGetBasicJobProcessorConfigProperties() { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); + assertNotNull(factoryConfig); + JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); + assertNotNull(factory); + JobConfig jobConfig=factory.getJobConfig("process_file_xyz"); + assertNotNull(jobConfig); + BasicJobControllerConfig controllerConfig=(BasicJobControllerConfig)jobConfig.getJobControllerConfig(); + assertNotNull(controllerConfig); + Map configProps=controllerConfig.getBasicJobProcessorConfigProperties(); + assertNotNull(configProps); } /** ! * Test case to make get prefix is not returning any null prefix. */ public void testGetJobControllerConfigPropertyPrefix() { + FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); + assertNotNull(frameworkConfig); + FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); + assertNotNull(factoryConfig); + JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); + assertNotNull(factory); + JobConfig jobConfig=factory.getJobConfig("process_file_xyz"); + assertNotNull(jobConfig); + BasicJobControllerConfig controllerConfig=(BasicJobControllerConfig)jobConfig.getJobControllerConfig(); + assertNotNull(controllerConfig); + String prefix=controllerConfig.getJobControllerConfigPropertyPrefix(); + assertNotNull(prefix); + assertTrue(!"".equals(prefix)); } /** ! * Test to make sure that properties being overriden. */ public void testOverrideConfigProperties() { } --- NEW FILE: PoolJobControllerConfigTest.java --- /* * PoolJobControllerConfigTest.java * JUnit based test * * Created on March 9, 2006, 6:59 PM */ package org.jmonks.batchserver.framework.config; import junit.framework.*; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * Test cases to test PoolJobControllerConfig class. * @author Suresh Pragada */ public class PoolJobControllerConfigTest extends TestCase { public PoolJobControllerConfigTest(String testName) { super(testName); } protected void setUp() throws Exception { } protected void tearDown() throws Exception { } public static Test suite() { TestSuite suite = new TestSuite(PoolJobControllerConfigTest.class); return suite; } /** * Test to make sure that it is not returning null loader class name. */ public void testGetPoolJobLoaderClassName() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); String loaderClassName=controllerConfig.getPoolJobLoaderClassName(); assertNotNull(loaderClassName); } /** * Test to make sure loader properties is not return null map. */ public void testGetPoolJobLoaderConfigProperties() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); Map configProps=controllerConfig.getPoolJobLoaderConfigProperties(); assertNotNull(configProps); } /** * Test to make sure that processor classname is not null. */ public void testGetPoolJobProcessorClassName() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); String processorClassName=controllerConfig.getPoolJobProcessorClassName(); assertNotNull(processorClassName); } /** * Test to make sure that it wont return null properties. */ public void testGetPoolJobProcessorConfigProperties() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); Map configProps=controllerConfig.getPoolJobProcessorConfigProperties(); assertNotNull(configProps); } /** * Test to make sure, it doesnt return null pool class name. */ public void testGetPoolClassName() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); String poolClassName=controllerConfig.getPoolClassName(); assertNotNull(poolClassName); } /** * Test to make sure pool config properities will not be null. */ public void testGetPoolConfigProperties() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); Map configProps=controllerConfig.getPoolConfigProperties(); assertNotNull(configProps); } /** * Test to make sure prefix will not be null. */ public void testGetJobControllerConfigPropertyPrefix() { FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); assertNotNull(frameworkConfig); FrameworkConfig.JobConfigFactoryConfig factoryConfig=frameworkConfig.getJobConfigFactoryConfig(); assertNotNull(factoryConfig); JobConfigFactory factory=JobConfigFactory.getJobConfigFactory(factoryConfig); assertNotNull(factory); JobConfig jobConfig=factory.getJobConfig("process_file_abc"); assertNotNull(jobConfig); PoolJobControllerConfig controllerConfig=(PoolJobControllerConfig)jobConfig.getJobControllerConfig(); assertNotNull(controllerConfig); String prefix=controllerConfig.getJobControllerConfigPropertyPrefix(); assertNotNull(prefix); assertTrue(!"".equals(prefix)); } /** * Test to make sure the new properties will be overriden. */ public void testOverrideConfigProperties() { } } |