public static MappingRuleAction createPlaceToQueueAction(
      String queue, boolean allowCreate) {
    return new PlaceToQueueAction(queue, allowCreate);
  }
@Test
  public void testPlaceToQueueAction() {
    VariableContext variables = new VariableContext();
    variables.put("%default", "root.default");
    variables.put("%immutable", "immutable");
    variables.put("%empty", "");
    variables.put("%null", null);
    variables.put("%sub", "xxx");
    variables.setImmutables("%immutable");

    MappingRuleAction placeToStatic =
        new MappingRuleActions.PlaceToQueueAction("root.static.queue", true);

    MappingRuleAction placeToDynamic =
        new MappingRuleActions.PlaceToQueueAction("root.%sub.%immutable", true);

    MappingRuleAction placeToDynamicDoubleSub =
        MappingRuleActions.createPlaceToQueueAction(
            "root.%sub%sub.%immutable", true);

    MappingRuleAction placeToNull =
        MappingRuleActions.createPlaceToQueueAction(null, true);

    MappingRuleAction placeToEmpty =
        MappingRuleActions.createPlaceToQueueAction("", true);

    MappingRuleAction placeToNulRef =
        new MappingRuleActions.PlaceToQueueAction("%null", true);

    MappingRuleAction placeToEmptyRef =
        new MappingRuleActions.PlaceToQueueAction("%empty", true);

    MappingRuleAction placeToDefaultRef =
        new MappingRuleActions.PlaceToQueueAction("%default", true);

    assertPlaceResult(placeToStatic.execute(variables), "root.static.queue");
    assertPlaceResult(placeToDynamic.execute(variables), "root.xxx.immutable");
    assertPlaceResult(placeToDynamicDoubleSub.execute(variables),
        "root.%sub%sub.immutable");

    assertPlaceResult(placeToNull.execute(variables), "");
    assertPlaceResult(placeToEmpty.execute(variables), "");
    assertPlaceResult(placeToNulRef.execute(variables), "");
    assertPlaceResult(placeToEmptyRef.execute(variables), "");
    assertPlaceResult(placeToDefaultRef.execute(variables), "root.default");
  }