diff --git a/src/main/java/org/jpeek/skeleton/OpsOf.java b/src/main/java/org/jpeek/skeleton/OpsOf.java index b0d979eb..99bd49c1 100644 --- a/src/main/java/org/jpeek/skeleton/OpsOf.java +++ b/src/main/java/org/jpeek/skeleton/OpsOf.java @@ -89,7 +89,8 @@ public void visitFieldInsn(final int opcode, final String owner, // That is important to differentiate overloaded methods to calculate LCOM4. // We need to add a tag 'name' to reflect the method name // and a tag 'args' to reflect the method's arguments. - // Also, don't forget to delete @Disabled lines in org.jpeek.skeleton.SkeletonTest#createsXml. + // Also, don't forget to delete @Disabled lines in + // SkeletonTest#skeletonShouldReflectExactOverloadedCalledMethod. // Example: // // OverloadMethods.methodOne diff --git a/src/test/java/org/jpeek/skeleton/SkeletonTest.java b/src/test/java/org/jpeek/skeleton/SkeletonTest.java index 6dffa689..bed2a6a4 100644 --- a/src/test/java/org/jpeek/skeleton/SkeletonTest.java +++ b/src/test/java/org/jpeek/skeleton/SkeletonTest.java @@ -39,7 +39,6 @@ public final class SkeletonTest { @Test - @Disabled public void createsXml() { new Assertion<>( "Must overload bar's methods", @@ -49,14 +48,11 @@ public void createsXml() { ).xml().toString() ), XhtmlMatchers.hasXPaths( - // @checkstyle LineLength (15 lines) + // @checkstyle LineLength (10 lines) "/skeleton/app/package[count(class)=2]", "//class[@id='Bar']/methods[count(method)=5]", "//class[@id='OverloadMethods']/methods[count(method)=5]", "//method[@name='' and @ctor='true']", - "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/name[.='OverloadMethods.methodOne']", - "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args[count(arg)=2]", - "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args/arg[@type='Ljava/lang/String' and .='?']", "//class[@id='Bar']//method[@name='getKey']/ops[count(op)=3]", "//class[@id='Bar']//method[@name='getKey']/ops/op[@code='put_static' and .='Bar.singleton']", "//class[@id='Bar']//method[@name='getKey']/ops/op[@code='call' and .='java.lang.String.length']", @@ -66,6 +62,25 @@ public void createsXml() { ).affirm(); } + @Test + @Disabled + public void skeletonShouldReflectExactOverloadedCalledMethod() { + new Assertion<>( + "Must overload bar's methods", + XhtmlMatchers.xhtml( + new Skeleton( + new FakeBase("OverloadMethods", "Bar") + ).xml().toString() + ), + XhtmlMatchers.hasXPaths( + // @checkstyle LineLength (3 lines) + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/name[.='OverloadMethods.methodOne']", + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args[count(arg)=2]", + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args/arg[@type='Ljava/lang/String' and .='?']" + ) + ).affirm(); + } + @Test public void findsMethodsAndArgs() { new Assertion<>(