@Test public void testParseNoSpace() throws Exception { final int startingIndex = 23; @SuppressWarnings("unchecked") final List<String> lines = mock(List.class); final DocumentationTagIndexedSmoosher smoosher = mock(DocumentationTagIndexedSmoosher.class); whenNew(DocumentationTagIndexedSmoosher.class).withNoArguments().thenReturn(smoosher); when(smoosher.smoosh(startingIndex, lines)).thenReturn("noSpacesAtAll"); assertThat(parser.parse(startingIndex, lines)).isEmpty(); }
@Override public String parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int spacePos = smooshed.indexOf(' '); if (spacePos < 0) { return ""; } return smooshed.substring(spacePos + 1); } finally { point.collect(); } }
SingleTagParser extends AbstractIndexedParser<String> { @Override public String parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int spacePos = smooshed.indexOf(' '); if (spacePos < 0) { return ""; } return smooshed.substring(spacePos + 1); } finally { point.collect(); } } }
SingleTagParser extends AbstractIndexedParser<String> { @Override public String parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int spacePos = smooshed.indexOf(' '); if (spacePos < 0) { return ""; } return smooshed.substring(spacePos + 1); } finally { point.collect(); } } SingleTagParser(final String tag); }
SingleTagParser extends AbstractIndexedParser<String> { @Override public String parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int spacePos = smooshed.indexOf(' '); if (spacePos < 0) { return ""; } return smooshed.substring(spacePos + 1); } finally { point.collect(); } } SingleTagParser(final String tag); @Override boolean canParse(final String line); @Override String parse(final int startingIndex, final List<String> lines); }
SingleTagParser extends AbstractIndexedParser<String> { @Override public String parse(final int startingIndex, final List<String> lines) { final EtmPoint point = PointFactory.getPoint(getClass(), "parse(int, List)"); try { final DocumentationTagIndexedSmoosher smoosher = new DocumentationTagIndexedSmoosher(); final String smooshed = smoosher.smoosh(startingIndex, lines); setEndingIndex(smoosher.getEndingIndex()); final int spacePos = smooshed.indexOf(' '); if (spacePos < 0) { return ""; } return smooshed.substring(spacePos + 1); } finally { point.collect(); } } SingleTagParser(final String tag); @Override boolean canParse(final String line); @Override String parse(final int startingIndex, final List<String> lines);  }