Skip to content

Commit 3cd871a

Browse files
committed
Clean up tests
1 parent 72e971e commit 3cd871a

File tree

8 files changed

+37
-209
lines changed

8 files changed

+37
-209
lines changed

src/test/java/ca/weblite/AppTest.java

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,14 @@
11
package ca.weblite.objc;
22

3-
import org.junit.After;
4-
import org.junit.AfterClass;
5-
import org.junit.Before;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
83
import static org.junit.Assert.*;
9-
import static ca.weblite.objc.RuntimeUtils.*;
4+
5+
import org.junit.Test;
106

117
/**
128
*
139
* @author shannah
1410
*/
1511
public class ClientTest {
16-
17-
public ClientTest() {
18-
}
19-
20-
@BeforeClass
21-
public static void setUpClass() {
22-
}
23-
24-
@AfterClass
25-
public static void tearDownClass() {
26-
}
27-
28-
@Before
29-
public void setUp() {
30-
}
31-
32-
@After
33-
public void tearDown() {
34-
}
35-
3612
/**
3713
* Test of objc_lookUpClass method, of class Runtime.
3814
*/
@@ -52,16 +28,6 @@ public void testObjc_lookUpClass() {
5228

5329
String lastString = array.sendString("lastObject");
5430
assertEquals("Test String", lastString);
55-
56-
57-
58-
59-
6031
}
6132

62-
63-
64-
65-
66-
6733
}

src/test/java/ca/weblite/objc/LoadNibSample.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package ca.weblite.objc;
22

3-
import ca.weblite.objc.Client;
4-
import ca.weblite.objc.NSObject;
5-
import ca.weblite.objc.Proxy;
6-
import ca.weblite.objc.annotations.Msg;
73
import static ca.weblite.objc.RuntimeUtils.*;
84

5+
import ca.weblite.objc.annotations.Msg;
6+
97
/**
108
*
119
* @author shannah
@@ -94,9 +92,6 @@ public void startApplication(){
9492

9593
app.send("run");
9694

97-
98-
99-
10095
}
10196
public static void main(String[] args){
10297
//NativeLibrary library = NativeLibrary.getInstance("AppKit");

src/test/java/ca/weblite/objc/NSObjectTest.java

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
package ca.weblite.objc;
22

3-
import org.junit.After;
4-
import org.junit.AfterClass;
5-
import org.junit.Before;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
8-
import static org.junit.Assert.*;
93
import static ca.weblite.objc.RuntimeUtils.*;
10-
import ca.weblite.objc.annotations.Msg;
4+
import static org.junit.Assert.*;
5+
6+
import java.util.List;
7+
8+
import org.junit.Test;
9+
1110
import com.sun.jna.Pointer;
1211
import com.sun.jna.Structure;
13-
import com.sun.jna.ptr.PointerByReference;
14-
import java.util.Arrays;
15-
import java.util.List;
12+
13+
import ca.weblite.objc.annotations.Msg;
1614

1715
/**
1816
*
@@ -29,31 +27,10 @@ public static class ByValue extends NSRange implements Structure.ByValue{}
2927

3028

3129
@Override
32-
protected List getFieldOrder() {
33-
return Arrays.asList(new String[]{"location","length"});
30+
protected List<String> getFieldOrder() {
31+
return List.of("location","length");
3432
}
3533
}
36-
37-
38-
public NSObjectTest() {
39-
}
40-
41-
@BeforeClass
42-
public static void setUpClass() {
43-
}
44-
45-
@AfterClass
46-
public static void tearDownClass() {
47-
}
48-
49-
@Before
50-
public void setUp() {
51-
52-
}
53-
54-
@After
55-
public void tearDown() {
56-
}
5734

5835
/**
5936
* Test of load method, of class Proxy.

src/test/java/ca/weblite/objc/ProxyTest.java

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
package ca.weblite.objc;
22

3-
import org.junit.After;
4-
import org.junit.AfterClass;
5-
import org.junit.Before;
6-
import org.junit.BeforeClass;
7-
import org.junit.Test;
8-
import static org.junit.Assert.*;
93
import static ca.weblite.objc.RuntimeUtils.*;
10-
import ca.weblite.objc.annotations.Msg;
4+
import static org.junit.Assert.*;
5+
6+
import java.util.List;
7+
8+
import org.junit.Test;
9+
1110
import com.sun.jna.Pointer;
1211
import com.sun.jna.Structure;
13-
import com.sun.jna.ptr.PointerByReference;
14-
import java.util.Arrays;
15-
import java.util.List;
1612

1713
/**
1814
*
@@ -29,31 +25,10 @@ public static class ByValue extends NSRange implements Structure.ByValue{}
2925

3026

3127
@Override
32-
protected List getFieldOrder() {
33-
return Arrays.asList(new String[]{"location","length"});
28+
protected List<String> getFieldOrder() {
29+
return List.of("location","length");
3430
}
3531
}
36-
37-
38-
public ProxyTest() {
39-
}
40-
41-
@BeforeClass
42-
public static void setUpClass() {
43-
}
44-
45-
@AfterClass
46-
public static void tearDownClass() {
47-
}
48-
49-
@Before
50-
public void setUp() {
51-
52-
}
53-
54-
@After
55-
public void tearDown() {
56-
}
5732

5833
/**
5934
* Test of load method, of class Proxy.
@@ -112,7 +87,4 @@ public void testNSArray() {
11287

11388
}
11489

115-
116-
117-
11890
}

src/test/java/ca/weblite/objc/RuntimeTest.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
package ca.weblite.objc;
22

3-
import static org.junit.Assert.assertEquals;
3+
import static org.junit.Assert.*;
44

5-
import org.junit.After;
6-
import org.junit.AfterClass;
7-
import org.junit.Before;
8-
import org.junit.BeforeClass;
95
import org.junit.Test;
106

117
import com.sun.jna.Pointer;
@@ -15,25 +11,6 @@
1511
* @author shannah
1612
*/
1713
public class RuntimeTest {
18-
19-
public RuntimeTest() {
20-
}
21-
22-
@BeforeClass
23-
public static void setUpClass() {
24-
}
25-
26-
@AfterClass
27-
public static void tearDownClass() {
28-
}
29-
30-
@Before
31-
public void setUp() {
32-
}
33-
34-
@After
35-
public void tearDown() {
36-
}
3714

3815
/**
3916
* Test of objc_lookUpClass method, of class Runtime.

src/test/java/ca/weblite/objc/RuntimeUtilsTest.java

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,17 @@
11
package ca.weblite.objc;
22

3-
import com.sun.jna.Pointer;
4-
import org.junit.After;
5-
import org.junit.AfterClass;
6-
import org.junit.Before;
7-
import org.junit.BeforeClass;
8-
import org.junit.Test;
9-
import static org.junit.Assert.*;
103
import static ca.weblite.objc.RuntimeUtils.*;
4+
import static org.junit.Assert.*;
5+
6+
import org.junit.Test;
7+
8+
import com.sun.jna.Pointer;
119

1210
/**
1311
*
1412
* @author shannah
1513
*/
1614
public class RuntimeUtilsTest {
17-
18-
public RuntimeUtilsTest() {
19-
}
20-
21-
@BeforeClass
22-
public static void setUpClass() {
23-
}
24-
25-
@AfterClass
26-
public static void tearDownClass() {
27-
}
28-
29-
@Before
30-
public void setUp() {
31-
}
32-
33-
@After
34-
public void tearDown() {
35-
}
3615

3716
/**
3817
* Test of objc_lookUpClass method, of class Runtime.
@@ -135,7 +114,7 @@ public void testObjc_lookUpClass3() {
135114
);
136115

137116
// Confirm that this is a pointer to an NSString
138-
long res = (long)msg(new Pointer(nsString), "isKindOfClass:", cls("NSString"));
117+
long res = msg(new Pointer(nsString), "isKindOfClass:", cls("NSString"));
139118
assertEquals(1L, res);
140119

141120

@@ -181,7 +160,4 @@ public void testObjc_lookUpClass3() {
181160

182161
}
183162

184-
185-
186-
187163
}

src/test/java/ca/weblite/objc/TestWebView.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
package ca.weblite.objc;
22

33
import static ca.weblite.objc.RuntimeUtils.*;
4-
import ca.weblite.objc.annotations.Msg;
4+
5+
import javax.swing.JFrame;
6+
57
import com.sun.jna.Library;
68
import com.sun.jna.Native;
79

8-
import javax.swing.JFrame;
10+
import ca.weblite.objc.annotations.Msg;
11+
912
/**
1013
*
1114
* @author shannah
1215
*/
1316
public class TestWebView extends NSObject {
1417

1518
// JNA interface for webkit framework
16-
public static interface WebKit extends Library {
17-
public final static TestWebView.WebKit INSTANCE = (TestWebView.WebKit)Native.loadLibrary("WebKit", TestWebView.WebKit.class);
19+
public interface WebKit extends Library {
20+
TestWebView.WebKit INSTANCE = Native.loadLibrary("WebKit", TestWebView.WebKit.class);
1821
}
1922

2023
public TestWebView(){
@@ -43,7 +46,7 @@ public void myInit(){
4346

4447
// Get the webView in the window and load a URL in it
4548
Proxy webView = window.sendProxy("webView");
46-
webView.send("setMainFrameURL:", "http://www.google.com");
49+
webView.send("setMainFrameURL:", "https://www.google.com");
4750

4851
}
4952

0 commit comments

Comments
 (0)