more java tests moved to community

This commit is contained in:
Alexey Kudravtsev
2010-06-25 12:46:40 +04:00
parent 735a9d17a8
commit 2718da9fc7
1139 changed files with 14287 additions and 0 deletions
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -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>
}
}
@@ -0,0 +1,12 @@
// "Create Method 'test'" "true"
public interface Test {
void test();
}
class Foo {
void bar() {
Test test = null;
test.test();
}
}
@@ -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>
}
}
@@ -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>
}
};
}
}
@@ -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>
}
}
@@ -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) {
}
}
@@ -0,0 +1,6 @@
// "Create Method 'test'" "true"
public class Test {
public Test() {
te<caret>st();
}
}
@@ -0,0 +1,6 @@
// "Do not create method" "false"
public class Test {
public Test() {
test(<caret>);
}
}
@@ -0,0 +1,6 @@
// "Create Method 'test'" "true"
public class Test {
public Test() {
test()<caret>;
}
}
@@ -0,0 +1,6 @@
// "Create Method 'test'" "true"
public class Test {
public Test() {
test();<caret>
}
}
@@ -0,0 +1,7 @@
// "Create Method 'test'" "true"
public class Test {
static void test(int i) {}
public Test() {
te<caret>st();
}
}
@@ -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){}
}
@@ -0,0 +1,6 @@
// "Create Method 'bar'" "true"
public class Test {
<T extends String> void foo (T t1, T t2) {
<caret>bar (t1, t2);
}
}
@@ -0,0 +1,6 @@
// "Create Method 'test'" "true"
public class Test {
public Test() {
assert <caret>test();
}
}
@@ -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);
}
}
@@ -0,0 +1,11 @@
// "Create Method 'test'" "true"
public interface Test {
}
class Foo {
void bar() {
Test test = null;
test.te<caret>st();
}
}
@@ -0,0 +1,7 @@
// "Create Method 'bar'" "true"
class A {
public void foo() {
Object x = <caret>bar();
String s = bar();
}
}
@@ -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);
}
};
}
}
@@ -0,0 +1,12 @@
// "Create Method 'f'" "true"
class A {
{
new Runnable() {
public void run() {
B.<caret>f(this);
}
};
}
}
class B {
}
@@ -0,0 +1,9 @@
// "Create Method 'f'" "true"
public class A {
public A() {
this(<caret>f());
}
public A(int i) {
}
}
@@ -0,0 +1,6 @@
// "Create Method 'f'" "false"
class A {
{
f<caret>(xxx);
}
}