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  
  * $Id: TestContextFactory.java 20321 2010-11-24 15:21:24Z dfeist $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.tck.jndi;
 12  
 
 13  
 import org.mule.tck.testmodels.fruit.Apple;
 14  
 import org.mule.tck.testmodels.fruit.Banana;
 15  
 import org.mule.tck.testmodels.fruit.Orange;
 16  
 
 17  
 import java.util.Hashtable;
 18  
 
 19  
 import javax.naming.Context;
 20  
 import javax.naming.NamingException;
 21  
 
 22  
 /**
 23  
  * Creates an in-memory context and populates it with test data.
 24  
  */
 25  0
 public class TestContextFactory extends InMemoryContextFactory
 26  
 {
 27  
     public Context getInitialContext() throws NamingException
 28  
     {
 29  0
         Context context = super.getInitialContext();
 30  0
         populateTestData(context);
 31  0
         return context;
 32  
     }
 33  
 
 34  
     public Context getInitialContext(Hashtable environment) throws NamingException
 35  
     {
 36  0
         Context context = super.getInitialContext(environment);
 37  0
         populateTestData(context);
 38  0
         return context;
 39  
     }
 40  
     
 41  
     protected void populateTestData(Context context) throws NamingException
 42  
     {
 43  0
         context.bind("fruit/apple", new Apple());
 44  0
         context.bind("fruit/banana", new Banana());
 45  0
         context.bind("fruit/orange", new Orange(new Integer(8), new Double(10), "Florida Sunny"));
 46  0
     }
 47  
 }