Coverage Report - org.mule.tck.jndi.TestContextFactory
 
Classes in this File Line Coverage Branch Coverage Complexity
TestContextFactory
0%
0/11
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 org.mule.tck.testmodels.fruit.Apple;
 10  
 import org.mule.tck.testmodels.fruit.Banana;
 11  
 import org.mule.tck.testmodels.fruit.Orange;
 12  
 
 13  
 import java.util.Hashtable;
 14  
 
 15  
 import javax.naming.Context;
 16  
 import javax.naming.NamingException;
 17  
 
 18  
 /**
 19  
  * Creates an in-memory context and populates it with test data.
 20  
  */
 21  0
 public class TestContextFactory extends InMemoryContextFactory
 22  
 {
 23  
     public Context getInitialContext() throws NamingException
 24  
     {
 25  0
         Context context = super.getInitialContext();
 26  0
         populateTestData(context);
 27  0
         return context;
 28  
     }
 29  
 
 30  
     public Context getInitialContext(Hashtable environment) throws NamingException
 31  
     {
 32  0
         Context context = super.getInitialContext(environment);
 33  0
         populateTestData(context);
 34  0
         return context;
 35  
     }
 36  
     
 37  
     protected void populateTestData(Context context) throws NamingException
 38  
     {
 39  0
         context.bind("fruit/apple", new Apple());
 40  0
         context.bind("fruit/banana", new Banana());
 41  0
         context.bind("fruit/orange", new Orange(new Integer(8), new Double(10), "Florida Sunny"));
 42  0
     }
 43  
 }