1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
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 | |
|
24 | |
|
25 | 8 | 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 | 8 | Context context = super.getInitialContext(environment); |
37 | 8 | populateTestData(context); |
38 | 8 | return context; |
39 | |
} |
40 | |
|
41 | |
protected void populateTestData(Context context) throws NamingException |
42 | |
{ |
43 | 8 | context.bind("fruit/apple", new Apple()); |
44 | 8 | context.bind("fruit/banana", new Banana()); |
45 | 8 | context.bind("fruit/orange", new Orange(new Integer(8), new Double(10), "Florida Sunny")); |
46 | 8 | } |
47 | |
} |