Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarus committed Mar 31, 2020
1 parent ff93dbc commit 7fff241
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/jpeek/skeleton/OpsOf.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
// <op code="call">
// <name>OverloadMethods.methodOne</name>
Expand Down
25 changes: 20 additions & 5 deletions src/test/java/org/jpeek/skeleton/SkeletonTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
public final class SkeletonTest {

@Test
@Disabled
public void createsXml() {
new Assertion<>(
"Must overload bar's methods",
Expand All @@ -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='<init>' 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']",
Expand All @@ -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<>(
Expand Down

0 comments on commit 7fff241

Please sign in to comment.