Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Commit 9a16601

Browse files
committed
Implement new concept InnerTestClass
1 parent beb947b commit 9a16601

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

src/main/resources/META-INF/jqassistant-rules/junit4.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,17 @@
161161
]]></cypher>
162162
</concept>
163163

164+
<concept id="junit4:InnerTestClass">
165+
<requiresConcept refId="junit4:TestClass" />
166+
<description>Labels inner types of types labeled with "Test" with "Test" and "Inner".</description>
167+
<cypher><![CDATA[
168+
MATCH
169+
(source:Type:Junit4:Test)-[:DECLARES]->(target:Type)
170+
SET
171+
target:Junit4:Test:Inner
172+
RETURN
173+
target
174+
]]></cypher>
175+
</concept>
176+
164177
</jqa:jqassistant-rules>

src/test/java/com/buschmais/jqassistant/plugin/junit/test/rule/Junit4IT.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,17 @@ public void defaultGroup() throws RuleException {
244244
Map<String, Result<Constraint>> constraintViolations = reportPlugin.getConstraintResults();
245245
assertThat(constraintViolations, anEmptyMap());
246246
}
247+
248+
/**
249+
* Verifies the concept "junit4:InnerTestClass"
250+
*/
251+
@Test
252+
public void innerTestClass() throws RuleException {
253+
scanClasses(TestClass.class);
254+
Result result = applyConcept("junit4:InnerTestClass");
255+
assertThat(result.getStatus(), equalTo(SUCCESS));
256+
store.beginTransaction();
257+
assertThat(query("MATCH (c:Type:Junit4:Test:Inner) RETURN c").getColumn("c"), hasItem(typeDescriptor(TestClass.InnerTestClass.class)));
258+
store.commitTransaction();
259+
}
247260
}

src/test/java/com/buschmais/jqassistant/plugin/junit/test/set/junit4/TestClass.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ public void after() {
3131
public static void afterClass() {
3232
}
3333

34+
public class InnerTestClass {
35+
}
36+
3437
}

0 commit comments

Comments
 (0)