01: /*
02: * To change this template, choose Tools | Templates
03: * and open the template in the editor.
04: */
05:
06: package org.netbeans.modules.sun.manager.jbi.util;
07:
08: import java.io.File;
09: import java.net.URI;
10: import java.net.URISyntaxException;
11: import java.util.List;
12: import org.junit.After;
13: import org.junit.AfterClass;
14: import org.junit.Before;
15: import org.junit.BeforeClass;
16: import org.junit.Test;
17: import static org.junit.Assert.*;
18:
19: /**
20: *
21: * @author jqian
22: */
23: public class ServerInstanceReaderTest {
24:
25: public ServerInstanceReaderTest() {
26: }
27:
28: @BeforeClass
29: public static void setUpClass() throws Exception {
30: }
31:
32: @AfterClass
33: public static void tearDownClass() throws Exception {
34: }
35:
36: @Before
37: public void setUp() throws URISyntaxException {
38: }
39:
40: @After
41: public void tearDown() {
42: }
43:
44: /**
45: * Test of getServerInstances method, of class ServerInstanceReader.
46: */
47: @Test
48: public void getServerInstances() throws URISyntaxException {
49: System.out.println("getServerInstances");
50:
51: URI xmlURI = getClass().getResource("resources/nbattrs")
52: .toURI();
53: File xmlFile = new File(xmlURI);
54: ServerInstanceReader reader = new ServerInstanceReader(xmlFile
55: .getAbsolutePath());
56:
57: List<ServerInstance> result = reader.getServerInstances();
58: assertEquals(3, result.size());
59: }
60: }
|