@Test public void testAsyncEntryNormalPass() { String resourceName = "testAsyncEntryNormalPass"; ResourceWrapper resourceWrapper = new StringResourceWrapper(resourceName, EntryType.IN); AsyncEntry entry = null; ShouldPassSlot slot = addShouldPassSlotFor(resourceWrapper); assertFalse(slot.entered || slot.exited); ContextUtil.enter("abc"); Entry previousEntry = ContextUtil.getContext().getCurEntry(); try { entry = ctSph.asyncEntry(resourceName, EntryType.IN, 1); assertTrue(slot.entered); assertFalse(slot.exited); Context asyncContext = entry.getAsyncContext(); assertNotNull(asyncContext); assertSame(entry, asyncContext.getCurEntry()); assertNotSame("The async entry should not be added to current context", entry, ContextUtil.getContext().getCurEntry()); assertSame(previousEntry, ContextUtil.getContext().getCurEntry()); } catch (BlockException ex) { fail("Unexpected blocked: " + ex.getClass().getCanonicalName()); } finally { if (entry != null) { Context asyncContext = entry.getAsyncContext(); entry.exit(); assertTrue(slot.exited); assertNull(entry.getAsyncContext()); assertSame(previousEntry, asyncContext.getCurEntry()); } ContextUtil.exit(); } }
@Override public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException { StringResourceWrapper resource = new StringResourceWrapper(name, type); return asyncEntryInternal(resource, count, args); }
CtSph implements Sph { @Override public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException { StringResourceWrapper resource = new StringResourceWrapper(name, type); return asyncEntryInternal(resource, count, args); } }
CtSph implements Sph { @Override public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException { StringResourceWrapper resource = new StringResourceWrapper(name, type); return asyncEntryInternal(resource, count, args); }  }
CtSph implements Sph { @Override public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException { StringResourceWrapper resource = new StringResourceWrapper(name, type); return asyncEntryInternal(resource, count, args); }  Entry entry(ResourceWrapper resourceWrapper, int count, Object... args); static int entrySize(); @Override Entry entry(String name); @Override Entry entry(Method method); @Override Entry entry(Method method, EntryType type); @Override Entry entry(String name, EntryType type); @Override Entry entry(Method method, EntryType type, int count); @Override Entry entry(String name, EntryType type, int count); @Override Entry entry(Method method, int count); @Override Entry entry(String name, int count); @Override Entry entry(Method method, EntryType type, int count, Object... args); @Override Entry entry(String name, EntryType type, int count, Object... args); @Override AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args); @Override Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized); @Override Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized, Object... args); }
CtSph implements Sph { @Override public AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args) throws BlockException { StringResourceWrapper resource = new StringResourceWrapper(name, type); return asyncEntryInternal(resource, count, args); }  Entry entry(ResourceWrapper resourceWrapper, int count, Object... args); static int entrySize(); @Override Entry entry(String name); @Override Entry entry(Method method); @Override Entry entry(Method method, EntryType type); @Override Entry entry(String name, EntryType type); @Override Entry entry(Method method, EntryType type, int count); @Override Entry entry(String name, EntryType type, int count); @Override Entry entry(Method method, int count); @Override Entry entry(String name, int count); @Override Entry entry(Method method, EntryType type, int count, Object... args); @Override Entry entry(String name, EntryType type, int count, Object... args); @Override AsyncEntry asyncEntry(String name, EntryType type, int count, Object... args); @Override Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized); @Override Entry entryWithPriority(String name, EntryType type, int count, boolean prioritized, Object... args);  }