[Ejtools-cvs] libraries/j2ee.deployment/src/test/test/enterprise/deploy/shared TypeTest.java,NONE,1.
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 10:50:52
|
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/test/test/enterprise/deploy/shared In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/test/test/enterprise/deploy/shared Added Files: TypeTest.java Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: TypeTest.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package test.enterprise.deploy.shared; import javax.enterprise.deploy.shared.ActionType; import javax.enterprise.deploy.shared.CommandType; import javax.enterprise.deploy.shared.DConfigBeanVersionType; import javax.enterprise.deploy.shared.ModuleType; import javax.enterprise.deploy.shared.StateType; import junit.framework.TestCase; /** * @author letiemble * @version $Revision: 1.1 $ */ public class TypeTest extends TestCase { /** Constructor for the TypeTest object */ public TypeTest() { super(); } /** * Constructor for the TypeTest object * * @param name Description of the Parameter */ public TypeTest(String name) { super(name); } /** A unit test for JUnit */ public void testActionType() { assertEquals("ActionType.EXECUTE value is not correct", ActionType.EXECUTE, ActionType.getActionType(0)); assertEquals("ActionType.EXECUTE value is not correct", ActionType.EXECUTE.getValue(), 0); assertEquals("ActionType.EXECUTE string is not correct", ActionType.EXECUTE.toString(), "execute"); assertEquals("ActionType.CANCEL value is not correct", ActionType.CANCEL, ActionType.getActionType(1)); assertEquals("ActionType.CANCEL value is not correct", ActionType.CANCEL.getValue(), 1); assertEquals("ActionType.CANCEL string is not correct", ActionType.CANCEL.toString(), "cancel"); assertEquals("ActionType.STOP value is not correct", ActionType.STOP, ActionType.getActionType(2)); assertEquals("ActionType.STOP value is not correct", ActionType.STOP.getValue(), 2); assertEquals("ActionType.STOP string is not correct", ActionType.STOP.toString(), "stop"); } /** A unit test for JUnit */ public void testDConfigBeanVersionType() { assertEquals("DConfigBeanVersionType.V1_3 value is not correct", DConfigBeanVersionType.V1_3, DConfigBeanVersionType.getDConfigBeanVersionType(0)); assertEquals("DConfigBeanVersionType.V1_3 value is not correct", DConfigBeanVersionType.V1_3.getValue(), 0); assertEquals("DConfigBeanVersionType.V1_3 string is not correct", DConfigBeanVersionType.V1_3.toString(), "V1_3"); assertEquals("DConfigBeanVersionType.V1_3_1 value is not correct", DConfigBeanVersionType.V1_3_1, DConfigBeanVersionType.getDConfigBeanVersionType(1)); assertEquals("DConfigBeanVersionType.V1_3_1 value is not correct", DConfigBeanVersionType.V1_3_1.getValue(), 1); assertEquals("DConfigBeanVersionType.V1_3_1 string is not correct", DConfigBeanVersionType.V1_3_1.toString(), "V1_3_1"); assertEquals("DConfigBeanVersionType.V1_4 value is not correct", DConfigBeanVersionType.V1_4, DConfigBeanVersionType.getDConfigBeanVersionType(2)); assertEquals("DConfigBeanVersionType.V1_4 value is not correct", DConfigBeanVersionType.V1_4.getValue(), 2); assertEquals("DConfigBeanVersionType.V1_4 string is not correct", DConfigBeanVersionType.V1_4.toString(), "V1_4"); } /** A unit test for JUnit */ public void testModuleType() { assertEquals("ModuleType.EAR value is not correct", ModuleType.EAR, ModuleType.getModuleType(0)); assertEquals("ModuleType.EAR value is not correct", ModuleType.EAR.getValue(), 0); assertEquals("ModuleType.EAR string is not correct", ModuleType.EAR.toString(), "EAR"); assertEquals("ModuleType.EAR extension is not correct", ModuleType.EAR.getModuleExtension(), "ear"); assertEquals("ModuleType.EJB value is not correct", ModuleType.EJB, ModuleType.getModuleType(1)); assertEquals("ModuleType.EJB value is not correct", ModuleType.EJB.getValue(), 1); assertEquals("ModuleType.EJB string is not correct", ModuleType.EJB.toString(), "EJB"); assertEquals("ModuleType.EJB extension is not correct", ModuleType.EJB.getModuleExtension(), "jar"); assertEquals("ModuleType.CAR value is not correct", ModuleType.CAR, ModuleType.getModuleType(2)); assertEquals("ModuleType.CAR value is not correct", ModuleType.CAR.getValue(), 2); assertEquals("ModuleType.CAR string is not correct", ModuleType.CAR.toString(), "CAR"); assertEquals("ModuleType.CAR extension is not correct", ModuleType.CAR.getModuleExtension(), "car"); assertEquals("ModuleType.RAR value is not correct", ModuleType.RAR, ModuleType.getModuleType(3)); assertEquals("ModuleType.RAR value is not correct", ModuleType.RAR.getValue(), 3); assertEquals("ModuleType.RAR string is not correct", ModuleType.RAR.toString(), "RAR"); assertEquals("ModuleType.RAR extension is not correct", ModuleType.RAR.getModuleExtension(), "rar"); assertEquals("ModuleType.WAR value is not correct", ModuleType.WAR, ModuleType.getModuleType(4)); assertEquals("ModuleType.WAR value is not correct", ModuleType.WAR.getValue(), 4); assertEquals("ModuleType.WAR string is not correct", ModuleType.WAR.toString(), "WAR"); assertEquals("ModuleType.WAR extension is not correct", ModuleType.WAR.getModuleExtension(), "war"); } /** A unit test for JUnit */ public void testStateType() { assertEquals("StateType.RUNNING value is not correct", StateType.RUNNING, StateType.getModuleType(0)); assertEquals("StateType.RUNNING value is not correct", StateType.RUNNING.getValue(), 0); assertEquals("StateType.RUNNING string is not correct", StateType.RUNNING.toString(), "running"); assertEquals("StateType.COMPLETED value is not correct", StateType.COMPLETED, StateType.getModuleType(1)); assertEquals("StateType.COMPLETED value is not correct", StateType.COMPLETED.getValue(), 1); assertEquals("StateType.COMPLETED string is not correct", StateType.COMPLETED.toString(), "completed"); assertEquals("StateType.FAILED value is not correct", StateType.FAILED, StateType.getModuleType(2)); assertEquals("StateType.FAILED value is not correct", StateType.FAILED.getValue(), 2); assertEquals("StateType.FAILED string is not correct", StateType.FAILED.toString(), "failed"); assertEquals("StateType.RELEASED value is not correct", StateType.RELEASED, StateType.getModuleType(3)); assertEquals("StateType.RELEASED value is not correct", StateType.RELEASED.getValue(), 3); assertEquals("StateType.RELEASED string is not correct", StateType.RELEASED.toString(), "released"); } /** A unit test for JUnit */ public void testcCommandType() { assertEquals("CommandType.DISTRIBUTE value is not correct", CommandType.DISTRIBUTE, CommandType.getCommandType(0)); assertEquals("CommandType.DISTRIBUTE value is not correct", CommandType.DISTRIBUTE.getValue(), 0); assertEquals("CommandType.DISTRIBUTE string is not correct", CommandType.DISTRIBUTE.toString(), "distribute"); assertEquals("CommandType.START value is not correct", CommandType.START, CommandType.getCommandType(1)); assertEquals("CommandType.START value is not correct", CommandType.START.getValue(), 1); assertEquals("CommandType.START string is not correct", CommandType.START.toString(), "start"); assertEquals("CommandType.STOP value is not correct", CommandType.STOP, CommandType.getCommandType(2)); assertEquals("CommandType.STOP value is not correct", CommandType.STOP.getValue(), 2); assertEquals("CommandType.STOP string is not correct", CommandType.STOP.toString(), "stop"); assertEquals("CommandType.UNDEPLOY value is not correct", CommandType.UNDEPLOY, CommandType.getCommandType(3)); assertEquals("CommandType.UNDEPLOY value is not correct", CommandType.UNDEPLOY.getValue(), 3); assertEquals("CommandType.UNDEPLOY string is not correct", CommandType.UNDEPLOY.toString(), "undeploy"); assertEquals("CommandType.REDEPLOY value is not correct", CommandType.REDEPLOY, CommandType.getCommandType(4)); assertEquals("CommandType.REDEPLOY value is not correct", CommandType.REDEPLOY.getValue(), 4); assertEquals("CommandType.REDEPLOY string is not correct", CommandType.REDEPLOY.toString(), "redeploy"); } } |