From: kenstir Date: Sat, 5 Dec 2015 20:12:42 +0000 (-0500) Subject: Don't ignore osrf test directory, removed test sources that will never compile under... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f6c1db62464803c61aadf8af933c881ede6e99c7;p=working%2FEvergreen.git Don't ignore osrf test directory, removed test sources that will never compile under Android. --- diff --git a/Open-ILS/src/Android/core/core.iml b/Open-ILS/src/Android/core/core.iml index df63485834..ce7d091294 100644 --- a/Open-ILS/src/Android/core/core.iml +++ b/Open-ILS/src/Android/core/core.iml @@ -18,10 +18,9 @@ - - + diff --git a/Open-ILS/src/Android/cwmars_app/.idea/libraries/libs.xml b/Open-ILS/src/Android/cwmars_app/.idea/libraries/libs.xml deleted file mode 100644 index 2c6670d38c..0000000000 --- a/Open-ILS/src/Android/cwmars_app/.idea/libraries/libs.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/MathBench.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/MathBench.java deleted file mode 100644 index b6e67f953c..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/MathBench.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.opensrf.test; -import org.opensrf.*; -import org.opensrf.util.*; -import java.util.Date; -import java.util.List; -import java.util.ArrayList; -import java.io.PrintStream; - - -public class MathBench { - - public static void main(String args[]) throws Exception { - - PrintStream out = System.out; - - if(args.length < 2) { - out.println("usage: java org.opensrf.test.MathBench "); - return; - } - - /** connect to the opensrf network */ - Sys.bootstrapClient(args[0], "/config/opensrf"); - - /** how many iterations */ - int count = Integer.parseInt(args[1]); - - /** create the client session */ - ClientSession session = new ClientSession("opensrf.math"); - - /** params are 1,2 */ - List params = new ArrayList(); - params.add(new Integer(1)); - params.add(new Integer(2)); - - Request request; - Result result; - long start; - double total = 0; - - for(int i = 0; i < count; i++) { - - start = new Date().getTime(); - - /** create (and send) the request */ - request = session.request("add", params); - - /** wait up to 3 seconds for a response */ - result = request.recv(3000); - - /** collect the round-trip time */ - total += new Date().getTime() - start; - - if(result.getStatusCode() == Status.OK) { - out.print("+"); - } else { - out.println("\nrequest failed"); - out.println("status = " + result.getStatus()); - out.println("status code = " + result.getStatusCode()); - } - - /** remove this request from the session's request set */ - request.cleanup(); - - if((i+1) % 100 == 0) /** print 100 responses per line */ - out.println(" [" + (i+1) + "]"); - } - - out.println("\nAverage request time is " + (total/count) + " ms"); - - /** remove this session from the global session cache */ - session.cleanup(); - - /** disconnect from the opensrf network */ - Sys.shutdown(); - } -} - - - diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestCache.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestCache.java deleted file mode 100644 index d555444ccf..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestCache.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.opensrf.test; -import org.opensrf.util.Cache; - -public class TestCache { - public static void main(String args[]) throws Exception { - - /** - * args is a list of string like so: server:port server2:port server3:port ... - */ - - Cache.initCache(args); - Cache cache = new Cache(); - - cache.set("key1", "HI, MA!"); - cache.set("key2", "HI, MA! 2"); - cache.set("key3", "HI, MA! 3"); - - System.out.println("got key1 = " + (String) cache.get("key1")); - System.out.println("got key2 = " + (String) cache.get("key2")); - System.out.println("got key3 = " + (String) cache.get("key3")); - } -} - - diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestClient.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestClient.java deleted file mode 100644 index a1136cd719..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestClient.java +++ /dev/null @@ -1,80 +0,0 @@ -package org.opensrf.test; -import org.opensrf.*; -import org.opensrf.util.*; -import java.util.Map; -import java.util.Date; -import java.util.List; -import java.util.ArrayList; -import java.io.PrintStream; - -public class TestClient { - - public static void main(String args[]) throws Exception { - - /** which opensrf service are we sending our request to */ - String service; - /** which opensrf method we're calling */ - String method; - /** method params, captures from command-line args */ - List params; - /** knows how to read JSON */ - JSONReader reader; - /** opensrf request */ - Request request; - /** request result */ - Result result; - /** start time for the request */ - long start; - /** for brevity */ - PrintStream out = System.out; - - if(args.length < 3) { - out.println( "usage: org.opensrf.test.TestClient "+ - " [, ]"); - return; - } - - /** connect to the opensrf network, default config context - * for opensrf_core.xml is /config/opensrf */ - Sys.bootstrapClient(args[0], "/config/opensrf"); - - /* grab the server, method, and any params from the command line */ - service = args[1]; - method = args[2]; - params = new ArrayList(); - for(int i = 3; i < args.length; i++) - params.add(new JSONReader(args[i]).read()); - - - /** build the client session */ - ClientSession session = new ClientSession(service); - - /** kick off the timer */ - start = new Date().getTime(); - - /** Create the request object from the session, method and params */ - request = session.request(method, params); - - while( (result = request.recv(60000)) != null ) { - /** loop over the results and print the JSON version of the content */ - - if(result.getStatusCode() != 200) { - /** make sure the request succeeded */ - out.println("status = " + result.getStatus()); - out.println("status code = " + result.getStatusCode()); - continue; - } - - /** JSON-ify the resulting object and print it */ - out.println("\nresult JSON: " + new JSONWriter(result.getContent()).write()); - } - - /** How long did the request take? */ - out.println("Request round trip took: " + (new Date().getTime() - start) + " ms."); - - Sys.shutdown(); - } -} - - - diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestMultiSession.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestMultiSession.java deleted file mode 100644 index bb0f1a1c09..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestMultiSession.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.opensrf.test; -import org.opensrf.*; -import org.opensrf.util.*; - -public class TestMultiSession { - public static void main(String[] args) { - try { - String config = args[0]; - - Sys.bootstrapClient(config, "/config/opensrf"); - MultiSession ses = new MultiSession(); - - for(int i = 0; i < 40; i++) { - ses.request("opensrf.settings", "opensrf.system.time"); - } - - while(!ses.isComplete()) - System.out.println("result = " + ses.recv(5000) + " and id = " + ses.lastId()); - - System.out.println("done"); - Sys.shutdown(); - } catch(Exception e) { - e.printStackTrace(); - } - } -} diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestSettings.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestSettings.java deleted file mode 100644 index 116bbe1683..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestSettings.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.opensrf.test; -import org.opensrf.*; -import org.opensrf.util.*; - -public class TestSettings { - public static void main(String args[]) throws Exception { - Sys.bootstrapClient(args[0], "/config/opensrf"); - SettingsClient client = SettingsClient.instance(); - String lang = client.getString("/apps/opensrf.settings/language"); - String impl = client.getString("/apps/opensrf.settings/implementation"); - System.out.println("opensrf.settings language = " + lang); - System.out.println("opensrf.settings implementation = " + impl); - } -} diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestThread.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestThread.java deleted file mode 100644 index bb4cf067e9..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestThread.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.opensrf.test; -import org.opensrf.*; -import org.opensrf.util.*; -import java.util.Map; -import java.util.Date; -import java.util.List; -import java.util.ArrayList; -import java.io.PrintStream; - -/** - * Connects to the opensrf network once per thread and runs - * and runs a series of request acccross all launched threads. - * The purpose is to verify that the java threaded client api - * is functioning as expected - */ -public class TestThread implements Runnable { - - String args[]; - - public TestThread(String args[]) { - this.args = args; - } - - public void run() { - - try { - - Sys.bootstrapClient(args[0], "/config/opensrf"); - ClientSession session = new ClientSession(args[3]); - - List params = new ArrayList(); - for(int i = 5; i < args.length; i++) - params.add(new JSONReader(args[3]).read()); - - for(int i = 0; i < Integer.parseInt(args[2]); i++) { - System.out.println("thread " + Thread.currentThread().getId()+" sending request " + i); - Request request = session.request(args[4], params); - Result result = request.recv(3000); - if(result != null) { - System.out.println("thread " + Thread.currentThread().getId()+ - " got result JSON: " + new JSONWriter(result.getContent()).write()); - } else { - System.out.println("* thread " + Thread.currentThread().getId()+ " got NO result"); - } - } - - Sys.shutdown(); - } catch(Exception e) { - System.err.println(e); - } - } - - public static void main(String args[]) throws Exception { - - if(args.length < 5) { - System.out.println( "usage: org.opensrf.test.TestClient "+ - " [, ]"); - return; - } - - int numThreads = Integer.parseInt(args[1]); - for(int i = 0; i < numThreads; i++) - new Thread(new TestThread(args)).start(); - } -} - - - diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMLFlattener.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMLFlattener.java deleted file mode 100644 index c1fa394fef..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMLFlattener.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.opensrf.test; -import org.opensrf.util.XMLFlattener; -import java.io.FileInputStream; - -public class TestXMLFlattener { - public static void main(String args[]) throws Exception { - FileInputStream fis = new FileInputStream(args[0]); - XMLFlattener f = new XMLFlattener(fis); - System.out.println(f.read()); - } -} diff --git a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMPP.java b/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMPP.java deleted file mode 100644 index 2fba67fb8b..0000000000 --- a/Open-ILS/src/Android/opensrf/src/org/opensrf/test/TestXMPP.java +++ /dev/null @@ -1,63 +0,0 @@ -package org.opensrf.test; - -import org.opensrf.net.xmpp.XMPPReader; -import org.opensrf.net.xmpp.XMPPMessage; -import org.opensrf.net.xmpp.XMPPSession; - -public class TestXMPP { - - /** - * Connects to the jabber server and waits for inbound messages. - * If a recipient is provided, a small message is sent to the recipient. - */ - public static void main(String args[]) throws Exception { - - String host; - int port; - String username; - String password; - String resource; - String recipient; - - try { - host = args[0]; - port = Integer.parseInt(args[1]); - username = args[2]; - password = args[3]; - resource = args[4]; - - } catch(ArrayIndexOutOfBoundsException e) { - System.err.println("usage: org.opensrf.test.TestXMPP []"); - return; - } - - XMPPSession session = new XMPPSession(host, port); - session.connect(username, password, resource); - - XMPPMessage msg; - - if( args.length == 6 ) { - - /** they specified a recipient */ - - recipient = args[5]; - msg = new XMPPMessage(); - msg.setTo(recipient); - msg.setThread("test-thread"); - msg.setBody("Hello, from java-xmpp"); - System.out.println("Sending message to " + recipient); - session.send(msg); - } - - while(true) { - System.out.println("waiting for message..."); - msg = session.recv(-1); /* wait forever for a message to arrive */ - System.out.println("got message: " + msg.toXML()); - } - } -} - - - - -