KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joseki > test > TestServer


1 /*
2  * (c) Copyright 2004, Hewlett-Packard Development Company, LP
3  * All rights reserved.
4  * [See end of file]
5  */

6
7 package org.joseki.test;
8
9 import org.joseki.server.*;
10
11 /** org.joseki.test.TestServer
12  *
13  * @author Andy Seaborne
14  * @version $Id: TestServer.java,v 1.1 2004/04/30 08:01:51 andy_seaborne Exp $
15  */

16
17 public class TestServer
18 {
19     public int port = 9990 ;
20     String JavaDoc baseURI = "http://localhost:"+port+"/" ;
21     String JavaDoc testdata_URI = baseURI+"testdata" ;
22     String JavaDoc testdata2_URI = baseURI+"testdata2" ;
23
24     String JavaDoc noSuchModelURI = baseURI+"noSuchModel" ;
25     String JavaDoc scratchModelURI = baseURI+"scratch" ;
26     String JavaDoc emptyModelURI = baseURI+"empty" ;
27     String JavaDoc infModelURI = baseURI+"inf" ;
28     String JavaDoc fetchModelURI = baseURI+"fetch-1" ;
29     
30     RDFServer server = null ;
31
32     void createServer()
33     {
34         try {
35             server = new RDFServer("etc/joseki-junit.n3", port) ;
36             server.start() ;
37         } catch (ConfigurationErrorException confEx)
38         {
39             System.err.println("Configuration error: "+confEx.getMessage()) ;
40             //confEx.printStackTrace(System.err) ;
41
server = null ;
42             return ;
43         }
44     }
45     
46     void destroyServer()
47     {
48         server.stop() ;
49         server = null ;
50     }
51     
52 }
53
54 /*
55  * (c) Copyright 2004 Hewlett-Packard Development Company, LP
56  * All rights reserved.
57  *
58  * Redistribution and use in source and binary forms, with or without
59  * modification, are permitted provided that the following conditions
60  * are met:
61  * 1. Redistributions of source code must retain the above copyright
62  * notice, this list of conditions and the following disclaimer.
63  * 2. Redistributions in binary form must reproduce the above copyright
64  * notice, this list of conditions and the following disclaimer in the
65  * documentation and/or other materials provided with the distribution.
66  * 3. The name of the author may not be used to endorse or promote products
67  * derived from this software without specific prior written permission.
68  *
69  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
70  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
71  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
72  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
73  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
74  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
75  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
76  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
77  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
78  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
79  */
Popular Tags