1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.datacenter.deployed.vizier;
12
13 import java.io.IOException;
14 import java.rmi.RemoteException;
15 import javax.xml.parsers.ParserConfigurationException;
16 import junit.framework.TestCase;
17 import org.astrogrid.datacenter.impl.cds.sesame.SesameDelegate;
18 import org.w3c.dom.Document;
19 import org.xml.sax.SAXException;
20
21 /*** test that exercises methods of sesame delegate
22 * just tests that each doesn't return null for now. uncomment println statements to see what the service returns
23 * @author Noel Winstanley nw@jb.man.ac.uk 16-Oct-2003
24 *
25 */
26 public class SesameDelegateTest extends TestCase {
27
28 /***
29 * Constructor for SesameDelegateTest.
30 * @param arg0
31 */
32 public SesameDelegateTest(String arg0) {
33 super(arg0);
34 }
35
36 public static void main(String[] args) {
37 junit.textui.TestRunner.run(SesameDelegateTest.class);
38 }
39
40
41
42
43 protected void setUp() throws Exception {
44 ses = new SesameDelegate();
45 }
46
47 protected SesameDelegate ses;
48 public final static String NAME = "M51";
49 public final static String UNKNOWN = "fooble";
50
51 public void testResolveName() throws RemoteException {
52 String result = ses.resolveName(NAME);
53 assertNotNull(result);
54
55 }
56
57 public void testResolveUnknown() throws RemoteException {
58 String result = ses.resolveName(UNKNOWN);
59 assertNotNull(result);
60
61 }
62
63 public void testResolveNameXML() throws ParserConfigurationException, SAXException, IOException {
64 Document doc = ses.resolveNameToXML(NAME);
65 assertNotNull(doc);
66 }
67
68 public void testResolveUnknownXML() throws ParserConfigurationException, SAXException, IOException {
69 Document doc = ses.resolveNameToXML(UNKNOWN);
70 assertNotNull(doc);
71 }
72
73 public void testResolveNameHTML() throws RemoteException {
74 String result = ses.resolveNameToHTML(NAME);
75 assertNotNull(result);
76
77 }
78
79 public void testResolveUnknownHTML() throws RemoteException {
80 String result = ses.resolveNameToHTML(UNKNOWN);
81 assertNotNull(result);
82
83 }
84
85
86
87 }
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113