Examples of SimpleClient


Examples of com.dragontek.mygpoclient.simple.SimpleClient

    Properties properties = new java.util.Properties();
    properties.load(new FileInputStream("client.properties"));
    _username = properties.getProperty("username");
    _password = properties.getProperty("password");
    _deviceId = properties.getProperty("deviceId");
    client = new SimpleClient(_username, _password);
   
  }
View Full Code Here

Examples of com.hazelcast.client.SimpleClient

    @Test
    public void get() throws Exception {
        IAtomicReference<String> reference = getAtomicReference();

        final SimpleClient client = getClient();
        client.send(new GetRequest(name));
        assertNull(client.receive());

        reference.set("foo");
        client.send(new GetRequest(name));
        assertEquals("foo",client.receive());
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

        setStatus("Not Started");
        c.add(statusLabel, BorderLayout.SOUTH);
        setSize(640, 480);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setVisible(true);
        simpleClient = new SimpleClient(this);
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

    {
        logger.info("Test good session");

        // create the client & login
        GoodSessionListener listener = new GoodSessionListener(username, password);
        SimpleClient sc = new SimpleClient(listener);
        listener.setSession(sc);
       
        // log in
        Properties props = new Properties();
        props.setProperty("host", serverInfo.getHostname());
        props.setProperty("port", Integer.toString(serverInfo.getSgsPort()));
        sc.login(props);

        boolean success = listener.waitForLogin();
        assert success : "Good login failed";
       
        sc.logout(true);
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

    {
        logger.info("Test bad session");
       
        // create the client & login
        BadSessionListener listener = new BadSessionListener(username, password);
        SimpleClient sc = new SimpleClient(listener);
        listener.setSession(sc);
       
        // log in
        Properties props = new Properties();
        props.setProperty("host", serverInfo.getHostname());
        props.setProperty("port", Integer.toString(serverInfo.getSgsPort()));
        sc.login(props);

        boolean success = listener.waitForLogin();
        assert !success : "Bad login succeeded";
       
        sc.logout(true);
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

            }
           
            startLogin(loginParams);
        }
       
        simpleClient = new SimpleClient(new WonderlandClientListener());
       
        Properties connectProperties = new Properties();
        connectProperties.setProperty("host", server.getHostname());
        connectProperties.setProperty("port", Integer.toString(server.getSgsPort()));
       
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

        setStatus("Not Started");
        c.add(statusLabel, BorderLayout.SOUTH);
        setSize(640, 480);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setVisible(true);
        simpleClient = new SimpleClient(this);
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

    }

    // Helpers
   
    void connect(SimpleClientListener listener) throws IOException {
        client = new SimpleClient(listener);
        client.login(connectionProps);
    }
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

    // disconnected callback (but not a loginFailed callback).
    public void testLoginNoServer() throws Exception {
  DummySimpleClientListener listener =
      new DummySimpleClientListener();

  SimpleClient client = new SimpleClient(listener);
  Properties props =
      createProperties(
    "host", "localhost",
    "port", Integer.toString(5382),
    "connectTimeout", Long.toString(TIMEOUT));
  client.login(props);
  synchronized (client) {
      client.wait(TIMEOUT * 2);
  }
  assertTrue(listener.disconnected);
  assertEquals(0, listener.getPasswordAuthentication);
  if (listener.disconnectReason == null) {
      fail("Received null disconnect reason");
View Full Code Here

Examples of com.sun.sgs.client.simple.SimpleClient

    public void testLoginFailedCallback() throws Exception {
  DummySimpleClientListener listener =
      new DummySimpleClientListener(
     new PasswordAuthentication("guest", new char[] {'!'}));

  SimpleClient client = new SimpleClient(listener);
  int port = 5382;
  Properties props =
      createProperties(
    "host", "localhost",
    "port", Integer.toString(port),
    "connectTimeout", Long.toString(TIMEOUT));
  SimpleServer server = new SimpleServer(port);
  try {
      server.start();
      client.login(props);
      synchronized (client) {
    client.wait(TIMEOUT);
      }
      assertTrue(listener.loginFailed);
      if (listener.loginFailedReason == null) {
    fail("Didn't receive loginFailed callback");
      }
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.