1 19 20 package org.netbeans.modules.test.serverplugins.glassfish; 21 22 import org.netbeans.modules.test.serverplugins.jboss.*; 23 import org.netbeans.junit.NbTestSuite; 24 import org.netbeans.modules.test.serverplugins.api.ConstantsProvider; 25 import org.netbeans.modules.test.serverplugins.api.ServerProvider; 26 import org.netbeans.modules.test.serverplugins.generic.GenericInstanceTest; 27 import org.netbeans.modules.test.serverplugins.generic.GenericRunTest; 28 import org.netbeans.modules.test.serverplugins.generic.GenericTestSuite; 29 import org.netbeans.modules.test.serverplugins.jboss.JBossServerProvider; 30 import org.openide.util.NbBundle; 31 32 37 public class GlassfishTestSuite extends GenericTestSuite { 38 39 private static GlassfishConstantsProvider cProvider; 40 private static GlassfishServerProvider sProvider; 41 42 private GlassfishTestSuite(String name) { 43 super(name); 44 } 45 46 51 public static NbTestSuite suite() { 52 GlassfishTestSuite suite = new GlassfishTestSuite(NbBundle.getMessage(GlassfishTestSuite.class, "SUITE_NAME")); 54 55 suite.addTest(new GenericInstanceTest("addInstanceTest", 57 suite.getConstantsProvider(), suite.getServerProvider())); 58 suite.addTest(new GenericRunTest("startServerTest", 59 suite.getConstantsProvider(), suite.getServerProvider())); 60 suite.addTest(new GenericRunTest("stopServerTest", 61 suite.getConstantsProvider(), suite.getServerProvider())); 62 suite.addTest(new GenericRunTest("startDebugServerTest", 63 suite.getConstantsProvider(), suite.getServerProvider())); 64 suite.addTest(new GenericRunTest("stopServerTest", 65 suite.getConstantsProvider(), suite.getServerProvider())); 66 suite.addTest(new GenericInstanceTest("removeInstanceTest", 67 suite.getConstantsProvider(), suite.getServerProvider())); 68 69 return suite; 70 } 71 72 public synchronized ConstantsProvider getConstantsProvider() { 73 if (null == cProvider) 74 cProvider = new GlassfishConstantsProvider(); 75 76 return cProvider; 77 } 78 79 public synchronized ServerProvider getServerProvider() { 80 if (null == sProvider) 81 sProvider = new GlassfishServerProvider((GlassfishConstantsProvider) getConstantsProvider()); 82 83 return sProvider; 84 } 85 } | Popular Tags |