Skip to content

Commit

Permalink
Improve DirectoryTarResourceTest to use synthetic JAR
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Apr 10, 2017
1 parent 52fcaf0 commit 577f1cc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void simpleRecursiveClasspathResourceTest() throws TimeoutException {
.copy("/tmp/foo", "/foo")
.cmd("ls -lRt /foo")
.build()
).withFileFromClasspath("/tmp/foo", "/org/junit")) // here we use /org/junit as a directory that really should exist on the classpath
).withFileFromClasspath("/tmp/foo", "/recursive/dir")) // here we use /org/junit as a directory that really should exist on the classpath
.withStartupCheckStrategy(new OneShotStartupCheckStrategy())
.withLogConsumer(wait.andThen(toString));

Expand All @@ -66,6 +66,6 @@ public void simpleRecursiveClasspathResourceTest() throws TimeoutException {
final String results = toString.toUtf8String();

// ExternalResource.class is known to exist in a subdirectory of /org/junit so should be successfully copied in
assertTrue("The container has a file that was copied in via a recursive copy from a JAR resource", results.contains("ExternalResource.class"));
assertTrue("The container has a file that was copied in via a recursive copy from a JAR resource", results.contains("content.txt"));
}
}
2 changes: 1 addition & 1 deletion testlib/create_fakejar.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

rm fakejar.jar
zip -r fakejar.jar META-INF
zip -r fakejar.jar META-INF/ recursive/
Binary file modified testlib/fakejar.jar
Binary file not shown.
1 change: 1 addition & 0 deletions testlib/recursive/dir/content.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is example content to show recursive mounting of files from inside a JAR archive.

0 comments on commit 577f1cc

Please sign in to comment.