Examples of Gateway


Examples of eu.admire.clienttoolkit.core.Gateway

  }

    @Test
    public void testDISPELNoResults() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        String dispelRequest =
            "use uk.org.ogsadai.Echo;\n" +
            "use uk.org.ogsadai.DeliverToNull;\n" +
            "Echo echo = new Echo;\n" +
            "|- \"Hello World2!\" -| => echo.input;\n" +
            "DeliverToNull deliver = new DeliverToNull;\n" +
            "echo.output => deliver.input;\n" +
            "submit echo;";
        GatewayProcess p = g.submit(dispelRequest);
        try
        {
            p.waitForResults();
           
            Map<String, Result> results = p.getResults();
View Full Code Here

Examples of eu.admire.clienttoolkit.core.Gateway

    }

    @Test
    public void testUnknownHost() throws Exception
    {
        Gateway g = GatewayFactory.get("http://unknown");
        try
        {
            g.submit(DISPEL_REQUEST);
            TestCase.fail("ServerException expected.");
        }
        catch (ServerException e)
        {
            // expected
View Full Code Here

Examples of eu.admire.clienttoolkit.core.Gateway

    }

    @Test
    public void getVersionTest() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        // just test that there is no error
        String version = g.getVersion();
        assertNotNull(version);
    }
View Full Code Here

Examples of eu.admire.clienttoolkit.core.Gateway

    }

    @Test
    public void getLocalDataResourcesTest() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        // just test that there is no error
        List<String> dataResources = g.getGatewayLocalDataResources();
        assertNotNull(dataResources);
    }
View Full Code Here

Examples of eu.admire.clienttoolkit.core.Gateway

    }

  @Test
  public void validateTest() throws Exception
  {
      Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);

      ValidationResult v = g.validate(DISPEL_REQUEST);
      assertTrue(v.getSubmittedGraphs().get(0).contains("<svg"));
     
      //Don't expect any errors or objects for this
      assertTrue(v.isValid());
      assertTrue(v.getErrors().isEmpty());
View Full Code Here

Examples of eu.admire.clienttoolkit.core.Gateway

  }

  @Test
    public void validationFailsTest() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
 
        //Give it rubbish, expect an error and no graph
        String dispelRequest = "This is a nonsense request";
        ValidationResult v = g.validate(dispelRequest);
     
        assertFalse(v.isValid());
        assertFalse(v.getErrors().trim().isEmpty());
       
        assertEquals(0, v.getRegisteredObjects().size());
View Full Code Here

Examples of org.I0Itec.zkclient.Gateway

public class InteractionProtocolTest extends AbstractZkTest {

  @Test(timeout = 7000)
  public void testLifecycle() throws Exception {
    int GATEWAY_PORT = 2190;
    Gateway gateway = new Gateway(GATEWAY_PORT, _zk.getServerPort());
    gateway.start();
    ZkClient zkClient = new ZkClient("localhost:" + GATEWAY_PORT);

    InteractionProtocol protocol = new InteractionProtocol(zkClient, _zk.getZkConf());
    final AtomicInteger connectCount = new AtomicInteger();
    final AtomicInteger disconnectCount = new AtomicInteger();
    final Object mutex = new Object();

    protocol.registerComponent(new ConnectedComponent() {
      @Override
      public void disconnect() {
        disconnectCount.incrementAndGet();
        synchronized (mutex) {
          mutex.notifyAll();
        }
      }

      @Override
      public void reconnect() {
        connectCount.incrementAndGet();
        synchronized (mutex) {
          mutex.notifyAll();
        }
      }
    });
    synchronized (mutex) {
      gateway.stop();
      mutex.wait();
      gateway.start();
      mutex.wait();
      gateway.stop();
      mutex.wait();
      gateway.start();
      mutex.wait();
    }
    zkClient.close();
    assertEquals(2, connectCount.get());
    assertEquals(2, connectCount.get());
    gateway.stop();
  }
View Full Code Here

Examples of org.I0Itec.zkclient.Gateway

    // startup node over gateway
    final ZkConfiguration gatewayConf = new ZkConfiguration();
    gatewayConf.setZKRootPath(_zk.getZkConf().getZkRootPath());
    gatewayConf.setZKServers("localhost:" + GATEWAY_PORT);
    Gateway gateway = new Gateway(GATEWAY_PORT, _zk.getServerPort());
    gateway.start();
    final ZkClient zkGatewayClient = ZkKattaUtil.startZkClient(gatewayConf, 30000);
    InteractionProtocol gatewayProtocol = new InteractionProtocol(zkGatewayClient, gatewayConf);
    FileUtil.deleteFolder(new NodeConfiguration().getShardFolder());
    final Node node = new Node(gatewayProtocol, new LuceneServer());
    node.start();

    // check node-master link
    master.start();
    TestUtil.waitUntilLeaveSafeMode(master);
    TestUtil.waitUntilNumberOfLiveNode(_protocol, 1);
    assertEquals(1, _protocol.getLiveNodes().size());

    // now break the node connection
    gateway.stop();
    TestUtil.waitUntilNumberOfLiveNode(_protocol, 0);

    // now fix the node connection
    gateway.start();
    TestUtil.waitUntilNumberOfLiveNode(_protocol, 1);

    // cleanup
    node.shutdown();
    master.shutdown();
    zkGatewayClient.close();
    gateway.stop();
  }
View Full Code Here

Examples of org.activiti.bpmn.model.Gateway

          activity.setDefaultFlow(defaultFlow);
        }
      }
     
      if (currentFlowElement instanceof Gateway) {
        Gateway gateway = (Gateway) currentFlowElement;
        if (StringUtils.isNotEmpty(defaultFlow)) {
          gateway.setDefaultFlow(defaultFlow);
        }
       
        gateway.setAsynchronous(async);
        gateway.setNotExclusive(notExclusive);
      }
     
      if(currentFlowElement instanceof DataObject) {
        if (!activeSubProcessList.isEmpty()) {
          activeSubProcessList.get(activeSubProcessList.size() - 1).getDataObjects().add((ValuedDataObject)parsedElement);
View Full Code Here

Examples of org.apache.airavata.persistance.registry.jpa.model.Gateway

        publishedWorkflow.setPublish_workflow_name(getName());
        publishedWorkflow.setPublished_date(publishedDate);
        publishedWorkflow.setVersion(version);
        byte[] bytes = content.getBytes();
        publishedWorkflow.setWorkflow_content(bytes);
        Gateway gateway = new Gateway();
        gateway.setGateway_name(this.gateway.getGatewayName());
        publishedWorkflow.setGateway(gateway);
        Users user = new Users();
        user.setUser_name(createdUser);
        publishedWorkflow.setUser(user);
        if(existingWF != null){
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.