View Javadoc
1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
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  // TODO: Add Javadocs here: what is the purpose of this class?
17  
18  /**
19   * @author seas
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       * Defines a set of datafiles to be uploaded into database.
38       *
39       * @return an array with datafiles.
40       */
41      protected String[] getDataSetFiles() {
42          return new String[]{
43                  "dataset/languagebean_dataset.xml"
44          };
45      }
46  
47  }