01: /*
02: * Created on Mar 5, 2005
03: *
04: */
05: package com.sun.portal.sra.admin.mbeans.tests;
06:
07: import com.sun.portal.sra.admin.mbeans.SraServer;
08: import com.sun.portal.log.common.PortalLogger;
09: import com.sun.portal.sra.admin.mbeans.SraServerFactory;
10: import com.sun.portal.sra.admin.mbeans.exceptions.CreateSraComponentException;
11: import com.sun.portal.sra.admin.mbeans.exceptions.NoSuchSraServerTypeException;
12: import junit.framework.TestCase;
13:
14: import java.util.Properties;
15:
16: /**
17: * @author Sandeep Soni
18: *
19: * To change the template for this generated type comment go to Window -
20: * Preferences - Java - Code Generation - Code and Comments
21: */
22: public class GatewayTestCase extends TestCase {
23: public static void main(String[] args) {
24: junit.textui.TestRunner.run(GatewayTestCase.class);
25: }
26:
27: /*
28: * @see TestCase#setUp()
29: */
30: protected void setUp() throws Exception {
31: super .setUp();
32: }
33:
34: /*
35: * @see TestCase#tearDown()
36: */
37: protected void tearDown() throws Exception {
38: super .tearDown();
39: }
40:
41: /**
42: * Constructor for GatewayTestCase.
43: *
44: * @param arg0
45: */
46: public GatewayTestCase(String arg0) {
47: super (arg0);
48: }
49:
50: public void testCreateInstance() throws Exception,
51: NoSuchSraServerTypeException {
52: Properties prop = new Properties();
53: SraServerFactory.createServerInstance(
54: SraServer.INSTANCE_TYPE_GATEWAY, prop, null);
55: }
56:
57: public void testStart() throws Exception {
58: SraServer gateway = SraServerFactory.getServerComponent(
59: SraServer.INSTANCE_TYPE_GATEWAY, "testinstance", null);
60: gateway.start();
61: }
62:
63: public void testStop() throws Exception {
64: SraServer gateway = SraServerFactory.getServerComponent(
65: SraServer.INSTANCE_TYPE_GATEWAY, "testinstance", null);
66: gateway.stop();
67: }
68:
69: public void testDeleteInstance() throws Exception,
70: NoSuchSraServerTypeException {
71: SraServerFactory.deleteServerInstance(
72: SraServer.INSTANCE_TYPE_GATEWAY, "testinstance", null);
73: }
74: }
|