summaryrefslogtreecommitdiffstats
path: root/cadi/core/src/test
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-04-03 21:30:32 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-04-03 21:30:38 -0500
commitabf7c0e407c97250c07d408c314c5aa1c757263e (patch)
treebf37f2b5872c4f8f756a3b2a08abf907ec1c6ce1 /cadi/core/src/test
parenta88f56fb9096afa3d48ff9d71190cec49d2b6673 (diff)
Create method of Logging to O/S from Container
Issue-ID: AAF-211 Change-Id: Ib5c369c24082823f6f8cfde7609b966f57085665 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'cadi/core/src/test')
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java2
-rw-r--r--cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java27
2 files changed, 25 insertions, 4 deletions
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java
index d62144ce..98903567 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java
@@ -44,7 +44,7 @@ public class JU_Access {
assertThat(Level.DEBUG.delFromMask(0x1), is(0x0));
assertThat(Level.DEBUG.toggle(0x2), is(0x3));
assertThat(Level.DEBUG.toggle(0x1), is(0x0));
- assertThat(Level.DEBUG.maskOf(), is(57617));
+ assertThat(Level.DEBUG.maskOf(), is(123153));
assertThat(Level.NONE.maskOf(), is(0));
}
diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java
index 533fe91f..b2820db2 100644
--- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java
+++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java
@@ -32,6 +32,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
@@ -42,6 +43,7 @@ import java.util.Properties;
import org.onap.aaf.cadi.CmdLine;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.Symm;
+import org.onap.aaf.cadi.util.Chmod;
public class JU_CmdLine {
@@ -67,11 +69,30 @@ public class JU_CmdLine {
p.setProperty("force_exit", "false");
CmdLine.access = new PropAccess(p);
-
- password = "password";
+ File test = new File("test");
+ if(test.exists()) {
+ if(!test.isDirectory()) {
+ test.delete();
+ test.mkdirs();
+ }
+ } else {
+ test.mkdirs();
+ }
+
+ File keyF= new File(test,"keyfile");
+ if(!keyF.exists()) {
+ FileOutputStream fos = new FileOutputStream(keyF);
+ try {
+ fos.write(Symm.keygen());
+ fos.flush();
+ } finally {
+ fos.close();
+ }
+ }
keyfile = "test/keyfile";
+ password = "password";
- FileInputStream fis = new FileInputStream(keyfile);
+ FileInputStream fis = new FileInputStream(keyF);
try {
symm = Symm.obtain(fis);
} finally {