package nl.tudelft.simulation.dsol.naming; import java.util.Properties; import javax.naming.Context; import junit.framework.Test; import junit.framework.TestSuite; import nl.tudelft.simulation.naming.InitialEventContext; /** * Tests the NamingSuite. *
* (c) copyright 2002-2005 Delft University of Technology , the
* Netherlands.
* See for project information www.simulation.tudelft.nl
* License of use: Lesser General Public License (LGPL) , no
* warranty.
* @author Peter Jacobs
* @version 1.4 2004-04-08
* @since 1.5
*/
public final class NamingTestSuite
{
/**
* constructs a new NamingTestSuite.
*/
private NamingTestSuite()
{
super();
}
/**
* constructs the test suite.
* @return Test the main DSOL Test Suite
*/
public static Test suite()
{
TestSuite suite = new TestSuite("Naming Test Suite");
try
{
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "nl.tudelft.simulation.naming.JVMContextFactory");
Context context = new InitialEventContext(properties);
suite.addTest(new ContextTest(context));
properties.put("java.naming.factory.initial", "nl.tudelft.simulation.naming.FileContextFactory");
properties.put("java.naming.provider.url", "file:/tmp/context.jpo");
context = new InitialEventContext(properties);
suite.addTest(new ContextTest(context));
properties.put("java.naming.factory.initial", "nl.tudelft.simulation.naming.RemoteContextFactory");
properties.put("java.naming.provider.url", "http://localhost:1099/remoteContext");
properties.put("wrapped.naming.factory.initial", "nl.tudelft.simulation.naming.JVMContextFactory");
context = new InitialEventContext(properties);
suite.addTest(new ContextTest(context));
}
catch (Exception exception)
{
exception = null;
}
return suite;
}
}