This commit is contained in:
Dmitry Jemerov
2009-09-10 21:16:49 +04:00
parent db3e3f17de
commit d13d5f3ac8
21 changed files with 16 additions and 4 deletions

View File

@@ -0,0 +1,8 @@
class InStaticInitializer {
public static final String x = "Hello World";
static {
System.out.println(x);
}
//Field must be placed before initializer or illegal forward reference will happen
}

View File

@@ -0,0 +1,13 @@
import org.junit.*;
public class T {
private int i;
@Test
public void test() {
}
@Before
public void setUp(){
i = 9;
}
}

View File

@@ -0,0 +1,13 @@
import org.junit.*;
public class T {
private int i;
@Test
public void test() {
}
@Before
public void setUp() throws Exception {
i = 9;
}
}

View File

@@ -0,0 +1,15 @@
import org.junit.Test;
import org.junit.Before;
public class T {
private int i;
@Test
public void test() {
}
@Before
public void setUp() throws Exception {
i = 9;
}
}

View File

@@ -0,0 +1,14 @@
class A {
public static final String string;
public void demo(String val){
if ("test1".equals(val)){
//do somethign
} else {
string = "test2";
if (string.equals(val)) {
//... something else
}
}
}
}

View File

@@ -0,0 +1,12 @@
import junit.framework.TestCase;
public class T extends TestCase {
private int i;
public void test() {
}
protected void setUp() throws Exception {
super.setUp();
i = 9;
}
}

View File

@@ -0,0 +1,8 @@
import junit.framework.TestCase;
public class T extends TestCase {
private int i;
public void setUp() {
i = 9;
}
}

View File

@@ -0,0 +1,16 @@
public class FieldTest {
private Object comboBox;
private class NoSelectionComboItem {
public final Object comboBox;
private NoSelectionComboItem() {
comboBox = FieldTest.this.comboBox;
}
public String getLabel() {
Object comboItem = comboBox.getSelectedItem();
return comboItem == this ? "<Please Select>" : "<Back to overview>";
}
}
}

View File

@@ -0,0 +1,19 @@
import junit.framework.TestCase;
class Base extends TestCase {
public void setUp() {
super.setUp();
}
}
public class T extends Base {
private int i;
public void test() {
}
public void setUp() throws Exception {
super.setUp();
i = 9;
}
}

View File

@@ -0,0 +1,6 @@
class InStaticInitializer {
static {
System.out.println(<selection>"Hello World"</selection>);
}
//Field must be placed before initializer or illegal forward reference will happen
}

View File

@@ -0,0 +1,10 @@
import org.junit.*;
public class T {
@Test
public void test() {
int <caret>i = 9;
}
@Before
public void setUp(){}
}

View File

@@ -0,0 +1,7 @@
import org.junit.*;
public class T {
@Test
public void test() {
int <caret>i = 9;
}
}

View File

@@ -0,0 +1,7 @@
import org.junit.Test;
public class T {
@Test
public void test() {
int <caret>i = 9;
}
}

View File

@@ -0,0 +1,9 @@
class A {
public void demo(String val){
if ("test1".equals(val)){
//do somethign
} else if (<selection>"test2"</selection>.equals(val)) {
//... something else
}
}
}

View File

@@ -0,0 +1,6 @@
import junit.framework.TestCase;
public class T extends TestCase {
public void test() {
int <caret>i = 9;
}
}

View File

@@ -0,0 +1,6 @@
import junit.framework.TestCase;
public class T extends TestCase {
public void setUp() {
int <caret>i = 9;
}
}

View File

@@ -0,0 +1,13 @@
public class FieldTest {
private Object comboBox;
private class NoSelectionComboItem {
private NoSelectionComboItem() {
}
public String getLabel() {
Object comboItem = <selection>comboBox</selection>.getSelectedItem();
return comboItem == this ? "<Please Select>" : "<Back to overview>";
}
}
}

View File

@@ -0,0 +1,13 @@
import junit.framework.TestCase;
class Base extends TestCase {
public void setUp() {
super.setUp();
}
}
public class T extends Base {
public void test() {
int <caret>i = 9;
}
}