mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
more java tests moved to community
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
}
|
||||
|
||||
private void test() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
}
|
||||
|
||||
private void test() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();
|
||||
}
|
||||
|
||||
private void test() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
static void test(int i) {}
|
||||
public Test() {
|
||||
test();
|
||||
}
|
||||
|
||||
private void test() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'bar'" "true"
|
||||
public class Test {
|
||||
<T extends String> void foo (T t1, T t2) {
|
||||
bar (t1, t2);
|
||||
}
|
||||
|
||||
private <T extends String> void bar(T t1, T t2) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
assert test();
|
||||
}
|
||||
|
||||
private boolean test() {
|
||||
<selection>return false; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create Method 'toMulti'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class BrokenCreateMethod {
|
||||
|
||||
public void foo(Map<String, String> bar) {
|
||||
Map<String, String[]> multiBar = toMulti(bar);
|
||||
}
|
||||
|
||||
private Map<String, String[]> toMulti(Map<String, String> bar) {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public interface Test {
|
||||
|
||||
void test();
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void bar() {
|
||||
Test test = null;
|
||||
test.test();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Method 'bar'" "true"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = bar();
|
||||
String s = bar();
|
||||
}
|
||||
|
||||
private String bar() {
|
||||
<selection>return null; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Create Method 'someMethod'" "true"
|
||||
public class Test {
|
||||
|
||||
public Object get() {
|
||||
return new Object() {
|
||||
public boolean equals(Object obj) {
|
||||
return someMethod(this);
|
||||
}
|
||||
|
||||
private boolean someMethod(Object o) {
|
||||
<selection>return false; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Create Method 'f'" "true"
|
||||
class A {
|
||||
{
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
B.f(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
class B {
|
||||
public static void f(Runnable runnable) {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create Method 'f'" "true"
|
||||
public class A {
|
||||
public A() {
|
||||
this(f());
|
||||
}
|
||||
|
||||
private static int f() {
|
||||
<selection>return 0; //To change body of created methods use File | Settings | File Templates.<caret></selection>
|
||||
}
|
||||
|
||||
public A(int i) {
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
te<caret>st();
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Do not create method" "false"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test(<caret>);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test()<caret>;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
test();<caret>
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
static void test(int i) {}
|
||||
public Test() {
|
||||
te<caret>st();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Create Method 'f'" "false"
|
||||
public class Foo {
|
||||
void foo(Bar f) {
|
||||
f.<caret>f(2);
|
||||
}
|
||||
}
|
||||
class Bar {
|
||||
private void f(int i){}
|
||||
public void f(String s){}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'bar'" "true"
|
||||
public class Test {
|
||||
<T extends String> void foo (T t1, T t2) {
|
||||
<caret>bar (t1, t2);
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public class Test {
|
||||
public Test() {
|
||||
assert <caret>test();
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Method 'toMulti'" "true"
|
||||
import java.util.Map;
|
||||
|
||||
class BrokenCreateMethod {
|
||||
|
||||
public void foo(Map<String, String> bar) {
|
||||
Map<String, String[]> multiBar = <caret>toMulti(bar);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Method 'test'" "true"
|
||||
public interface Test {
|
||||
|
||||
}
|
||||
|
||||
class Foo {
|
||||
void bar() {
|
||||
Test test = null;
|
||||
test.te<caret>st();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Create Method 'bar'" "true"
|
||||
class A {
|
||||
public void foo() {
|
||||
Object x = <caret>bar();
|
||||
String s = bar();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Create Method 'someMethod'" "true"
|
||||
public class Test {
|
||||
|
||||
public Object get() {
|
||||
return new Object() {
|
||||
public boolean equals(Object obj) {
|
||||
return <caret>someMethod(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Method 'f'" "true"
|
||||
class A {
|
||||
{
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
B.<caret>f(this);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
class B {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Create Method 'f'" "true"
|
||||
public class A {
|
||||
public A() {
|
||||
this(<caret>f());
|
||||
}
|
||||
|
||||
public A(int i) {
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Create Method 'f'" "false"
|
||||
class A {
|
||||
{
|
||||
f<caret>(xxx);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user