Skip to content

Commit 256949d

Browse files
Adding more classpath tests
1 parent 7470cb4 commit 256949d

File tree

28 files changed

+159
-0
lines changed

28 files changed

+159
-0
lines changed
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.diffblue;
2+
3+
class Test
4+
{
5+
public static void main(String[] args)
6+
{
7+
assert true;
8+
}
9+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath src
4+
--
5+
Java main class: Test
6+
failed to open input file `Test.class'
7+
--
8+
Test.class is not in the right directory corresponding to its package.
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
assert false;
6+
}
7+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
assert true;
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
--classpath src
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
Test.class
3+
--classpath wrong
4+
^EXIT=6$
5+
^SIGNAL=0$
6+
the program has no entry point
7+
--
8+
--
9+
We override the default path. Hence, Test cannot be found.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
KNOWNBUG
2+
src/Test.class
3+
4+
--
5+
Parsing src/Test.class
6+
--
7+
Test class is not in src package. Therefore, this must fail.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.diffblue;
2+
3+
class Test
4+
{
5+
public static void main(String[] args)
6+
{
7+
assert true;
8+
}
9+
}
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath test.jar
4+
--
5+
Java main class: Test
6+
failed to open input file `Test.class'
7+
--
8+
Test.class is not in the right directory corresponding to its package.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
test.jar
3+
--main-class Test.class
4+
--
5+
Java main class: Test
6+
failed to open input file `Test.class'
7+
--
8+
Test.class is not in the right directory corresponding to its package.
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
Test2.foo();
6+
assert true;
7+
}
8+
}
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test2
2+
{
3+
public static void foo()
4+
{
5+
assert false;
6+
}
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
Test.class
3+
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
Test2 is found because . is default classpath.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
Test2.class
4+
^EXIT=6$
5+
--
6+
Invariant check failed
7+
--
8+
We don't allow two classes passed on the command line.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Test
2+
{
3+
public static void main(String[] args)
4+
{
5+
Test2.foo();
6+
assert true;
7+
}
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Test2
2+
{
3+
public static void foo()
4+
{
5+
assert false;
6+
}
7+
}
Binary file not shown.
Binary file not shown.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
libs/test.jar
3+
--main-class Test --classpath lib/test2.jar
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
This is a correct way of dealing with two jars.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
lib/test2.jar
3+
--main-class Test --classpath libs/test.jar
4+
^EXIT=10$
5+
^VERIFICATION FAILED$
6+
--
7+
--
8+
This is a correct way of dealing with two jars.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
KNOWNBUG
2+
libs/test.jar
3+
lib/test2.jar --main-class Test.class
4+
^EXIT=6$
5+
--
6+
Invariant check failed
7+
the program has no entry point
8+
--
9+
We don't allow two jar files passed on the command line.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
KNOWNBUG
2+
Test.class
3+
--classpath libs/test.jar:lib/test2.jar
4+
^EXIT=0$
5+
^VERIFICATION SUCCESSFUL$
6+
--
7+
--
8+
This is incorrect as it would search for a Test.class file.

0 commit comments

Comments
 (0)