Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/resources/META-INF/jqassistant-rules/junit4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,17 @@
]]></cypher>
</concept>

<concept id="junit4:InnerTestClass">
<requiresConcept refId="junit4:TestClass" />
<description>Labels inner types of types labeled with "Test" with "Test" and "Inner".</description>
<cypher><![CDATA[
MATCH
(source:Type:Junit4:Test)-[:DECLARES]->(target:Type)
SET
target:Junit4:Test:Inner
RETURN
target
]]></cypher>
</concept>

</jqa:jqassistant-rules>
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,17 @@ public void defaultGroup() throws RuleException {
Map<String, Result<Constraint>> constraintViolations = reportPlugin.getConstraintResults();
assertThat(constraintViolations, anEmptyMap());
}

/**
* Verifies the concept "junit4:InnerTestClass"
*/
@Test
public void innerTestClass() throws RuleException {
scanClasses(TestClass.class);
Result result = applyConcept("junit4:InnerTestClass");
assertThat(result.getStatus(), equalTo(SUCCESS));
store.beginTransaction();
assertThat(query("MATCH (c:Type:Junit4:Test:Inner) RETURN c").getColumn("c"), hasItem(typeDescriptor(TestClass.InnerTestClass.class)));
store.commitTransaction();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ public void after() {
public static void afterClass() {
}

public class InnerTestClass {
}

}