KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > spice > jndikit > memory > test > AbstractMemoryContextTestCase


1 /*
2  * Copyright (C) The Spice Group. All rights reserved.
3  *
4  * This software is published under the terms of the Spice
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.spice.jndikit.memory.test;
9
10 import javax.naming.NamingException JavaDoc;
11 import javax.naming.OperationNotSupportedException JavaDoc;
12
13 import junit.framework.AssertionFailedError;
14 import org.codehaus.spice.jndikit.StandardNamespace;
15 import org.codehaus.spice.jndikit.test.AbstractContextTestCase;
16
17 /**
18  * Unit test for Memory context, using the {@link StandardNamespace}. ,
19  *
20  * @author Tim Anderson
21  * @version $Revision: 1.1 $
22  */

23 public abstract class AbstractMemoryContextTestCase
24     extends AbstractContextTestCase
25 {
26
27     public void testGetNameInNamespace() throws AssertionFailedError
28     {
29         try
30         {
31             String JavaDoc name = m_context.getNameInNamespace();
32             fail( "Expected getNameInNamespace to throw OperationNotSupportedException but returned "
33                   + name );
34         }
35         catch( final OperationNotSupportedException JavaDoc expected )
36         {
37         }
38         catch( final NamingException JavaDoc ne )
39         {
40             throw new AssertionFailedError( ne.getMessage() );
41         }
42     }
43 }
44
Popular Tags