Examples of AsyncActionContext


Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     *            Action parameters.
     * @return Context.
     */
    public static TaskHandlerActionContext<ActionContext> createTaskHandlerAsyncContext(final Serializable params)
    {
        return new TaskHandlerActionContextImpl<ActionContext>(new AsyncActionContext(params),
                new ArrayList<UserActionRequest>());
    }
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     * Tests performAction with exception.
     */
    @Test
    public void testValidateValid()
    {
        sut.validate(new AsyncActionContext(new CreateNotificationsRequest(RequestType.FOLLOW_PERSON, 0)));
    }
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     */
    @Test(expected = ValidationException.class)
    public void testValidateWithInvalidTranslatorType()
    {
        // Intentionally left out STREAM_POST from translators to be able to test this.
        sut.validate(new AsyncActionContext(new CreateNotificationsRequest(RequestType.POST_PERSON_STREAM, 0)));
    }
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     * Setup before each test.
     */
    @Before
    public void setUp()
    {
        asyncActionInnerContext = new AsyncActionContext(parentParam);
        serviceActionInnerContext = new ServiceActionContext(parentParam, principal);
        serviceActionInnerContextNullPrincipal = new ServiceActionContext(parentParam, null);
        userActionRequests.clear();
        mockery.checking(new Expectations()
        {
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

    @Test
    public void testExecuteWithAsycAction() throws Throwable
    {
        Serializable params = null;

        final AsyncActionContext asyncActionContext = new AsyncActionContext(params);
        transDef.setReadOnly(true);

        setupTransactionContext(true, asyncActionContext, false);

        sut.execute(asyncActionContext, asyncActionMock);
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

    @Test(expected = GeneralException.class)
    public void testExecuteWithAsyncActionFailure() throws Throwable
    {
        Serializable params = null;

        final AsyncActionContext asyncActionContext = new AsyncActionContext(params);
        transDef.setReadOnly(true);

        setupTransactionContext(true, asyncActionContext, true);

        context.checking(new Expectations()
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

    @Test(expected = ValidationException.class)
    public void testExecuteWithAsyncActionValidationFailure() throws Throwable
    {
        Serializable params = null;

        final AsyncActionContext asyncActionContext = new AsyncActionContext(params);
        transDef.setReadOnly(true);

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

    @Test(expected = ExecutionException.class)
    public void testExecuteWithAsyncActionExecutionFailure() throws Throwable
    {
        Serializable params = null;

        final AsyncActionContext asyncActionContext = new AsyncActionContext(params);
        transDef.setReadOnly(true);

        context.checking(new Expectations()
        {
            {
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     * Test.
     */
    @Test
    public void testExecuteBasicContextNonPrincipal()
    {
        final ActionContext parentContext = new AsyncActionContext(otherParams);
        mockery.checking(new Expectations()
        {
            {
                oneOf(execution).execute(with(new EasyMatcher<PrincipalActionContext>()
                {
                    @Override
                    protected boolean isMatch(final PrincipalActionContext inTestObject)
                    {
                        return inTestObject.getParams() == params && inTestObject.getPrincipal() == null
                                && inTestObject.getState() != null
                                && inTestObject.getState() != parentContext.getState();
                    }
                }));
                will(returnValue(result));
            }
        });
View Full Code Here

Examples of org.eurekastreams.commons.actions.context.async.AsyncActionContext

     * Test.
     */
    @Test
    public void testExecuteTaskContextNonPrincipal()
    {
        final ActionContext parentInnerContext = new AsyncActionContext(otherParams);
        final TaskHandlerActionContext parentContext = new TaskHandlerActionContextImpl(parentInnerContext,
                userActionRequests);
        mockery.checking(new Expectations()
        {
            {
                oneOf(executionTH).execute(with(new EasyMatcher<TaskHandlerActionContext<PrincipalActionContext>>()
                {
                    @Override
                    protected boolean isMatch(final TaskHandlerActionContext<PrincipalActionContext> inTestObject)
                    {
                        PrincipalActionContext inner = inTestObject.getActionContext();
                        return inTestObject.getUserActionRequests() == userActionRequests
                                && inner.getParams() == params && inner.getPrincipal() == null
                                && inner.getState() != null && inner.getState() != parentInnerContext.getState();
                    }
                }));
                will(returnValue(result));
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.