Package org.eurekastreams.commons.exceptions

Examples of org.eurekastreams.commons.exceptions.ExecutionException


     * Tests how exceptions are returned to client.
     */
    @Test
    public void testExecutionExceptionNested()
    {
        Exception exIn = new ExecutionException(new ArithmeticException());
        Exception exOut = coreForbidNestingExceptionTest(exIn);
        assertTrue(exOut instanceof ExecutionException);
        assertEquals(exIn.getMessage(), exOut.getMessage());
    }
View Full Code Here


     * Tests how exceptions are returned to client.
     */
    @Test
    public void testExecutionExceptionNonNested()
    {
        Exception exIn = new ExecutionException();
        Exception exOut = coreForbidNestingExceptionTest(exIn);
        assertSame(exIn, exOut);
    }
View Full Code Here

            /*
             * If gadgetDef is not found, throw an exception, something went wrong, most likely a bad UUID or URL.
             */
            if (null == gadgetDef)
            {
                throw new ExecutionException("Unable to instantiate gadgetDef.");
            }

            // increment the indexes of any gadgets in that zone
            shiftGadget(tab.getGadgets());

            // get the owner

            // create the new gadget at the top of the last zone
            Gadget gadget = new Gadget(gadgetDef, 0, 0, owner, request.getUserPrefs() == null ? "" : request
                    .getUserPrefs());

            // insert the new gadget - room has been made for it
            tab.getGadgets().add(gadget);

            // commit our operations
            tabMapper.flush();

            deleteKeysMapper.execute(Collections.singleton(CacheKeys.PERSON_PAGE_PROPERTIES_BY_ID + owner.getId()));

            // return it
            return gadget;
        }
        catch (NoResultException ex)
        {
            log.error("Could not add Gadget because tab not found: " + owner.getUniqueId());
            throw new ExecutionException("Could not add Gadget because tab not found: " + owner.getUniqueId());
        }
    }
View Full Code Here

    {
        ActionContext inInnerContext = inActionContext.getActionContext();
        boolean hasPrincipalContext = inInnerContext instanceof PrincipalActionContext;
        if (needsPrincipal && !hasPrincipalContext)
        {
            throw new ExecutionException("Incorrect action execution invocation.  "
                    + "Execution requires principal but none was provided on call.");
        }
        ActionContext innerContext = hasPrincipalContext ? new ServiceActionContext(params,
                ((PrincipalActionContext) inInnerContext).getPrincipal()) : new AsyncActionContext(params);
View Full Code Here

            throws ExecutionException
    {
        boolean hasPrincipalContext = inActionContext instanceof PrincipalActionContext;
        if (needsPrincipal && !hasPrincipalContext)
        {
            throw new ExecutionException("Incorrect action execution invocation.  "
                    + "Execution requires principal but none was provided on call.");
        }

        if (taskHandlerExecution != null)
        {
            throw new ExecutionException("Incorrect action execution invocation.  Execution requires user action "
                    + "request list (TaskHandlerActionContext) but none was provided on call.");
        }

        ActionContext context = hasPrincipalContext ? new ServiceActionContext(params,
                ((PrincipalActionContext) inActionContext).getPrincipal()) : new AsyncActionContext(params);
View Full Code Here

     */
    @Test(expected = ExecutionException.class)
    public void testExecuteActionErrorBasic()
    {
        final UserActionRequest sel = new UserActionRequest(ACTION_NAME, null, "");
        final ExecutionException exception = new ExecutionException();
        mockery.checking(new Expectations()
        {
            {
                allowing(beanFactory).getBean(ACTION_NAME);
                will(returnValue(serviceAction));
View Full Code Here

     */
    @Test(expected = ExecutionException.class)
    public void testExecuteActionErrorTaskHandler()
    {
        final UserActionRequest sel = new UserActionRequest(ACTION_NAME, null, "");
        final ExecutionException exception = new ExecutionException();
        mockery.checking(new Expectations()
        {
            {
                allowing(beanFactory).getBean(ACTION_NAME);
                will(returnValue(taskHandlerServiceAction));
View Full Code Here

            token.setTokenExpireMillis(tokenInfo.getTokenExpireMillis());
            tokenInsertMapper.execute(new PersistenceRequest<OAuthToken>(token));
        }
        else
        {
            throw new ExecutionException("OAuth Consumer was not found");
        }

        return null;
    }
View Full Code Here

                TaskHandlerServiceAction action = (TaskHandlerServiceAction) springBean;
                serviceActionController.execute(actionContext, action);
            }
            else
            {
                throw new ExecutionException("Bean '" + actionSelection.getActionKey()
                        + "' is not an executable action");
            }
        }
        catch (RuntimeException ex)
        {
View Full Code Here

        GetConsumerInfoRequest request = (GetConsumerInfoRequest) inActionContext.getParams();
        OAuthConsumer oauthConsumer = consumerMapper.execute(new OAuthConsumerRequest(request.getServiceName(), request
                .getSecurityToken().getAppUrl()));
        if (oauthConsumer == null)
        {
            throw new ExecutionException("OAuth Consumer was not found");
        }
        net.oauth.OAuthConsumer consumer = new net.oauth.OAuthConsumer(oauthConsumer.getCallbackURL(), oauthConsumer
                .getConsumerKey(), oauthConsumer.getConsumerSecret(), request.getProvider());
        consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, oauthConsumer.getSignatureMethod());
        ConsumerInfo consumerInfo = new ConsumerInfo(consumer, null, oauthConsumer.getCallbackURL());
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.exceptions.ExecutionException

Copyright © 2018 www.massapicom. 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.