01: /*
02: Copyright (C) 2007 Mobixess Inc. http://www.java-objects-database.com
03:
04: This file is part of the JODB (Java Objects Database) open source project.
05:
06: JODB is free software; you can redistribute it and/or modify it under
07: the terms of version 2 of the GNU General Public License as published
08: by the Free Software Foundation.
09:
10: JODB is distributed in the hope that it will be useful, but WITHOUT ANY
11: WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: for more details.
14:
15: You should have received a copy of the GNU General Public License along
16: with this program; if not, write to the Free Software Foundation, Inc.,
17: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package com.mobixess.jodb.tests.clientserver;
20:
21: import java.io.File;
22: import java.io.IOException;
23:
24: import com.mobixess.jodb.core.JODB;
25: import com.mobixess.jodb.core.JodbIOException;
26: import com.mobixess.jodb.core.io.IOTicket;
27: import com.mobixess.jodb.core.io.rmi.JODBIOBaseProxy;
28: import com.mobixess.jodb.tests.SimpleAddTest;
29:
30: public class StartServer {
31:
32: private static String TEST_DATA_DIR = "./testData/ClientServerTests/";
33: private static int _testCounter = 0;
34:
35: /**
36: * @param args
37: * @throws Exception
38: */
39: public static void main(String[] args) throws Exception {
40: serverStart();
41: runClient();
42: while (true) {
43:
44: }
45: }
46:
47: private static void serverStart() throws IOException {
48: File testFileDir = new File(TEST_DATA_DIR);
49: testFileDir.mkdirs();
50: File testFile = new File(testFileDir, SimpleAddTest.class
51: .getSimpleName()
52: + (_testCounter++) + ".jdb");
53: testFile.delete();
54: JODB.openServer(testFile);
55: }
56:
57: private static void runClient() throws Exception {
58: JODBIOBaseProxy baseProxy = new JODBIOBaseProxy(JODBIOBaseProxy
59: .composeURI("//localhost", null));
60: IOTicket ticket = baseProxy.getIOTicket(true, false);
61: System.err.println(" " + ticket);
62: }
63:
64: }
|