mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
test++
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import org.junit.*;
|
||||
public class T {
|
||||
private int i;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp(){
|
||||
i = 9;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import junit.framework.TestCase;
|
||||
public class T extends TestCase {
|
||||
private int i;
|
||||
|
||||
public void setUp() {
|
||||
i = 9;
|
||||
}
|
||||
}
|
||||
@@ -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>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import org.junit.*;
|
||||
public class T {
|
||||
@Test
|
||||
public void test() {
|
||||
int <caret>i = 9;
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp(){}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.junit.*;
|
||||
public class T {
|
||||
@Test
|
||||
public void test() {
|
||||
int <caret>i = 9;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import org.junit.Test;
|
||||
public class T {
|
||||
@Test
|
||||
public void test() {
|
||||
int <caret>i = 9;
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import junit.framework.TestCase;
|
||||
public class T extends TestCase {
|
||||
public void test() {
|
||||
int <caret>i = 9;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import junit.framework.TestCase;
|
||||
public class T extends TestCase {
|
||||
public void setUp() {
|
||||
int <caret>i = 9;
|
||||
}
|
||||
}
|
||||
@@ -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>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user