Package pdp.scrabble.multiplayer

Examples of pdp.scrabble.multiplayer.Client.connect()


    public void ClientTester() {
  Client client = FACTORY.createClient(null, LANG);

  // Connect without server
  try {
      client.connect(null, "localhost", "1099", "test", LANG);
      fail("Connect to inexistant server not expected");
  }
  catch (RemoteException ex) {
      System.out.println("Can't connect to null server");
  }
View Full Code Here


  }

  // Test with server
  Server server = FACTORY.createServer(1099, LANG);
  try {
      client.connect(null, "localhost", "1099", "test", LANG);
      System.out.println("Connect to localhost on port 1099");
  }
  catch (RemoteException ex) {
      fail("RemoteException was not expected");
  }
View Full Code Here

      fail("MalformedURLException was not expected");
  }

  // Connect with bad adress
  try {
      client.connect(null, "test", "1099", "test", LANG);
      fail("Connect to bad address not expected");
  }
  catch (RemoteException ex) {
      System.out.println("Can't connect to bad address");
  }
View Full Code Here

      fail("MalformedURLException was not expected");
  }

  // Connect with bad port
  try {
      client.connect(null, "localhost", "22", "test", LANG);
      fail("Connect to localhost on port 22 not expected");
  }
  catch (RemoteException ex) {
      System.out.println("Can't connect on port 22");
  }
View Full Code Here

  //50 connections/disconnections
  System.out.println("50 Connections/disconnections...");
  for (int i = 0; i < 50; i++) {
      try {
    client.connect(null, "localhost", "1099", "test" + i, LANG);
    server.disconnect(0);
      }
      catch (RemoteException ex) {
    fail("RemoteException was not expected");
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.