Package org.eurekastreams.commons.exceptions

Examples of org.eurekastreams.commons.exceptions.GeneralException


                oneOf(principalDao).execute(with(any(String.class)));
                will(returnValue(principalMock));

                oneOf(serviceActionControllerMock).execute(with(any(ServiceActionContext.class)),
                        with(any(ServiceAction.class)));
                will(throwException(new GeneralException()));
            }
        });

        Set<UserId> userIds = new HashSet<UserId>();
        userIds.add(testId);
View Full Code Here


                oneOf(gadgetMetaDataFetcher).getGadgetsMetaData(with(any(Map.class)));
                will(returnValue(Collections.singletonList(new GadgetMetaDataDTO(gadgetDef))));

                oneOf(serviceActionControllerMock).execute(with(any(ServiceActionContext.class)),
                        with(any(TaskHandlerAction.class)));
                will(throwException(new GeneralException()));
            }

        });

        sut.createActivity(testId, testGroupId, TEST_APP_ID, ACTIVITY_ALL_FIELDS, testActivity, FAKETOKEN);
View Full Code Here

                allowing(principalMock).getAccountId();
                will(returnValue("foo"));

                oneOf(serviceActionControllerMock).execute(with(any(ServiceActionContext.class)),
                        with(any(ServiceAction.class)));
                will(throwException(new GeneralException()));
            }
        });

        sut.getActivity(testId, testGroupId, TEST_APP_ID, ACTIVITY_ALL_FIELDS, TEST_ACTIVITY_ID, FAKETOKEN).get();
View Full Code Here

                allowing(principalMock).getAccountId();
                will(returnValue("foo"));

                oneOf(serviceActionControllerMock).execute(with(any(ServiceActionContext.class)),
                        with(any(ServiceAction.class)));
                will(throwException(new GeneralException()));
            }
        });

        sut.getActivities(userIdSet, testGroupId, TEST_APP_ID, ACTIVITY_ALL_FIELDS, collOptions, FAKETOKEN).get();
View Full Code Here

        context.checking(new Expectations()
        {
            {
                allowing(mockToken).getViewerId();
                will(throwException(new GeneralException()));

                allowing(principalDao).execute(USERID_ONE);
                will(returnValue(principal));
            }
        });
View Full Code Here

                oneOf(taskHandlerExecutionStrategy).execute(with(any(TaskHandlerActionContext.class)));

                if (throwsException)
                {
                    oneOf(transMgrMock).commit(transStatus);
                    will(throwException(new GeneralException()));
                }
                else
                {
                    oneOf(transMgrMock).commit(transStatus);
View Full Code Here

                oneOf(executionStrategy).execute(inContext);

                if (throwsException)
                {
                    oneOf(transMgrMock).commit(transStatus);
                    will(throwException(new GeneralException()));
                }
                else
                {
                    oneOf(transMgrMock).commit(transStatus);
                }
View Full Code Here

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

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

        }
        else if (ex instanceof GeneralException)
        {
            // Remove any nested exceptions (particularly want to insure no PersistenceExceptions get sent - they
            // are not serializable plus contain details that should not be exposed to users)
            return (ex.getCause() == null) ? ex : new GeneralException(ex.getMessage());
        }
        else if (ex instanceof ExecutionException)
        {
            // Remove any nested exceptions
            return (ex.getCause() == null) ? ex : new ExecutionException(ex.getMessage());
        }
        else if (ex instanceof InvalidActionException)
        {
            return new GeneralException("Invalid action.");
        }
        else if (ex instanceof NoSuchBeanDefinitionException)
        {
            return new GeneralException("Invalid action.");
        }
        else if (ex instanceof SessionException)
        {
            return new SessionException();
        }
        else
        {
            return new GeneralException("Error performing action.");
        }
    }
View Full Code Here

TOP

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

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.