Revision: 44171 http://brlcad.svn.sourceforge.net/brlcad/?rev=44171&view=rev Author: davidloman Date: 2011-04-04 10:51:42 +0000 (Mon, 04 Apr 2011)
Log Message: ----------- Add in some tests and research. These were created some time ago but were never committed. Added Paths: ----------- geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/LoginTest.java geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/SerialTest.java geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/UUIDSerialResearch.java Added: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/LoginTest.java =================================================================== --- geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/LoginTest.java (rev 0) +++ geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/LoginTest.java 2011-04-04 10:51:42 UTC (rev 44171) @@ -0,0 +1,49 @@ +/* + * BRL-CAD + * + * Copyright (c) 2011 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file LoginTest.java + * + */ +package org.brlcad.geometryservice; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +/** + * @author dloman + * + */ +public class LoginTest { + + public static void main(String[] args) throws UnknownHostException, InterruptedException { + + GSJavaInterface inter = new GSJavaInterface(); + + boolean success = inter.connectToHost(InetAddress.getByName("127.0.0.1"), (short)5309, "Guest", "Guest"); + + System.out.println("Success? " + success); + Thread.sleep(1000); + + inter.disconnectFromHost(); + Thread.sleep(1000); + + System.out.println("Done."); + } + +} Property changes on: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/LoginTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/SerialTest.java =================================================================== --- geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/SerialTest.java (rev 0) +++ geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/SerialTest.java 2011-04-04 10:51:42 UTC (rev 44171) @@ -0,0 +1,65 @@ +/* + * BRL-CAD + * + * Copyright (c) 2011 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file SerialTest.java + * + */ +package org.brlcad.geometryservice; + +import java.nio.ByteBuffer; + +import org.brlcad.geometryservice.net.ByteBufferWriter; +import org.brlcad.geometryservice.net.msg.NewSessionReqMsg; + +/** + * @author dloman + * + */ +public class SerialTest { + + /** + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + + NewSessionReqMsg msg = new NewSessionReqMsg("Guest", "Guest"); + + ByteBuffer bb = ByteBuffer.allocate(1024*1024); + ByteBufferWriter wr = new ByteBufferWriter(bb); + + msg.serialize(wr); + + String out = ""; + byte[] ba = bb.array(); + for (int i = 0 ; i < wr.position(); ++i) { + byte b = ba[i]; + String c = Integer.toString(b & 0xff, 16).toUpperCase(); + if (c.length() == 1) + c = "0" + c; + + out += c; + } + + System.out.println("Data: " + out); + + + } + +} Property changes on: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/SerialTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/UUIDSerialResearch.java =================================================================== --- geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/UUIDSerialResearch.java (rev 0) +++ geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/UUIDSerialResearch.java 2011-04-04 10:51:42 UTC (rev 44171) @@ -0,0 +1,44 @@ +/* + * BRL-CAD + * + * Copyright (c) 2011 United States Government as represented by + * the U.S. Army Research Laboratory. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this file; see the file named COPYING for more + * information. + */ +/** @file UUIDSerialResearch.java + * + */ +package org.brlcad.geometryservice; + +import java.util.UUID; + +/** + * @author dloman + * + */ +public class UUIDSerialResearch { + + /** + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + String s = "dad3c04e-5ef7-42c3-86eb-a48faae11254"; + System.out.println("Input string len: " + s.length()); + UUID u = UUID.fromString(s); + System.out.println(u.toString()); + } + +} Property changes on: geomcore/trunk/src/interfaces/java/test/org/brlcad/geometryservice/UUIDSerialResearch.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits