From 40a9d99496e098562f090fb7ffce9e749011b131 Mon Sep 17 00:00:00 2001 From: Benjamin Culkin Date: Mon, 20 May 2024 17:58:16 -0400 Subject: Formatting pass --- .../net/wotonomy/web/xml/XMLRPCSelectorTest.java | 71 ++++++++++------------ 1 file changed, 31 insertions(+), 40 deletions(-) (limited to 'projects/net.wotonomy.web/src/test/java/net') diff --git a/projects/net.wotonomy.web/src/test/java/net/wotonomy/web/xml/XMLRPCSelectorTest.java b/projects/net.wotonomy.web/src/test/java/net/wotonomy/web/xml/XMLRPCSelectorTest.java index 989a7ff..726fcd0 100644 --- a/projects/net.wotonomy.web/src/test/java/net/wotonomy/web/xml/XMLRPCSelectorTest.java +++ b/projects/net.wotonomy.web/src/test/java/net/wotonomy/web/xml/XMLRPCSelectorTest.java @@ -1,6 +1,5 @@ package net.wotonomy.web.xml; - import java.io.Serializable; import java.net.URL; import java.util.Date; @@ -21,49 +20,41 @@ public class XMLRPCSelectorTest extends TestCase { super.tearDown(); } - public static void testFoo( ) { - try - { - // create url for server - URL url = new URL( "http://localhost:8080/xmlrpctest" ); + public static void testFoo() { + try { + // create url for server + URL url = new URL("http://localhost:8080/xmlrpctest"); - // set up selectors - XMLRPCSelector getFullName = - new XMLRPCSelector( "getFullName" ); - XMLRPCSelector getCreateDate = - new XMLRPCSelector( "getCreateDate" ); - XMLRPCSelector setCreateDate = - new XMLRPCSelector( "setCreateDate" ); - XMLRPCSelector getChildList = - new XMLRPCSelector( "getChildList" ); - XMLRPCSelector setChildList = - new XMLRPCSelector( "setChildList" ); + // set up selectors + XMLRPCSelector getFullName = new XMLRPCSelector("getFullName"); + XMLRPCSelector getCreateDate = new XMLRPCSelector("getCreateDate"); + XMLRPCSelector setCreateDate = new XMLRPCSelector("setCreateDate"); + XMLRPCSelector getChildList = new XMLRPCSelector("getChildList"); + XMLRPCSelector setChildList = new XMLRPCSelector("setChildList"); - // fetch the full name - System.out.println( getFullName.invoke( url ) ); + // fetch the full name + System.out.println(getFullName.invoke(url)); - // fetch the create date - System.out.println( getCreateDate.invoke( url ) ); - // set date to current time - setCreateDate.invoke( url, new java.util.Date() ); - // re-fetch the create date - System.out.println( getCreateDate.invoke( url ) ); + // fetch the create date + System.out.println(getCreateDate.invoke(url)); + // set date to current time + setCreateDate.invoke(url, new java.util.Date()); + // re-fetch the create date + System.out.println(getCreateDate.invoke(url)); - // fetch the child list - java.util.List childList = (java.util.List) getChildList.invoke( url ); - System.out.println( childList ); - // add a new child - childList.add( new MockSerializableObject(new Long(5),"John","Doe", new Date()) ); - setChildList.invoke( url, childList ); - // re-fetch the child list - System.out.println( getChildList.invoke( url ) ); - } - catch (Exception exc) - { - //exc.printStackTrace(); + // fetch the child list + java.util.List childList = (java.util.List) getChildList.invoke(url); + System.out.println(childList); + // add a new child + childList.add(new MockSerializableObject(new Long(5), "John", "Doe", new Date())); + setChildList.invoke(url, childList); + // re-fetch the child list + System.out.println(getChildList.invoke(url)); + } catch (Exception exc) { + // exc.printStackTrace(); } } - + public static class MockSerializableObject implements Serializable { public String firstname; public String lastname; @@ -77,7 +68,7 @@ public class XMLRPCSelectorTest extends TestCase { this.id = id; this.lastname = lastname; } - + } - + } -- cgit v1.2.3