From 59ffb7d529245c3bd0233dbf6cb0ae9fe9ccb856 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Sun, 3 Feb 2019 06:09:34 -0600 Subject: Approval Batch, prep better JUnit Issue-ID: AAF-740 Change-Id: Id9e8ca121c9bf92c2f98c7a61631e2417bba70b1 Signed-off-by: Instrumental --- misc/env/src/main/java/org/onap/aaf/misc/env/Env.java | 2 +- misc/env/src/main/java/org/onap/aaf/misc/env/TimeTaken.java | 5 ++++- .../src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java | 11 ++++++----- .../src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java | 8 ++++---- .../src/main/java/org/onap/aaf/misc/env/impl/BasicTrans.java | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) (limited to 'misc/env/src/main') 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 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