Examples of execute()


Examples of org.modeshape.jcr.query.CancellableQuery.execute()

        NodeTypes nodeTypes = repository.nodeTypeManager().getNodeTypes();
        RepositoryIndexes indexDefns = repository.queryManager().getIndexes();
        CancellableQuery query = queryManager.query(context, repoCache, workspaceNames, overridden, command, schemata,
                                                    indexDefns, nodeTypes, null, null);
        try {
            QueryResults result = query.execute();
            if (result.isEmpty()) return false;
            if (result.getRowCount() < 0) {
                // Try to get the first row ...
                NodeSequence seq = result.getRows();
                Batch batch = seq.nextBatch();
View Full Code Here

Examples of org.modeshape.jcr.query.QueryEngine.execute()

            public QueryResults execute() throws QueryCancelledException, RepositoryException {
                try {
                    lock.lock();
                    if (results == null) {
                        // this will block and will hold the lock until it is done ...
                        results = queryEngine.execute(queryContext, command);
                    }
                    return results;
                } finally {
                    lock.unlock();
                }
View Full Code Here

Examples of org.mokai.Action.execute()

      // inject the Execution interface implementation (ie. an instance of this class)
      ActionsExecutor executor = new ActionsExecutor(producerTemplate, index + 1);
      ResourceInjector.inject(action, executor);

      // execute the message, notice that the execution could be stopped or new messages routed
      action.execute(message);

      // if the action stopped the execution ...
      if (executor.isStopped()) {
        return;
      }
View Full Code Here

Examples of org.mokai.action.AddPrefixAction.execute()

    action.setPrefix("57");

    Message message = new Message();
    message.setProperty("to", "11");

    action.execute(message);

    Assert.assertEquals(message.getProperty("to", String.class), "5711");
  }

  @Test
View Full Code Here

Examples of org.mokai.action.AddSpacesAction.execute()

    action.setLength(160);

    Message message = new Message();
    message.setProperty("message", "a");

    action.execute(message);

    Assert.assertEquals(message.getProperty("message", String.class).length(), 160);

    String compare = "a";
    for (int i=0; i < 159; i++) {
View Full Code Here

Examples of org.mokai.action.AddSuffixAction.execute()

    action.setSuffix("suf");

    Message message = new Message();
    message.setProperty("to", "test");

    action.execute(message);

    Assert.assertEquals(message.getProperty("to", String.class), "testsuf");
  }

  @Test
View Full Code Here

Examples of org.mokai.action.ConcatAction.execute()

    Message message = new Message();
    message.setProperty("field1", "value1");
    message.setProperty("field2", "value2");

    action.execute(message);

    Assert.assertEquals(message.getProperty("field3", String.class), "value1,value2");
  }
}
View Full Code Here

Examples of org.mokai.action.CopyAction.execute()

    action.setTo("prop-2");

    Message message = new Message();
    message.setProperty("prop-1", "value");

    action.execute(message);

    Assert.assertEquals(message.getProperty("prop-1"), "value");
    Assert.assertEquals(message.getProperty("prop-2"), "value");
  }
View Full Code Here

Examples of org.mokai.action.JsonParserAction.execute()

    action.setField("body");

    Message message = new Message();
    message.setProperty("body", "{ \"number\": 2, \"boolean\": false, \"string\": \"this is a test\", \"double\": 2.23 }");

    action.execute(message);

    Assert.assertEquals(message.getProperty("number", int.class).intValue(), 2);
    Assert.assertEquals(message.getProperty("boolean", Boolean.class).booleanValue(), false);
    Assert.assertEquals(message.getProperty("string", String.class), "this is a test");
    Assert.assertEquals(message.getProperty("double", Double.class).doubleValue(), 2.23);
View Full Code Here

Examples of org.mokai.action.RemoveAction.execute()

      .setProperty("from", "test-from");

    RemoveAction removeAction = new RemoveAction();
    removeAction.setField("to");

    removeAction.execute(message);

    Assert.assertEquals(message.getProperties().size(), 1);
    Assert.assertNull(message.getProperty("to"));
    Assert.assertEquals(message.getProperty("from", String.class), "test-from");
  }
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.