diff options
Diffstat (limited to 'cadi/core/src/test')
-rw-r--r-- | cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_Access.java | 2 | ||||
-rw-r--r-- | cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_CmdLine.java | 27 |
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 { |