StringFunctions { static public String executeFunction(String[] values, Variables variables, String addtlString) { try { if (values[2].equalsIgnoreCase("userid")) { return StringFunctions.userIdDate(Integer.valueOf(values[3]), values[4]); } else if (values[2].equalsIgnoreCase("randomalphalower")) { return StringFunctions.randomString(StringFunctions.alphaLower, Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomalphaupper")) { return StringFunctions.randomString(StringFunctions.alphaUpper, Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomalphamixed")) { return StringFunctions.randomString(StringFunctions.alphaMixed(), Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomnumeric")) { return StringFunctions.randomString(StringFunctions.numeric, Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomspecial")) { return StringFunctions.randomString(StringFunctions.special, Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomalphamixednumeric")) { return StringFunctions.randomString(StringFunctions.alphaMixedNumeric(), Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomalphamixedspecial")) { return StringFunctions.randomString(StringFunctions.alphaMixedSpecial(), Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("randomalphaMixedNumericSpecial")) { return StringFunctions.randomString(StringFunctions.alphaMixedNumericSpecial(), Integer.valueOf(values[3])); } else if (values[2].equalsIgnoreCase("concat")) { return StringFunctions.concat(values, variables); } else if (values[2].equalsIgnoreCase("useridFromRange")) { return StringFunctions.userIdFromRange(values, false); } else if (values[2].equalsIgnoreCase("useridFromRangeInclude")) { return StringFunctions.userIdFromRange(values, true); } else if (values[2].equalsIgnoreCase("useridFromRangeExclude")) { return StringFunctions.userIdFromRange(values, false); } else if (values[2].equalsIgnoreCase("useridFromRangeWithMod")) { return StringFunctions.userIdFromRangeWithMod(values, true); } else if (values[2].equalsIgnoreCase("useridFromRangeWithModInclude")) { return StringFunctions.userIdFromRangeWithMod(values, true); } else if (values[2].equalsIgnoreCase("useridFromRangeWithModExclude")) { return StringFunctions.userIdFromRangeWithMod(values, false); } else if (values[2].equalsIgnoreCase("substring")) { if (values.length == 5) { return StringFunctions.getSubstring(values[3], Integer.valueOf(values[4]), -1); } else if (values.length == 6) try { return StringFunctions.getSubstring(values[3], Integer.valueOf(values[4]), Integer.valueOf(values[5])); } catch (NumberFormatException nfe) { return StringFunctions.getSubstring(addtlString, values[3], values[4]); } } return ""; } catch (Exception ex) { return ""; } }  static boolean isValid(String[] values); static String executeFunction(String[] values, Variables variables, String addtlString); synchronized static Stack<Integer> getStack(Integer minId, Integer maxId, String exclusions, boolean include); static boolean shouldInclude(String value, List<String> expressions, boolean include);  }
@Test public void testExecuteFunction_1() throws Exception { String[] values = new String[] { null, null, "", null, null }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_2() throws Exception { String[] values = new String[] { null, null, "", null, null, null }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_3() throws Exception { String[] values = new String[] { null, null, "", null, null, null }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_4() throws Exception { String[] values = new String[] { null, null, "", null, null, null }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_5() throws Exception { String[] values = new String[] { null, null, "", "", "", null }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_6() throws Exception { String[] values = new String[] { null, null, "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_7() throws Exception { String[] values = new String[] { null, null, null, "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_8() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_9() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_10() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_11() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_12() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_13() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_14() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_15() throws Exception { String[] values = new String[] { null, null, "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }
@Test public void testExecuteFunction_16() throws Exception { String[] values = new String[] { null, null, "", "", "" }; Variables variables = new Variables(); String addtlString = ""; String result = StringFunctions.executeFunction(values, variables, addtlString); assertNotNull(result); }