mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
TestOnly inspection should validate classes
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>10</line>
|
||||
<package><default></package>
|
||||
<description>Test-only class is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>10</line>
|
||||
<package><default></package>
|
||||
<description>Test-only class is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>11</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>13</line>
|
||||
<package><default></package>
|
||||
<description>Test-only class is referenced in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>13</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>14</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>15</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>16</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>18</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>19</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>B.java</file>
|
||||
<line>20</line>
|
||||
<package><default></package>
|
||||
<description>Test-only method is called in production code</description>
|
||||
</problem>
|
||||
|
||||
</problems>
|
||||
@@ -0,0 +1,22 @@
|
||||
import packageA.A;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static packageA.A.staticImportedField;
|
||||
import static packageA.A.staticImportedMethod;
|
||||
|
||||
public class B {
|
||||
public void foo() {
|
||||
Iterable<A> iterable = new ArrayList<A>();
|
||||
System.out.println(iterable.iterator().next().field);
|
||||
|
||||
A a = new A();
|
||||
a.method();
|
||||
A.staticMethod();
|
||||
staticImportedMethod();
|
||||
|
||||
System.out.println(a.field);
|
||||
System.out.println(A.staticField);
|
||||
System.out.println(staticImportedField);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package packageA;
|
||||
|
||||
@org.jetbrains.annotations.TestOnly
|
||||
public class A {
|
||||
public String field;
|
||||
public static String staticField;
|
||||
public static String staticImportedField;
|
||||
|
||||
public A() {}
|
||||
|
||||
public void method() {}
|
||||
public static void staticMethod() {}
|
||||
public static void staticImportedMethod() {}
|
||||
}
|
||||
Reference in New Issue
Block a user