summaryrefslogtreecommitdiff
path: root/plugins/IntentionPowerPak/test/com
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/IntentionPowerPak/test/com')
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace.java4
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace_after.java4
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java6
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java10
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java8
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array.java3
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/ArrayInitializer.java2
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array_after.java7
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3.java12
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3_after.java12
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4.java11
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4_after.java13
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse.java12
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse_after.java12
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4.java9
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4_after.java10
-rw-r--r--plugins/IntentionPowerPak/test/com/siyeh/ipp/types/lambda2anonymous/Ambiguity.java6
28 files changed, 215 insertions, 4 deletions
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace.java
new file mode 100644
index 000000000000..38de2d7356b7
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace.java
@@ -0,0 +1,4 @@
+public class FieldWithWhitespace {
+
+ private String ss<caret> [];
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace_after.java
new file mode 100644
index 000000000000..c53875ed975c
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/decls/simplify_variable/FieldWithWhitespace_after.java
@@ -0,0 +1,4 @@
+public class FieldWithWhitespace {
+
+ private String[] ss;
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java
new file mode 100644
index 000000000000..bf1f08c198c5
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/EnumComparison.java
@@ -0,0 +1,8 @@
+public class EnumComparison {
+
+ enum E { A, B }
+
+ boolean a(E a, E b) {
+ return a ==<caret> b;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java
new file mode 100644
index 000000000000..863fa48d0c78
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison.java
@@ -0,0 +1,6 @@
+public class NegatedObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a !=<caret> b;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java
new file mode 100644
index 000000000000..72eda7377647
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NegatedObjectComparison_after.java
@@ -0,0 +1,6 @@
+public class NegatedObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return !a.equals(b);
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java
new file mode 100644
index 000000000000..559ec3aec144
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/NullComparison.java
@@ -0,0 +1,6 @@
+public class NullComparison {
+
+ boolean a(Object a) {
+ return a ==<caret> null;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java
new file mode 100644
index 000000000000..0f25977323ab
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/PrimitiveComparison.java
@@ -0,0 +1,6 @@
+public class PrimitiveComparison {
+
+ boolean a(int i, int j) {
+ return i <caret>== j;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java
new file mode 100644
index 000000000000..baccea789e04
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison.java
@@ -0,0 +1,6 @@
+public class SimpleObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a == b<caret>;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java
new file mode 100644
index 000000000000..ab1bcce4c87b
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_equals/SimpleObjectComparison_after.java
@@ -0,0 +1,6 @@
+public class SimpleObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a.equals(b);
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java
new file mode 100644
index 000000000000..43b16a421c25
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/EnumComparison.java
@@ -0,0 +1,10 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class EnumComparison {
+
+ enum E { A, B }
+
+ boolean a(E a, E b) {
+ return a ==<caret> b;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java
new file mode 100644
index 000000000000..018def909d05
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class NegatedObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a !=<caret> b;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java
new file mode 100644
index 000000000000..b7f48289a4b8
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NegatedObjectComparison_after.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class NegatedObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a == null ? b != null : !a.equals(b);
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java
new file mode 100644
index 000000000000..10aeb19f6fed
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/NullComparison.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class NullComparison {
+
+ boolean a(Object a) {
+ return a ==<caret> null;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java
new file mode 100644
index 000000000000..8ae058592d0a
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/PrimitiveComparison.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class PrimitiveComparison {
+
+ boolean a(int i, int j) {
+ return i <caret>== j;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java
new file mode 100644
index 000000000000..304b06ff67a1
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class SimpleObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a == b<caret>;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java
new file mode 100644
index 000000000000..5ee0ddf5d6df
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/equality/replace_equality_with_safe_equals/SimpleObjectComparison_after.java
@@ -0,0 +1,8 @@
+package com.siyeh.ipp.equality.replace_equality_with_safe_equals;
+
+public class SimpleObjectComparison {
+
+ boolean a(Object a, Object b) {
+ return a == null ? b == null : a.equals(b);
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array.java
new file mode 100644
index 000000000000..486097f3f88a
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array.java
@@ -0,0 +1,3 @@
+class Array {
+ String s []<caret> = {};
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/ArrayInitializer.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/ArrayInitializer.java
index 54eaa025b8e8..6ea7f3cf2dd7 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/ArrayInitializer.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/ArrayInitializer.java
@@ -1,3 +1,3 @@
class X {
- String s <caret>= {};
+ String s <caret>= {};
} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array_after.java
new file mode 100644
index 000000000000..6aeac61776f9
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/initialization/Array_after.java
@@ -0,0 +1,7 @@
+class Array {
+ String s [];
+
+ {
+ s = new String[]{};
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3.java
new file mode 100644
index 000000000000..d6c02fcfbe66
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3.java
@@ -0,0 +1,12 @@
+import junit.framework.TestCase;
+
+public class AnonymousClassJUnit3 extends TestCase {
+
+ public void test2BiggerThan1() {
+ new Object() {
+ void foo() {
+ 2 > 1<caret>
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3_after.java
new file mode 100644
index 000000000000..9821c9431820
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit3_after.java
@@ -0,0 +1,12 @@
+import junit.framework.TestCase;
+
+public class AnonymousClassJUnit3 extends TestCase {
+
+ public void test2BiggerThan1() {
+ new Object() {
+ void foo() {
+ assertTrue(2 > 1);
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4.java
new file mode 100644
index 000000000000..e7b11eef3a87
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4.java
@@ -0,0 +1,11 @@
+public class AnonymousClassJUnit4 {
+
+ @org.junit.Test
+ public void test2BiggerThan1() {
+ new Object() {
+ void foo() {
+ 2 > 1<caret>
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4_after.java
new file mode 100644
index 000000000000..787d0e6d6115
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AnonymousClassJUnit4_after.java
@@ -0,0 +1,13 @@
+import org.junit.Assert;
+
+public class AnonymousClassJUnit4 {
+
+ @org.junit.Test
+ public void test2BiggerThan1() {
+ new Object() {
+ void foo() {
+ Assert.assertTrue(2 > 1);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse.java
new file mode 100644
index 000000000000..76bddf465b6f
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse.java
@@ -0,0 +1,12 @@
+import junit.framework.TestCase;
+
+public class AssertFalse extends TestCase {
+
+ public void testOne() {
+ !result()<caret>
+ }
+
+ boolean result() {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse_after.java
new file mode 100644
index 000000000000..6c1ad31f57a6
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/AssertFalse_after.java
@@ -0,0 +1,12 @@
+import junit.framework.TestCase;
+
+public class AssertFalse extends TestCase {
+
+ public void testOne() {
+ assertFalse(result());
+ }
+
+ boolean result() {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4.java
new file mode 100644
index 000000000000..24abc14797f4
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4.java
@@ -0,0 +1,9 @@
+import static java.util.Collections.EMPTY_LIST;
+
+public class AnonymousClassJUnit4 {
+
+ @org.junit.Test
+ public void testNotNull() {
+ EMPTY_LIST != null<caret>
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4_after.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4_after.java
new file mode 100644
index 000000000000..792a4f778816
--- /dev/null
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/junit/create_assert/StaticImportJUnit4_after.java
@@ -0,0 +1,10 @@
+import static java.util.Collections.EMPTY_LIST;
+import static org.junit.Assert.assertNotNull;
+
+public class AnonymousClassJUnit4 {
+
+ @org.junit.Test
+ public void testNotNull() {
+ assertNotNull(EMPTY_LIST);
+ }
+} \ No newline at end of file
diff --git a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/lambda2anonymous/Ambiguity.java b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/lambda2anonymous/Ambiguity.java
index 6df5c30ae69a..e8be7a9d0b0c 100644
--- a/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/lambda2anonymous/Ambiguity.java
+++ b/plugins/IntentionPowerPak/test/com/siyeh/ipp/types/lambda2anonymous/Ambiguity.java
@@ -2,14 +2,14 @@ interface I1 {
void m();
}
-interface I2<X> {
- X m();
+interface I2 {
+ void m();
}
class Ambiguity1 {
static void m(I1 i1) {}
- static <T> void m(I2<T> i2) {}
+ static void m(I2 i2) {}
{
m((<caret>)->{throw new AssertionError();});