use of com.newrelic.agent.TokenImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncStartThenLinkTest method testStartAndThenLinkExpireInMain.
@Test
public void testStartAndThenLinkExpireInMain() throws InterruptedException {
Transaction.clearTransaction();
Transaction tx = Transaction.getTransaction();
Tracer rootTracer = TransactionAsyncUtility.createDispatcherTracer(this, "hi");
tx.getTransactionActivity().tracerStarted(rootTracer);
TokenImpl token = (TokenImpl) tx.getToken();
// second expire should do nothing
StartAndThenLink activity1 = new StartAndThenLink(token, false, false);
activity1.start();
activity1.join();
rootTracer.finish(Opcodes.RETURN, 0);
token.expire();
verifyDataTwo(activity1, tx, token);
}
use of com.newrelic.agent.TokenImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncStartThenLinkTest method testStartAndThenLinkExpireAllBeforeFinish.
@Test
public void testStartAndThenLinkExpireAllBeforeFinish() throws InterruptedException {
Transaction.clearTransaction();
Transaction tx = Transaction.getTransaction();
Tracer rootTracer = TransactionAsyncUtility.createDispatcherTracer(this, "hi");
tx.getTransactionActivity().tracerStarted(rootTracer);
TokenImpl token = (TokenImpl) tx.getToken();
// second expire should do nothing
StartAndThenLink activity1 = new StartAndThenLink(token, false, false);
activity1.start();
activity1.join();
tx.expireAllTokensForCurrentTransaction();
rootTracer.finish(Opcodes.RETURN, 0);
verifyDataTwo(activity1, tx, token);
}
use of com.newrelic.agent.TokenImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncStartThenLinkTest method testStartAndThenLinkExpireBothFinishBefore.
@Test
public void testStartAndThenLinkExpireBothFinishBefore() throws InterruptedException {
Transaction.clearTransaction();
Transaction tx = Transaction.getTransaction();
Tracer rootTracer = TransactionAsyncUtility.createDispatcherTracer(this, "hi");
tx.getTransactionActivity().tracerStarted(rootTracer);
TokenImpl token = (TokenImpl) tx.getToken();
rootTracer.finish(Opcodes.RETURN, 0);
// second expire should do nothing
StartAndThenLink activity1 = new StartAndThenLink(token, true, true);
activity1.start();
activity1.join();
verifyDataTwo(activity1, tx, token);
}
use of com.newrelic.agent.TokenImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncStartThenLinkTest method testStartAndThenLinkExpireAfterFinishAfter.
@Test
public void testStartAndThenLinkExpireAfterFinishAfter() throws InterruptedException {
Transaction.clearTransaction();
Transaction tx = Transaction.getTransaction();
Tracer rootTracer = TransactionAsyncUtility.createDispatcherTracer(this, "hi");
tx.getTransactionActivity().tracerStarted(rootTracer);
TokenImpl token = (TokenImpl) tx.getToken();
StartAndThenLink activity1 = new StartAndThenLink(token, false, true);
activity1.start();
activity1.join();
rootTracer.finish(Opcodes.RETURN, 0);
verifyDataTwo(activity1, tx, token);
}
use of com.newrelic.agent.TokenImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncStartThenLinkTest method testStartAndThenLinkExpireBothFinishAfter.
@Test
public void testStartAndThenLinkExpireBothFinishAfter() throws InterruptedException {
Transaction.clearTransaction();
Transaction tx = Transaction.getTransaction();
Tracer rootTracer = TransactionAsyncUtility.createDispatcherTracer(this, "hi");
tx.getTransactionActivity().tracerStarted(rootTracer);
TokenImpl token = (TokenImpl) tx.getToken();
// second expire should do nothing
StartAndThenLink activity1 = new StartAndThenLink(token, true, true);
activity1.start();
activity1.join();
rootTracer.finish(Opcodes.RETURN, 0);
verifyDataTwo(activity1, tx, token);
}
Aggregations