1
2
3
4
5 package org.itracker.services.util;
6
7 import org.itracker.AbstractDependencyInjectionTest;
8 import org.junit.Test;
9
10 import javax.naming.InitialContext;
11 import javax.naming.NamingException;
12 import java.util.Hashtable;
13
14
15
16
17
18
19 public class NamingUtilitiesIT extends AbstractDependencyInjectionTest {
20
21 @Test
22 public void testGetStringValue() {
23 final Hashtable<String, String> hashtable = new Hashtable<String, String>();
24 hashtable.put("key", "value");
25 try {
26 final InitialContext context = new InitialContext(hashtable);
27 final String value = NamingUtilites.getStringValue(context, "key", "value");
28 assertEquals("value", value);
29 } catch (final NamingException e) {
30 assertTrue(e.getMessage(), false);
31 }
32 }
33
34
35
36
37
38
39 protected String[] getDataSetFiles() {
40 return new String[]{
41 "dataset/languagebean_dataset.xml"
42 };
43 }
44
45
46
47
48
49
50 protected String[] getConfigLocations() {
51 return new String[]{"application-context.xml"};
52 }
53 }