/** * Test method for {@link FollowsNamedTypeBlockParser#parse(java.lang.String, JavadocScanner)}. * * @throws Exception If occurred */ @Test public void testParseMissing() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string(" /IllegalArgumentException")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, TEXT); assertTextEquals(" /IllegalArgumentException", fragments.get(0)); }
/** * Test method for {@link FollowsNamedTypeBlockParser#parse(java.lang.String, JavadocScanner)}. * * @throws Exception If occurred */ @Test public void testParseJust() throws Exception { FollowsNamedTypeBlockParser parser = new FollowsNamedTypeBlockParser("throws"); IrDocBlock block = parser.parse("throws", string("IllegalArgumentException")); assertEquals("@throws", block.getTag()); List<? extends IrDocFragment> fragments = block.getFragments(); assertKinds(fragments, NAMED_TYPE); assertEquals( "IllegalArgumentException", ((IrDocNamedType) fragments.get(0)).getName().asString()); }