Skip to content

Commit

Permalink
Might work now with gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Eckel committed Jul 7, 2016
1 parent ca25b1a commit 04f961c
Show file tree
Hide file tree
Showing 85 changed files with 199 additions and 2,660 deletions.
7 changes: 2 additions & 5 deletions annotations/AtUnitComposition.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating non-embedded tests
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitComposition.class}
package annotations;
import onjava.atunit.*;
import onjava.*;
Expand All @@ -16,11 +18,6 @@ public class AtUnitComposition {
@Test boolean _methodTwo() {
return testObject.methodTwo() == 2;
}
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitComposition.class");
}
}
/* Output:
annotations.AtUnitComposition
Expand Down
7 changes: 2 additions & 5 deletions annotations/AtUnitExample1.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExample1.class}
package annotations;
import onjava.atunit.*;
import onjava.*;
Expand All @@ -22,11 +24,6 @@ public int methodTwo() {
// Shows output for failure:
@Test boolean failureTest() { return false; }
@Test boolean anotherDisappointment() { return false; }
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExample1.class");
}
}
/* Output:
annotations.AtUnitExample1
Expand Down
7 changes: 2 additions & 5 deletions annotations/AtUnitExample2.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Assertions and exceptions can be used in @Tests
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExample2.class}
package annotations;
import java.io.*;
import onjava.atunit.*;
Expand Down Expand Up @@ -30,11 +32,6 @@ public int methodTwo() {
assert methodTwo() == 2: "methodTwo must equal 2";
return methodOne().equals("This is methodOne");
}
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExample2.class");
}
}
/* Output:
annotations.AtUnitExample2
Expand Down
7 changes: 2 additions & 5 deletions annotations/AtUnitExample3.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExample3.class}
package annotations;
import onjava.atunit.*;
import onjava.*;
Expand All @@ -25,11 +27,6 @@ public int methodTwo() {
return methodOne().equals("This is methodOne");
}
@Test boolean m2() { return methodTwo() == 2; }
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExample3.class");
}
}
/* Output:
annotations.AtUnitExample3
Expand Down
8 changes: 2 additions & 6 deletions annotations/AtUnitExample4.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExample4.class}
package annotations;
import java.util.*;
import onjava.atunit.*;
Expand Down Expand Up @@ -53,12 +55,6 @@ public String scrambleWord() {
System.out.println(scrambled);
return scrambled.equals("tsaeborornussu");
}
public static void
main(String[] args) throws Exception {
System.out.println("starting");
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExample4.class");
}
}
/* Output:
starting
Expand Down
7 changes: 2 additions & 5 deletions annotations/AtUnitExample5.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExample5.class}
package annotations;
import java.io.*;
import onjava.atunit.*;
Expand Down Expand Up @@ -40,11 +42,6 @@ public class AtUnitExample5 {
output.print("test3");
return true;
}
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExample5.class");
}
}
/* Output:
annotations.AtUnitExample5
Expand Down
7 changes: 2 additions & 5 deletions annotations/AtUnitExternalTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Creating non-embedded tests
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/AtUnitExternalTest.class}
package annotations;
import onjava.atunit.*;
import onjava.*;
Expand All @@ -12,11 +14,6 @@ public class AtUnitExternalTest extends AtUnitExample1 {
return methodOne().equals("This is methodOne");
}
@Test boolean _methodTwo() { return methodTwo() == 2; }
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit AtUnitExternalTest.class");
}
}
/* Output:
annotations.AtUnitExternalTest
Expand Down
7 changes: 2 additions & 5 deletions annotations/HashSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/HashSetTest.class}
package annotations;
import java.util.*;
import onjava.atunit.*;
Expand All @@ -21,11 +23,6 @@ public class HashSetTest {
testObject.remove("one");
assert testObject.isEmpty();
}
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit HashSetTest.class");
}
}
/* Output:
annotations.HashSetTest
Expand Down
7 changes: 2 additions & 5 deletions annotations/StackLStringTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Applying @Unit to generics
// {main: onjava.atunit.AtUnit}
// {Args: build/classes/main/annotations/StackLStringTest.class}
package annotations;
import onjava.atunit.*;
import onjava.*;
Expand All @@ -26,11 +28,6 @@ public class StackLStringTest extends StackL<String> {
assert top().equals("B");
assert top().equals("B");
}
public static void
main(String[] args) throws Exception {
OSExecute.command("java -cp .. " +
"onjava.atunit.AtUnit StackLStringTest.class");
}
}
/* Output:
annotations.StackLStringTest
Expand Down
42 changes: 0 additions & 42 deletions annotations/build.xml

This file was deleted.

1 change: 1 addition & 0 deletions annotations/database/TableCreator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Reflection-based annotation processor
// {main: annotations.database.TableCreator}
// {Args: annotations.database.Member}
package annotations.database;
import java.lang.annotation.*;
Expand Down
1 change: 1 addition & 0 deletions annotations/ifx/Multiplier.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// javac-based annotation processing
// {main: annotations.ifx.Multiplier}
package annotations.ifx;

@ExtractInterface(interfaceName="IMultiplier")
Expand Down
1 change: 1 addition & 0 deletions annotations/simplest/SimpleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Test the "Simple" annotation
// {main: annotations.simplest.SimpleTest}
package annotations.simplest;

@Simple
Expand Down
4 changes: 0 additions & 4 deletions appveyor.yml

This file was deleted.

88 changes: 0 additions & 88 deletions arrays/build.xml

This file was deleted.

3 changes: 2 additions & 1 deletion assertions/Assert1.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Non-informative style of assert
// {JVMArgs: -ea} // Must run with -ea
// Must run with -ea:
// {JVMArgs: -ea}
// {ThrowsException}

public class Assert1 {
Expand Down
3 changes: 3 additions & 0 deletions assertions/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies {
compile 'junit:junit:4.12'
}
24 changes: 0 additions & 24 deletions assertions/build.xml

This file was deleted.

Loading

0 comments on commit 04f961c

Please sign in to comment.