@Test public void shouldProvideArgumentsForOutlineTokens() { Step step = new Step(Collections.<Comment>emptyList(), "Given ", "I have <number> cukes in <whose> belly", 10, null, null); assertEquals(7, step.getOutlineArgs().get(0).getOffset().intValue()); assertEquals("<number>", step.getOutlineArgs().get(0).getVal()); assertEquals(25, step.getOutlineArgs().get(1).getOffset().intValue()); assertEquals("<whose>", step.getOutlineArgs().get(1).getVal()); }
public List<Argument> getOutlineArgs() { List<Argument> result = new ArrayList<Argument>(); Pattern p = Pattern.compile("<[^<]*>"); Matcher matcher = p.matcher(getName()); while (matcher.find()) { MatchResult matchResult = matcher.toMatchResult(); result.add(new Argument(matchResult.start(), matchResult.group())); } return result; }
Step extends BasicStatement { public List<Argument> getOutlineArgs() { List<Argument> result = new ArrayList<Argument>(); Pattern p = Pattern.compile("<[^<]*>"); Matcher matcher = p.matcher(getName()); while (matcher.find()) { MatchResult matchResult = matcher.toMatchResult(); result.add(new Argument(matchResult.start(), matchResult.group())); } return result; } }
Step extends BasicStatement { public List<Argument> getOutlineArgs() { List<Argument> result = new ArrayList<Argument>(); Pattern p = Pattern.compile("<[^<]*>"); Matcher matcher = p.matcher(getName()); while (matcher.find()) { MatchResult matchResult = matcher.toMatchResult(); result.add(new Argument(matchResult.start(), matchResult.group())); } return result; } Step(List<Comment> comments, String keyword, String name, Integer line, List<DataTableRow> rows, DocString docString); }
Step extends BasicStatement { public List<Argument> getOutlineArgs() { List<Argument> result = new ArrayList<Argument>(); Pattern p = Pattern.compile("<[^<]*>"); Matcher matcher = p.matcher(getName()); while (matcher.find()) { MatchResult matchResult = matcher.toMatchResult(); result.add(new Argument(matchResult.start(), matchResult.group())); } return result; } Step(List<Comment> comments, String keyword, String name, Integer line, List<DataTableRow> rows, DocString docString); @Override Range getLineRange(); @Override void replay(Formatter formatter); List<Argument> getOutlineArgs(); Match getOutlineMatch(String location); List<DataTableRow> getRows(); DocString getDocString(); StackTraceElement getStackTraceElement(String path); }
Step extends BasicStatement { public List<Argument> getOutlineArgs() { List<Argument> result = new ArrayList<Argument>(); Pattern p = Pattern.compile("<[^<]*>"); Matcher matcher = p.matcher(getName()); while (matcher.find()) { MatchResult matchResult = matcher.toMatchResult(); result.add(new Argument(matchResult.start(), matchResult.group())); } return result; } Step(List<Comment> comments, String keyword, String name, Integer line, List<DataTableRow> rows, DocString docString); @Override Range getLineRange(); @Override void replay(Formatter formatter); List<Argument> getOutlineArgs(); Match getOutlineMatch(String location); List<DataTableRow> getRows(); DocString getDocString(); StackTraceElement getStackTraceElement(String path);  }