1 /*2 * Copyright (C) The Spice Group. All rights reserved.3 *4 * This software is published under the terms of the Spice5 * Software License version 1.1, a copy of which has been included6 * with this distribution in the LICENSE.txt file.7 */8 package org.codehaus.spice.jndikit.rmi.test;9 10 import java.util.Hashtable ;11 import javax.naming.NamingException ;12 13 import org.codehaus.spice.jndikit.DefaultNamespace;14 import org.codehaus.spice.jndikit.Namespace;15 import org.codehaus.spice.jndikit.rmi.RMIInitialContextFactory;16 import org.codehaus.spice.jndikit.test.TestObjectFactory;17 import org.codehaus.spice.jndikit.test.TestStateFactory;18 19 /**20 * Unit test for RMI context, using the {@link DefaultNamespace}.21 *22 * @author Tim Anderson23 * @version $Revision: 1.1 $24 */25 public class RMIContextDefaultNamespaceTestCase26 extends AbstractRMIContextTestCase27 {28 29 public RMIContextDefaultNamespaceTestCase()30 {31 super( new DefaultNamespaceICF() );32 }33 34 static class DefaultNamespaceICF35 extends RMIInitialContextFactory36 {37 38 protected Namespace newNamespace( final Hashtable environment )39 throws NamingException 40 {41 final DefaultNamespace namespace = ( DefaultNamespace ) super.newNamespace(42 environment );43 namespace.addObjectFactory( new TestObjectFactory() );44 namespace.addStateFactory( new TestStateFactory() );45 return namespace;46 }47 }48 }49