summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-02-03 06:09:34 -0600
committerInstrumental <jonathan.gathman@att.com>2019-02-03 06:09:46 -0600
commit59ffb7d529245c3bd0233dbf6cb0ae9fe9ccb856 (patch)
tree48f79984b766211d0f570f50485cbe288dd2f990 /misc
parente36daf12cf4c5aa4b22fa3cec66a79ff2e2b8b94 (diff)
Approval Batch, prep better JUnit
Issue-ID: AAF-740 Change-Id: Id9e8ca121c9bf92c2f98c7a61631e2417bba70b1 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/Env.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java5
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java11
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java8
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java4
-rw-r--r--misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java3
-rw-r--r--misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java2
7 files changed, 19 insertions, 16 deletions
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/Env.java b/misc/env/src/main/java/org/onap/aaf/misc/env/Env.java
index f709a434..d6f49698 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/Env.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/Env.java
@@ -115,7 +115,7 @@ public interface Env {
* @param flag
* @return
*/
- public TimeTaken start(String name, int flag);
+ public TimeTaken start(String name, int flag, Object ... values);
public String setProperty(String tag, String value);
public String getProperty(String tag);
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java b/misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java
index 02018707..a1a81b9d 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java
@@ -39,6 +39,7 @@ public abstract class TimeTaken {
protected long end, size;
public final int flag;
public final String name;
+ public final Object[] values;
/**
* The name is as it will appear when written to output (abstract method)
@@ -47,11 +48,13 @@ public abstract class TimeTaken {
*
* @param name
* @param flag
+ * @param values
*/
- public TimeTaken(String name, int flag) {
+ public TimeTaken(String name, int flag, Object ... values) {
start = System.nanoTime();
this.flag = flag;
this.name = name;
+ this.values = values;
size = -1;
}
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
index c0e7bde7..83a049c1 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
@@ -92,22 +92,23 @@ public abstract class AbsTrans<ENV extends Env> implements TransStore {
* @param flag
* @return
*/
- protected abstract TimeTaken newTimeTaken(String name, int flag);
+ protected abstract TimeTaken newTimeTaken(String name, int flag, Object ... values);
-// @Override
- public final TimeTaken start(String name, int flag) {
- TimeTaken tt = newTimeTaken(name,flag);
+ @Override
+ public final TimeTaken start(String name, int flag, Object ... values) {
+ TimeTaken tt = newTimeTaken(name,flag, values);
trail.add(tt);
return tt;
}
-// @Override
+ @Override
public final void checkpoint(String name) {
TimeTaken tt = newTimeTaken(name,CHECKPOINT);
tt.done();
trail.add(tt);
}
+ @Override
public final void checkpoint(String name, int additionalFlag) {
TimeTaken tt = newTimeTaken(name,CHECKPOINT|additionalFlag);
trail.add(tt);
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
index 6fbfacdb..35d0034d 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
@@ -149,9 +149,9 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate<TransJAX
return trace;
}
- // @Override
- public TimeTaken start(String name, int flag) {
- return new TimeTaken(name, flag) {
+ @Override
+ public TimeTaken start(String name, int flag, Object ... values) {
+ return new TimeTaken(name, flag, values) {
/**
* Format to be printed when called upon
*/
@@ -163,7 +163,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate<TransJAX
case Env.JSON: sb.append("JSON "); break;
case Env.REMOTE: sb.append("REMOTE "); break;
}
- sb.append(name);
+ sb.append(String.format(name, values));
if (flag != Env.CHECKPOINT) {
sb.append(' ');
sb.append((end-start)/1000000f);
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java
index dbda57b5..b9c3483f 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java
@@ -36,11 +36,11 @@ public class BasicTrans extends AbsTransJAXB {
}
@Override
- protected TimeTaken newTimeTaken(String name, int flag) {
+ protected TimeTaken newTimeTaken(String name, int flag, Object ... values) {
/**
* Note: could have created a different format for Time Taken, but using BasicEnv's instead
*/
- return delegate.start(name, flag);
+ return delegate.start(name, flag, values);
}
public Slot slot(String name) {
diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java
index 572941f3..93821606 100644
--- a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java
+++ b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTrans.java
@@ -35,7 +35,6 @@ import org.onap.aaf.misc.env.Env;
import org.onap.aaf.misc.env.LogTarget;
import org.onap.aaf.misc.env.Slot;
import org.onap.aaf.misc.env.StaticSlot;
-import org.onap.aaf.misc.env.StoreImpl;
import org.onap.aaf.misc.env.TimeTaken;
public class JU_AbsTrans {
@@ -109,7 +108,7 @@ public class JU_AbsTrans {
}
@Override
- protected TimeTaken newTimeTaken(String name, int flag) {
+ protected TimeTaken newTimeTaken(String name, int flag, Object ... values) {
// TODO Auto-generated method stub
return new TimeTaken("nameTest", Env.XML) {
diff --git a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java
index 98848804..22d979fe 100644
--- a/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java
+++ b/misc/env/src/test/java/org/onap/aaf/misc/env/impl/JU_AbsTransJaxb.java
@@ -103,7 +103,7 @@ public class JU_AbsTransJaxb {
}
@Override
- protected TimeTaken newTimeTaken(String name, int flag) {
+ protected TimeTaken newTimeTaken(String name, int flag, Object ... values) {
// TODO Auto-generated method stub
return null;
}