Coverage Report - org.mule.tck.jndi.InMemoryContext
 
Classes in this File Line Coverage Branch Coverage Complexity
InMemoryContext
0%
0/39
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 3  
  * The software in this package is published under the terms of the CPAL v1.0
 4  
  * license, a copy of which has been included with this distribution in the
 5  
  * LICENSE.txt file.
 6  
  */
 7  
 package org.mule.tck.jndi;
 8  
 
 9  
 import java.util.HashMap;
 10  
 import java.util.Hashtable;
 11  
 import java.util.Map;
 12  
 
 13  
 import javax.naming.Context;
 14  
 import javax.naming.Name;
 15  
 import javax.naming.NameParser;
 16  
 import javax.naming.NamingEnumeration;
 17  
 import javax.naming.NamingException;
 18  
 
 19  
 /**
 20  
  * Simple in-memory JNDI context for unit testing.
 21  
  */
 22  0
 public class InMemoryContext implements Context
 23  
 {
 24  0
     private Map context = new HashMap();
 25  
 
 26  
     public Object lookup(Name name) throws NamingException
 27  
     {
 28  0
         return context.get(name);
 29  
     }
 30  
 
 31  
     public Object lookup(String name) throws NamingException
 32  
     {
 33  0
         return context.get(name);
 34  
     }
 35  
 
 36  
     public void bind(Name name, Object obj) throws NamingException
 37  
     {
 38  0
         context.put(name, obj);
 39  0
     }
 40  
 
 41  
     public void bind(String name, Object obj) throws NamingException
 42  
     {
 43  0
         context.put(name, obj);
 44  0
     }
 45  
 
 46  
     public void unbind(Name name) throws NamingException
 47  
     {
 48  0
         context.remove(name);
 49  0
     }
 50  
 
 51  
     public void unbind(String name) throws NamingException
 52  
     {
 53  0
         context.remove(name);
 54  0
     }
 55  
 
 56  
     public void rebind(Name name, Object obj) throws NamingException
 57  
     {
 58  0
         unbind(name);
 59  0
         bind(name, obj);
 60  0
     }
 61  
 
 62  
     public void rebind(String name, Object obj) throws NamingException
 63  
     {
 64  0
         unbind(name);
 65  0
         bind(name, obj);
 66  0
     }
 67  
 
 68  
     //////////////////////////////////////////////////////////////////////
 69  
     // The remaining methods are not implemented.
 70  
     //////////////////////////////////////////////////////////////////////
 71  
     
 72  
     public Object addToEnvironment(String propName, Object propVal) throws NamingException
 73  
     {
 74  0
         return null;
 75  
     }
 76  
 
 77  
     public void close() throws NamingException
 78  
     {
 79  
         // nop
 80  0
     }
 81  
 
 82  
     public Name composeName(Name name, Name prefix) throws NamingException
 83  
     {
 84  0
         return null;
 85  
     }
 86  
 
 87  
     public String composeName(String name, String prefix) throws NamingException
 88  
     {
 89  0
         return null;
 90  
     }
 91  
 
 92  
     public Context createSubcontext(Name name) throws NamingException
 93  
     {
 94  0
         return null;
 95  
     }
 96  
 
 97  
     public Context createSubcontext(String name) throws NamingException
 98  
     {
 99  0
         return null;
 100  
     }
 101  
 
 102  
     public void destroySubcontext(Name name) throws NamingException
 103  
     {
 104  
         // nop
 105  0
     }
 106  
 
 107  
     public void destroySubcontext(String name) throws NamingException
 108  
     {
 109  
         // nop
 110  0
     }
 111  
 
 112  
     public Hashtable getEnvironment() throws NamingException
 113  
     {
 114  0
         return null;
 115  
     }
 116  
 
 117  
     public String getNameInNamespace() throws NamingException
 118  
     {
 119  0
         return null;
 120  
     }
 121  
 
 122  
     public NameParser getNameParser(Name name) throws NamingException
 123  
     {
 124  0
         return null;
 125  
     }
 126  
 
 127  
     public NameParser getNameParser(String name) throws NamingException
 128  
     {
 129  0
         return null;
 130  
     }
 131  
 
 132  
     public NamingEnumeration list(Name name) throws NamingException
 133  
     {
 134  0
         return null;
 135  
     }
 136  
 
 137  
     public NamingEnumeration list(String name) throws NamingException
 138  
     {
 139  0
         return null;
 140  
     }
 141  
 
 142  
     public NamingEnumeration listBindings(Name name) throws NamingException
 143  
     {
 144  0
         return null;
 145  
     }
 146  
 
 147  
     public NamingEnumeration listBindings(String name) throws NamingException
 148  
     {
 149  0
         return null;
 150  
     }
 151  
 
 152  
     public Object lookupLink(Name name) throws NamingException
 153  
     {
 154  0
         return null;
 155  
     }
 156  
 
 157  
     public Object lookupLink(String name) throws NamingException
 158  
     {
 159  0
         return null;
 160  
     }
 161  
 
 162  
     public Object removeFromEnvironment(String propName) throws NamingException
 163  
     {
 164  0
         return null;
 165  
     }
 166  
 
 167  
     public void rename(Name oldName, Name newName) throws NamingException
 168  
     {
 169  
         // nop
 170  0
     }
 171  
 
 172  
     public void rename(String oldName, String newName) throws NamingException
 173  
     {
 174  
         // nop
 175  0
     }
 176  
 }
 177  
 
 178