1 19 20 package org.netbeans.modules.j2ee.sun.test; 21 22 import java.io.File ; 23 import javax.enterprise.deploy.spi.DeploymentManager ; 24 import org.netbeans.junit.NbTestCase; 25 import org.netbeans.junit.NbTestSuite; 26 import org.netbeans.modules.j2ee.deployment.impl.ServerInstance; 27 import org.netbeans.modules.j2ee.deployment.impl.ServerRegistry; 28 import org.netbeans.modules.j2ee.sun.ide.j2ee.DomainEditor; 29 import org.netbeans.modules.j2ee.sun.ide.j2ee.HttpProxyUpdater; 30 import org.netbeans.modules.j2ee.sun.ide.j2ee.ui.AddDomainWizardIterator; 31 import org.openide.WizardDescriptor; 32 import org.openide.WizardDescriptor.Panel; 33 import org.w3c.dom.Document ; 34 35 39 public class DomainEditorTest extends NbTestCase { 40 41 private final int SLEEP = 10000; 42 43 public DomainEditorTest(String testName) { 44 super(testName); 45 } 46 47 public void poundOnEditor() { 48 ServerInstance inst = ServerRegistry.getInstance().getServerInstance(Util._URL); 49 DeploymentManager dm = inst.getDeploymentManager(); 50 DomainEditor de = new DomainEditor(dm); 51 52 String loc = de.getDomainLocation(); 53 Document doc = de.getDomainDocument(); 54 Document doc2 = de.getDomainDocument(loc); 55 de.addProfilerElements(doc,"/foo/bar/bas", new String [] { "aaaaaaaaaa", "bbbbbbbbbb", "ccccccccccc"}); 56 de.removeProfilerElements(doc); 57 String oldProxyValues[] = de.getHttpProxyOptions(); 58 String foo[] = new String [] { 59 HttpProxyUpdater.HTTPS_PROXY_HOST+"yyyyyyyyy", 60 HttpProxyUpdater.HTTP_PROXY_HOST+"zzzzzzzzz" }; 61 de.setHttpProxyOptions(foo); 62 String tmp[] = de.getHttpProxyOptions(); 63 de.setHttpProxyOptions(oldProxyValues); 64 if (tmp == null || tmp.length != 2) { 65 fail("not right length"); 66 } 67 if (!foo[0].equals(tmp[0]) && !foo[0].equals(tmp[1])) { 68 fail(foo[0]); 69 } 70 if (!foo[1].equals(tmp[0]) && !foo[1].equals(tmp[1])) { 71 fail(foo[1]); 72 } 73 de.getSunDatasourcesFromXml(); 74 de.getConnPoolsFromXml(); 75 76 } 77 public static NbTestSuite suite() { 78 NbTestSuite suite = new NbTestSuite("DomainEditorTest"); 79 suite.addTest(new AddRemoveSjsasInstanceTest("addSjsasInstance")); 80 suite.addTest(new DomainEditorTest("poundOnEditor")); 81 suite.addTest(new AddRemoveSjsasInstanceTest("removeSjsasInstance")); 82 return suite; 83 } 84 } | Popular Tags |