|
1 |
| package org.jconfig.server; |
|
2 |
| |
|
3 |
| import java.io.InputStream; |
|
4 |
| |
|
5 |
| import junit.framework.TestCase; |
|
6 |
| |
|
7 |
| import org.jconfig.Configuration; |
|
8 |
| import org.jconfig.handler.ConfigServerHandler; |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| public class ExternalConfigServerTest extends TestCase { |
|
16 |
| |
|
17 |
| private static ConfigurationServer cs; |
|
18 |
| private static final String URL = "jconfig://r2d2:8765"; |
|
19 |
| |
|
20 |
0
| public ExternalConfigServerTest(String arg0) {
|
|
21 |
0
| super(arg0);
|
|
22 |
| } |
|
23 |
| |
|
24 |
0
| public void setUp() throws Exception {
|
|
25 |
| } |
|
26 |
| |
|
27 |
0
| public void testStartServer() {
|
|
28 |
0
| java.net.URL jcfURL = null;
|
|
29 |
0
| InputStream is = null;
|
|
30 |
0
| try {
|
|
31 |
0
| ConfigServerHandler urlHandler = new ConfigServerHandler();
|
|
32 |
0
| urlHandler.setURL(URL+"/config");
|
|
33 |
0
| Configuration config = urlHandler.load();
|
|
34 |
0
| assertNotNull(config);
|
|
35 |
0
| assertEquals("dice",config.getProperty("USER",null,"JDBC"));
|
|
36 |
| } |
|
37 |
| catch ( Exception e ) { |
|
38 |
0
| e.printStackTrace();
|
|
39 |
| } |
|
40 |
| } |
|
41 |
| } |