View Javadoc

1   /*$Id: SesameDelegateTest.java,v 1.1 2004/11/03 05:20:50 mch Exp $
2    * Created on 16-Oct-2003
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid
7    * Software License version 1.2, a copy of which has been included
8    * with this distribution in the LICENSE.txt file.
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       * @see TestCase#setUp()
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      //    System.out.println(result);
55      }
56      
57      public void testResolveUnknown() throws RemoteException {
58          String result = ses.resolveName(UNKNOWN);
59          assertNotNull(result);
60    //      System.out.println(result);
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  //        System.out.println(result);
77      }
78      
79      public void testResolveUnknownHTML() throws RemoteException {
80          String result = ses.resolveNameToHTML(UNKNOWN);
81          assertNotNull(result);
82        //  System.out.println(result);
83      }
84  
85  
86  
87  }
88  
89  
90  /*
91  $Log: SesameDelegateTest.java,v $
92  Revision 1.1  2004/11/03 05:20:50  mch
93  Moved datacenter deployment tests out of standard tests
94  
95  Revision 1.1.2.1  2004/11/02 21:51:03  mch
96  Moved deployment tests here - not exactly right either
97  
98  Revision 1.2  2004/10/05 17:08:22  mch
99  Fixed package names and imports
100 
101 Revision 1.1  2004/10/05 17:06:53  mch
102 Moved service implementation tests from unit tests to integration tests
103 
104 Revision 1.2  2003/11/20 15:47:18  nw
105 improved testing
106 
107 Revision 1.1  2003/11/18 11:23:49  nw
108 mavenized cds delegate
109 
110 Revision 1.1  2003/10/16 10:11:45  nw
111 first check in
112  
113 */