Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BeatWolf committed Oct 15, 2018
1 parent d3f46c8 commit 507be53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class POPJavaDeamon implements Runnable, Closeable {

private String password = "";

private static final String BACKUP_JAR = "build/popjava.jar";
public static final String BACKUP_JAR = "build/popjava.jar";

public static final String ERROR_PWD = "ERROR PASS";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;

import org.junit.Assume;
import org.junit.Test;

import ch.icosys.popjava.core.PopJava;
Expand All @@ -20,6 +22,7 @@ public class DeamonTest {
*/
@Test
public void testDynamicCreationFail() {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();

try {
Expand All @@ -33,6 +36,7 @@ public void testDynamicCreationFail() {
}

private static POPJavaDeamon startDeamon(String password) throws InterruptedException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
final POPJavaDeamon deamon = new POPJavaDeamon(password);
Thread thread = new Thread(new Runnable() {

Expand All @@ -51,6 +55,7 @@ public void run() {

@Test
public void testSuccess() throws IOException, InterruptedException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();

POPJavaDeamon deamon = startDeamon("");
Expand All @@ -65,6 +70,7 @@ public void testSuccess() throws IOException, InterruptedException {

@Test
public void testDynamicCreation() throws IOException, InterruptedException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();
POPJavaDeamon deamon = startDeamon("");
TestClass test = PopJava.newActive(this, TestClass.class, ConnectionType.DAEMON, "");
Expand All @@ -79,6 +85,7 @@ public void testDynamicCreation() throws IOException, InterruptedException {

@Test
public void testDynamicCreationPassword() throws IOException, InterruptedException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();
String password = "12345";
POPJavaDeamon deamon = startDeamon(password);
Expand All @@ -93,6 +100,7 @@ public void testDynamicCreationPassword() throws IOException, InterruptedExcepti

@Test
public void testDynamicCreationPasswordMissmatch() throws IOException, InterruptedException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();
String password = "12345";
POPJavaDeamon deamon = startDeamon(password);
Expand All @@ -111,6 +119,7 @@ public void testDynamicCreationPasswordMissmatch() throws IOException, Interrupt

@Test
public void testMultiObjectCreation() throws InterruptedException, IOException {
Assume.assumeTrue(new File(POPJavaDeamon.BACKUP_JAR).exists());
POPSystem.initialize();
String password = "12345";
POPJavaDeamon deamon = startDeamon(password);
Expand Down

0 comments on commit 507be53

Please sign in to comment.