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