Examples of TestCommand


Examples of com.caplin.cutlass.command.test.TestCommand

   
    getLoggerStore().setWhitelistedPackages(whitelistedPackages);
  }

  private void injectLegacyCommands(BRJS brjs) {
    brjs.plugins().addCommandPlugin(brjs, new TestCommand());
    brjs.plugins().addCommandPlugin(brjs, new TestServerCommand());
    brjs.plugins().addCommandPlugin(brjs, new TestIntegrationCommand());
  }
View Full Code Here

Examples of com.caplin.cutlass.command.test.TestCommand

    brjs.getFileInfo(brjs.app(appName).bladeset(bladesetName).blade(bladeName).dir()).resetLastModified();
  }
 
  public String runBladesetTests(String appName, String bladesetName, String testType) throws Exception
  {
    TestCommand cmd = new TestCommand();
    String bladesetPath = brjs.app(appName).bladeset(bladesetName).dir().getAbsolutePath();
    String[] args = new String[]{ bladesetPath, testType, JS_TEST_REPORT_SWITCH }
    OutputStream out = doCommand( cmd, args );
    return out.toString();
  }
View Full Code Here

Examples of com.caplin.cutlass.command.test.TestCommand

    return out.toString();
  }
 
  public String runBladeTests(String appName, String bladesetName, String bladeName, String testType) throws Exception
  {
    TestCommand cmd = new TestCommand();
    String bladePath = brjs.app(appName).bladeset(bladesetName).blade(bladeName).dir().getAbsolutePath();
    String[] args = new String[]{ bladePath, testType, JS_TEST_REPORT_SWITCH };
    OutputStream out = doCommand( cmd, args );
    return out.toString();
  }
View Full Code Here

Examples of com.caplin.cutlass.command.test.TestCommand

  public void initTestObjects() throws Exception
 
    //TODO::have to create brjs first should remove when moved over to core
    given(brjs).hasBeenCreated();
   
    given(brjs).hasCommandPlugins(new TestCommand());
      app = brjs.app("myapp");
      app.aspect("myaspect");
      bladeset = app.bladeset("mybladeset");
      bladeset.blade("myblade");
      sdkDir = new File(brjs.dir(), "sdk");
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

    } else
    {
      // System.err.println("try to stop participant: " +
      // result._manager.getInstanceName());
      NodeOpArg arg = new NodeOpArg(result._manager, result._thread);
      TestCommand command = new TestCommand(CommandType.STOP, new TestTrigger(beginTime), arg);
      List<TestCommand> commandList = new ArrayList<TestCommand>();
      commandList.add(command);
      TestExecutor.executeTestAsync(commandList, ZK_ADDR);
    }
  }
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

      nextIS = nextIdealState(initIS, destIS, step);
      // testInfo._idealStateMap.put(dbName, nextIS);
      String idealStatePath = PropertyPathConfig.getPath(PropertyType.IDEALSTATES, clusterName,
          TEST_DB_PREFIX + i);
      ZnodeOpArg arg = new ZnodeOpArg(idealStatePath, ZnodePropertyType.ZNODE, "+", nextIS);
      TestCommand command = new TestCommand(CommandType.MODIFY, new TestTrigger(beginTime), arg);
      commandList.add(command);
    }

    TestExecutor.executeTestAsync(commandList, ZK_ADDR);
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

    // test case for the basic flow, no timeout, no data trigger
    String pathChild1 = PREFIX + "/basic_child1";
    String pathChild2 = PREFIX + "/basic_child2";

    TestCommand command;
    ZnodeOpArg arg;
    arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1");
    command = new TestCommand(CommandType.MODIFY, arg);
    commandList.add(command);

    List<String> list = new ArrayList<String>();
    list.add("listValue1");
    list.add("listValue2");
    arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.LIST, "+", "key2", list);
    command = new TestCommand(CommandType.MODIFY, arg);
    commandList.add(command);

    ZNRecord record = getExampleZNRecord();
    arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", record);
    command = new TestCommand(CommandType.MODIFY, arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "==", "key1");
    command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, "simpleValue1"), arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.LIST, "==", "key2");
    command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, list), arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "==");
    command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, record), arg);
    commandList.add(command);

    Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR);
    for (Map.Entry<TestCommand, Boolean> entry : results.entrySet())
    {
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

    // test case for data trigger, no timeout
    String pathChild1 = PREFIX + "/data_trigger_child1";
    String pathChild2 = PREFIX + "/data_trigger_child2";

    ZnodeOpArg arg;
    TestCommand command;

    ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1-new");
    TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 0, "simpleValue1"), arg1);
    commandList.add(command1);

    ZNRecord record = getExampleZNRecord();
    ZNRecord recordNew = new ZNRecord(record);
    recordNew.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), IdealStateModeProperty.AUTO.toString());
    arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", recordNew);
    command = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 3000, record), arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", record);
    command = new TestCommand(CommandType.MODIFY, new TestTrigger(1000), arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "!=", "key1");
    command = new TestCommand(CommandType.VERIFY, new TestTrigger(3100, 0, "simpleValue1-new"), arg);
    commandList.add(command);

    arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "==");
    command = new TestCommand(CommandType.VERIFY, new TestTrigger(3100, 0, recordNew), arg);
    commandList.add(command);

    Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR);

    boolean result = results.remove(command1).booleanValue();
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

    // test case for timeout, no data trigger
    String pathChild1 = PREFIX + "/timeout_child1";
    String pathChild2 = PREFIX + "/timeout_child2";

    ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1-new");
    TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 1000, "simpleValue1"), arg1);
    commandList.add(command1);

    ZNRecord record = getExampleZNRecord();
    ZNRecord recordNew = new ZNRecord(record);
    recordNew.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), IdealStateModeProperty.AUTO.toString());
    arg1 = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", recordNew);
    command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 500, record), arg1);
    commandList.add(command1);

    arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "==", "key1");
    command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 500, "simpleValue1-new"), arg1);
    commandList.add(command1);

    arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "==");
    command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 500, recordNew), arg1);
    commandList.add(command1);

    Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR);
    for (Map.Entry<TestCommand, Boolean> entry : results.entrySet())
    {
View Full Code Here

Examples of com.linkedin.helix.tools.TestCommand

    final ZNRecord record = getExampleZNRecord();
    ZNRecord recordNew = new ZNRecord(record);
    recordNew.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), IdealStateModeProperty.AUTO.toString());
    ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "+", recordNew);
    TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 8000, record), arg1);
    commandList.add(command1);

    arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "==");
    command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(9000, 500, recordNew), arg1);
    commandList.add(command1);

    // start a separate thread to change znode at pathChild1
    new Thread()
    {
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.