@Test
public void testComponentCommandOrderBadInput() throws Exception {

  CommandOrder co = new CommandOrder();
  co.setCommand(" A-START");
  co.setRequires("B-STARTED , C-STARTED");
  ComponentInstanceState cisB = new ComponentInstanceState("B", containerId, "aid");
  ComponentInstanceState cisC = new ComponentInstanceState("C", containerId, "aid");
  cisB.setState(State.STARTED);
  cisC.setState(State.STARTED);
  ComponentCommandOrder cco = new ComponentCommandOrder(Arrays.asList(co),
      resources);
  Assert.assertTrue(cco.canExecute("A", Command.START, Arrays.asList(cisB, cisC)));
  co.setCommand(" A-STAR");
  co.setRequires("B-STARTED , C-STARTED");
  try {
    cco = new ComponentCommandOrder(Arrays.asList(co), resources);
    Assert.fail("Instantiation should have failed.");
  } catch (IllegalArgumentException ie) {
    log.info(ie.getMessage());
  }
  co.setCommand(" -START");
  co.setRequires("B-STARTED , C-STARTED");
  try {
    cco = new ComponentCommandOrder(Arrays.asList(co), resources);
    Assert.fail("Instantiation should have failed.");
  } catch (IllegalArgumentException ie) {
    log.info(ie.getMessage());
  }
  co.setCommand(" A-START");
  co.setRequires("B-STRTED , C-STARTED");
  try {
    cco = new ComponentCommandOrder(Arrays.asList(co), resources);
    Assert.fail("Instantiation should have failed.");
  } catch (IllegalArgumentException ie) {
    log.info(ie.getMessage());
  }
  co.setCommand(" A-START");
  co.setRequires("B-STARTED , C-");
  try {
    cco = new ComponentCommandOrder(Arrays.asList(co), resources);
    Assert.fail("Instantiation should have failed.");
  } catch (IllegalArgumentException ie) {
    log.info(ie.getMessage());
  }
  co.setCommand(" A-INSTALL");
  co.setRequires("B-STARTED");
  try {
    cco = new ComponentCommandOrder(Arrays.asList(co), resources);
    Assert.fail("Instantiation should have failed.");
  } catch (IllegalArgumentException ie) {
    log.info(ie.getMessage());
  }
}