1 7 package org.jboss.test.remoting.detection.jndi; 8 9 import java.net.InetAddress ; 10 import org.apache.log4j.Level; 11 import org.jboss.jrunit.harness.TestDriver; 12 import org.jnp.server.Main; 13 14 23 public class JNDIDetectorTestCase extends TestDriver 24 { 25 26 30 public void declareTestClasses() 31 { 32 try 33 { 34 int port = 1099; 36 String host = InetAddress.getLocalHost().getHostName(); 38 Main JNDIServer = new Main(); 39 JNDIServer.setPort(port); 40 JNDIServer.setBindAddress(host); 41 JNDIServer.start(); 42 System.out.println("Started JNDI server on " + host + ":" + port); 43 44 addTestClasses(JNDIDetectorTest1.class.getName(), 45 1, 46 JNDIDetectorTest2.class.getName()); 47 } 48 catch(Exception e) 49 { 50 System.out.println("Error starting JNDI server."); 51 e.printStackTrace(); 52 } 53 } 54 55 protected Level getTestHarnessLogLevel() 56 { 57 return Level.DEBUG; 58 } 59 60 67 protected long getResultsTimeout() 68 { 69 return 300000; 70 } 71 72 78 protected long getTearDownTimeout() 79 { 80 return 300000; 81 } 82 83 89 protected long getRunTestTimeout() 90 { 91 return 300000; 92 } 93 } | Popular Tags |