public void setTrace(boolean trace) { if (trace) getProfiler(); this.trace = trace; }
public int prepare (long id, Serializable o) { if (o instanceof Context) ((Context)o).getProfiler(); return PREPARED | NO_JOIN | READONLY; } public void commit (long id, Serializable o) { }
/** * add a checkpoint to the profiler */ public void checkPoint (String detail) { getProfiler().checkPoint (detail); } public void setPausedTransaction (PausedTransaction p) {
/** * puts an Object in the transient Map */ public void put (Object key, Object value) { if (trace) { getProfiler().checkPoint( String.format("%s='%s' [%s]", getKeyName(key), value, Caller.info(1)) ); } getMap().put (key, value); synchronized (this) { notifyAll(); } } /**
/** * puts an Object in the transient Map */ public void put (Object key, Object value, boolean persist) { if (trace) { getProfiler().checkPoint( String.format("%s(P)='%s' [%s]", getKeyName(key), value, Caller.info(1)) ); } if (persist && value instanceof Serializable) getPMap().put (key, value); getMap().put(key, value); }
@Test public void testGet1() throws Throwable { Context context = new Context(); context.getProfiler(); Object result = context.get(Integer.valueOf(2), 100L); assertNull("result", result); }
@Test public void testGetProfiler() throws Throwable { new Context().getProfiler(); assertTrue("Test completed without Exception", true); }
@Test public void testRemove() throws Throwable { Context context = new Context(); context.getProfiler(); Object result = context.remove("testString"); assertNull("result", result); }
@Test public void testGetProfiler1() throws Throwable { Context context = new Context(); context.getPausedTransaction(); context.getProfiler(); assertTrue("Test completed without Exception", true); }