Skip to content

Commit

Permalink
Merge pull request #19 from hashicorp/test-resources
Browse files Browse the repository at this point in the history
Added example python and java apps for testing
  • Loading branch information
cbednarski committed Sep 8, 2015
2 parents 8a02dbc + 2901c19 commit 6fed1ba
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/driver/test-resources/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM python
ADD main.py main.py
ENV PYTHONUNBUFFERED=1
CMD ["python", "main.py"]
17 changes: 17 additions & 0 deletions client/driver/test-resources/docker/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import signal
import time

# Setup handler for sigterm so we can exit when docker stop is called.
def term(signum, stack_Frame):
exit(1)

signal.signal(signal.SIGTERM, term)

print ("Starting")

max = 3
for i in range(max):
time.sleep(1)
print("Heartbeat {0}/{1}".format(i + 1, max))

print("Exiting")
Binary file added client/driver/test-resources/java/demoapp.jar
Binary file not shown.
12 changes: 12 additions & 0 deletions client/driver/test-resources/java/demoapp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Hello {
public static void main(String[] args) {
while (true) {
System.out.println("Hi");
try {
Thread.sleep(1000); //1000 milliseconds is one second.
} catch(InterruptedException ex) {
Thread.currentThread().interrupt();
}
}
}
}

0 comments on commit 6fed1ba

Please sign in to comment.