Skip to content

Commit

Permalink
Reorganize test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
zxh0 committed Oct 14, 2019
1 parent ca86f5e commit 476f6a3
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 34 deletions.
13 changes: 7 additions & 6 deletions test/testclasses/src/main/java/UnitTests.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import helper.UnitTestRunner;
import jvm8.InterfaceMethodTest;

public class UnitTests {

Expand Down Expand Up @@ -28,12 +29,12 @@ public static void main(String[] args) {
stdlib.basic.thread.MainThreadTest.class,
stdlib.basic.thread.SleepTest.class,
stdlib.basic.wrapper.DoubleTest.class,
//jvm.java8.InterfaceDefaultMethodTest.class,
jvm.java8.InterfaceMethodTest.class,
jvm.jls8.ch12.Eg12_4_1_1.class,
jvm.jls8.ch12.Eg12_4_1_2.class,
jvm.jls8.ch12.Eg12_4_1_3.class,
jvm.jls8.ch12.Eg12_5_2.class,
//jvm8.InterfaceDefaultMethodTest.class,
InterfaceMethodTest.class,
jls8.ch12.Eg12_4_1_1.class,
jls8.ch12.Eg12_4_1_2.class,
jls8.ch12.Eg12_4_1_3.class,
jls8.ch12.Eg12_5_2.class,
thirdparty.gson.GsonTest.class
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.jls8;
package jls8;

import java.io.PrintWriter;
import java.io.StringWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jvm.jls8.ch12;
package jls8.ch12;

import jvm.jls8.StringOut;
import jls8.StringOut;
import helper.UnitTestRunner;
import org.junit.Test;
import static org.junit.Assert.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.jls8.ch12;
package jls8.ch12;

import helper.UnitTestRunner;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jvm.jls8.ch12;
package jls8.ch12;

import jvm.jls8.StringOut;
import jls8.StringOut;
import helper.UnitTestRunner;
import org.junit.Test;
import static org.junit.Assert.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package jvm.jls8.ch12;
package jls8.ch12;

import jvm.jls8.StringOut;
import jls8.StringOut;
import helper.UnitTestRunner;
import static org.junit.Assert.*;

Expand Down
12 changes: 0 additions & 12 deletions test/testclasses/src/main/java/jvm/java8/LambdaTest.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.java7.jsr292;
package jvm7.jsr292;

import helper.ReflectionHelper;
import helper.UnitTestRunner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.java7.jsr292;
package jvm7.jsr292;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.java7.jsr292;
package jvm7.jsr292;

import java.lang.invoke.MethodType;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.java8;
package jvm8;

import junit.framework.Assert;
import helper.UnitTestRunner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jvm.java8;
package jvm8;

import helper.UnitTestRunner;
import org.junit.Test;
Expand Down
10 changes: 10 additions & 0 deletions test/testclasses/src/main/java/jvm8/LambdaTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package jvm8;

public class LambdaTest {

public static void main(String[] args) {
Runnable r = () -> System.out.println("Hello, World!");
r.run();
}

}
11 changes: 8 additions & 3 deletions test/testclasses/src/main/java/stdlib/net/UrlTest.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package stdlib.net;

import java.io.InputStream;
import java.net.URL;

public class UrlTest {

public static void main(String[] args) throws Exception {
URL url = new URL("http://cn.bing.com");
url.openStream();
try (InputStream is = url.openStream()) {
byte[] bytes = new byte[is.available()];
int n = is.read(bytes);
System.out.println(new String(bytes));
}
System.out.println("OK!");
}

}

0 comments on commit 476f6a3

Please sign in to comment.