示例#1
0
  @DataProvider(name = "generateUserScheduledEditOpsPermission")
  public Object[][] generateUserScheduledEditOpsPermission() {

    final Object[][] allowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.FALCON_SUPER_USER_NAME,
              MerlinConstants.FALCON_SUPER_USER2_NAME,
              MerlinConstants.USER2_NAME,
            },
            new EntityOp[] {
              EntityOp.delete, EntityOp.update, EntityOp.suspend, EntityOp.resume,
            },
            new Boolean[] {
              true,
            });

    final Object[][] notAllowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.DIFFERENT_USER_NAME,
            },
            new EntityOp[] {
              EntityOp.delete, EntityOp.update, EntityOp.suspend, EntityOp.resume,
            },
            new Boolean[] {
              false,
            });

    return MatrixUtil.append(allowedCombinations, notAllowedCombinations);
  }
 @DataProvider
 public Object[][] getMismatchPattern() {
   String[] mismatchPatternParam =
       new String[] {"akm", "ne d", "newss", "new*", "NewEntityDefinitions"};
   AbstractEntityHelper[] helper =
       new AbstractEntityHelper[] {
         prism.getProcessHelper(), prism.getFeedHelper(), prism.getClusterHelper(),
       };
   return MatrixUtil.crossProduct(helper, mismatchPatternParam);
 }
 @DataProvider
 public Object[][] getPattern() {
   String[] patternParam =
       new String[] {
         "new", "defintion", "W-E", "NewEntityDefinition", "ned",
         "NED", "NeD", "N-e-D", "N-e-D123", "",
       };
   AbstractEntityHelper[] helper =
       new AbstractEntityHelper[] {
         prism.getProcessHelper(), prism.getFeedHelper(), prism.getClusterHelper(),
       };
   return MatrixUtil.crossProduct(helper, patternParam);
 }
示例#4
0
  @DataProvider(name = "generateUserReadOpsPermissions")
  public Object[][] generateUserReadOpsPermissions() {
    final EntityOp[] falconReadOps = {
      EntityOp.status, EntityOp.dependency, EntityOp.listing, EntityOp.definition,
    };
    final Object[][] allowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {
              MerlinConstants.FALCON_SUPER_USER_NAME,
              MerlinConstants.FALCON_SUPER_USER2_NAME,
              MerlinConstants.USER2_NAME,
            },
            falconReadOps,
            new Boolean[] {true});

    final Object[][] notAllowedCombinations =
        MatrixUtil.crossProduct(
            new String[] {MerlinConstants.DIFFERENT_USER_NAME},
            falconReadOps,
            new Boolean[] {false});
    return MatrixUtil.append(allowedCombinations, notAllowedCombinations);
  }
示例#5
0
 @DataProvider
 public Object[][] getRecipeLocation() {
   return MatrixUtil.crossProduct(RecipeExecLocation.values());
 }