1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
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 | |
|
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 | |
} |