mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 21:07:57 +01:00
Add documentation and fixes to AbstractExternalSOPTest
This commit is contained in:
parent
0616cde6fd
commit
104b3a4ec4
1 changed files with 28 additions and 2 deletions
|
@ -16,6 +16,7 @@ import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
||||||
|
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||||
|
|
||||||
public abstract class AbstractExternalSOPTest {
|
public abstract class AbstractExternalSOPTest {
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ public abstract class AbstractExternalSOPTest {
|
||||||
|
|
||||||
public AbstractExternalSOPTest() {
|
public AbstractExternalSOPTest() {
|
||||||
String backend = readSopBackendFromProperties();
|
String backend = readSopBackendFromProperties();
|
||||||
|
assumeTrue(backend != null);
|
||||||
Properties environment = readBackendEnvironment();
|
Properties environment = readBackendEnvironment();
|
||||||
sop = new ExternalSOP(backend, environment);
|
sop = new ExternalSOP(backend, environment);
|
||||||
}
|
}
|
||||||
|
@ -51,11 +53,33 @@ public abstract class AbstractExternalSOPTest {
|
||||||
return new File(binary).exists();
|
return new File(binary).exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Relational enum.
|
||||||
|
*/
|
||||||
public enum Is {
|
public enum Is {
|
||||||
|
/**
|
||||||
|
* Less than.
|
||||||
|
*/
|
||||||
le("<"),
|
le("<"),
|
||||||
|
/**
|
||||||
|
* Less or equal than.
|
||||||
|
*/
|
||||||
leq("<="),
|
leq("<="),
|
||||||
|
/**
|
||||||
|
* Equal.
|
||||||
|
*/
|
||||||
eq("=="),
|
eq("=="),
|
||||||
|
/**
|
||||||
|
* Not equal.
|
||||||
|
*/
|
||||||
|
neq("!="),
|
||||||
|
/**
|
||||||
|
* Greater or equal than.
|
||||||
|
*/
|
||||||
geq(">="),
|
geq(">="),
|
||||||
|
/**
|
||||||
|
* Greater than.
|
||||||
|
*/
|
||||||
ge(">"),
|
ge(">"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -105,6 +129,9 @@ public abstract class AbstractExternalSOPTest {
|
||||||
case eq:
|
case eq:
|
||||||
assumeFalse(res == 0, msg);
|
assumeFalse(res == 0, msg);
|
||||||
break;
|
break;
|
||||||
|
case neq:
|
||||||
|
assumeFalse(res != 0, msg);
|
||||||
|
break;
|
||||||
case geq:
|
case geq:
|
||||||
assumeFalse(res >= 0, msg);
|
assumeFalse(res >= 0, msg);
|
||||||
break;
|
break;
|
||||||
|
@ -127,8 +154,7 @@ public abstract class AbstractExternalSOPTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
properties.load(resourceIn);
|
properties.load(resourceIn);
|
||||||
String backend = properties.getProperty("sop.backend");
|
return properties.getProperty("sop.backend");
|
||||||
return backend;
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue