use of com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation in project pinpoint by naver.
the class DefaultScopeTest method testRemoveAttachmentFail2.
@Test(expected = IllegalStateException.class)
public void testRemoveAttachmentFail2() {
InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
transaction.tryEnter(ExecutionPolicy.ALWAYS);
transaction.canLeave(ExecutionPolicy.ALWAYS);
transaction.leave(ExecutionPolicy.ALWAYS);
transaction.removeAttachment();
}
use of com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation in project pinpoint by naver.
the class DefaultScopeTest method test1.
@Test
public void test1() {
InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
assertFalse(transaction.isActive());
assertTrue(transaction.tryEnter(ExecutionPolicy.ALWAYS));
assertTrue(transaction.isActive());
assertTrue(transaction.tryEnter(ExecutionPolicy.ALWAYS));
assertTrue(transaction.isActive());
assertTrue(transaction.canLeave(ExecutionPolicy.ALWAYS));
assertTrue(transaction.isActive());
transaction.leave(ExecutionPolicy.ALWAYS);
assertTrue(transaction.isActive());
assertTrue(transaction.canLeave(ExecutionPolicy.ALWAYS));
assertTrue(transaction.isActive());
transaction.leave(ExecutionPolicy.ALWAYS);
assertFalse(transaction.isActive());
}
use of com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation in project pinpoint by naver.
the class DefaultScopeTest method testAttachment2.
@Test
public void testAttachment2() {
String attachment = "context";
InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
transaction.tryEnter(ExecutionPolicy.ALWAYS);
assertNull(transaction.getAttachment());
transaction.setAttachment(attachment);
transaction.canLeave(ExecutionPolicy.ALWAYS);
transaction.leave(ExecutionPolicy.ALWAYS);
transaction.tryEnter(ExecutionPolicy.ALWAYS);
assertNull(transaction.getAttachment());
transaction.canLeave(ExecutionPolicy.ALWAYS);
transaction.leave(ExecutionPolicy.ALWAYS);
}
use of com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation in project pinpoint by naver.
the class DefaultScopeTest method testAttachment3.
@Test
public void testAttachment3() {
String oldAttachment = "context";
String newAttachment = "newnew";
InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
transaction.tryEnter(ExecutionPolicy.ALWAYS);
transaction.setAttachment(oldAttachment);
assertSame(oldAttachment, transaction.getAttachment());
assertSame(oldAttachment, transaction.setAttachment(newAttachment));
assertSame(newAttachment, transaction.getAttachment());
assertSame(newAttachment, transaction.removeAttachment());
assertNull(transaction.getAttachment());
transaction.canLeave(ExecutionPolicy.ALWAYS);
transaction.leave(ExecutionPolicy.ALWAYS);
}
use of com.navercorp.pinpoint.profiler.interceptor.scope.DefaultInterceptorScopeInvocation in project pinpoint by naver.
the class DefaultScopeTest method testAfterWithoutBefore3.
@Test(expected = IllegalStateException.class)
public void testAfterWithoutBefore3() {
InterceptorScopeInvocation transaction = new DefaultInterceptorScopeInvocation("test");
transaction.leave(ExecutionPolicy.INTERNAL);
}
Aggregations