|
From: <tre...@us...> - 2008-02-26 16:53:30
|
Revision: 770
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=770&view=rev
Author: trevorolio
Date: 2008-02-26 08:53:32 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
Moved comet test.
Removed Paths:
-------------
maven/trunk/ogoglio-integration-test/src/main/java/com/ogoglio/amazon/test/CometTest.java
Deleted: maven/trunk/ogoglio-integration-test/src/main/java/com/ogoglio/amazon/test/CometTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/main/java/com/ogoglio/amazon/test/CometTest.java 2008-02-25 19:10:34 UTC (rev 769)
+++ maven/trunk/ogoglio-integration-test/src/main/java/com/ogoglio/amazon/test/CometTest.java 2008-02-26 16:53:32 UTC (rev 770)
@@ -1,115 +0,0 @@
-package com.ogoglio.amazon.test;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Vector;
-
-import com.ogoglio.client.SpaceClient;
-import com.ogoglio.client.WebAPIAuthenticator;
-import com.ogoglio.client.WebAPIClient;
-import com.ogoglio.client.WebAPIClientWire;
-import com.ogoglio.client.WebAPIDescriptor;
-import com.ogoglio.client.model.Thing;
-import com.ogoglio.client.model.User;
-import com.ogoglio.xml.SpaceDocument;
-
-public class CometTest implements SpaceClient.Listener{
-
- private String host;
- private String user;
- private String password;
-
- public CometTest(String host, String user, String password) {
- this.host=host;
- this.user=user;
- this.password=password;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- if (args.length!=3) {
- usage();
- }
- try {
- CometTest test=new CometTest(args[0],args[1],args[2]);
- test.start();
- } catch (URISyntaxException e) {
- System.err.println("Couldn't form a URI from the given host:"+e.getMessage());
- } catch (IOException e) {
- System.err.println("IOException :"+e.getMessage());
- e.printStackTrace();
- }
- }
-
- private static void usage() {
- System.err.println("usage: AmazonCometTest ec2-67-202-23-0.compute-1.amazonaws.com user password");
- System.exit(1);
- }
-
- private void start() throws URISyntaxException, IOException {
- WebAPIDescriptor descriptor = new WebAPIDescriptor(new URI("http://"+host+":80/og/"));
- WebAPIClientWire wire=new WebAPIClientWire();
- WebAPIAuthenticator auth = new WebAPIAuthenticator(wire,descriptor,user,password);
- WebAPIClient webclient = new WebAPIClient(descriptor,auth,wire);
-
- SpaceDocument space=webclient.createSpace("testing remote access");
- long spaceID=space.getSpaceID();
- System.out.println("Last changed ["+space.getDisplayName()+"]:"+space.getLastModifiedAsUTC());
- //make a space for us to play in
- webclient.setSpacePublished(spaceID, true);
-
- try {
- Thread.sleep(5000);
- } catch (InterruptedException e) {
- }
-
- SpaceClient client=new SpaceClient(spaceID,descriptor.getServiceURI(),auth.getAuthCookie(),this);
- System.out.println("Got a connected client!");
- webclient.deleteSpace(spaceID);
- }
-
- public void contextItemChosen(Thing thing, long nonce, String id) {
- }
-
- public void disconnected() {
- System.out.println("Disconnected from space");
- }
-
- public void receivedBrowserMessage(long sourceThingID, String message) {
- }
-
- public void receivedChatMessage(String username, String message) {
- }
-
- public void receivedCommandFocusRequest(String preloadedText) {
- }
-
- public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
- }
-
- public void receivedContextMenuRequest(Thing thing, String shapeName, int x, int y, long nonce) {
- }
-
- public void receivedInfoPanel(long sourceThingID, String nonce) {
- }
-
- public void receivedLink(String displayName, String link) {
- }
-
- public void receivedSpaceTransfer(URI link) {
- }
-
- public void receivedUserContextMenuRequest(User user, int x, int y) {
- // TODO Auto-generated method stub
-
- }
-
- public void receivedTellMessage(String username, String message) {
- // TODO Auto-generated method stub
-
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|