mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Reduce number of compilation warnings and re-format where nessesary.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@101538 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
package org.alfresco.module.org_alfresco_module_rm.test.util;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Matchers.anyString;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.doReturn;
|
||||
@@ -54,7 +53,6 @@ import org.alfresco.module.org_alfresco_module_rm.util.TransactionalResourceHelp
|
||||
import org.alfresco.module.org_alfresco_module_rm.version.RecordableVersionService;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.repo.policy.PolicyComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||
import org.alfresco.repo.security.permissions.impl.ExtendedPermissionService;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
|
@@ -32,6 +32,9 @@ public class ExceptionUtils
|
||||
/** This represents a situation where a throwable of an unexpected type was thrown. */
|
||||
public static class UnexpectedThrowableException extends RuntimeException
|
||||
{
|
||||
/** serial version uid */
|
||||
private static final long serialVersionUID = 3900164716673246207L;
|
||||
|
||||
private final Class<? extends Throwable> expected;
|
||||
private final Throwable actual;
|
||||
|
||||
@@ -54,6 +57,9 @@ public class ExceptionUtils
|
||||
/** This represents a situation where an expected throwable was not thrown. */
|
||||
public static class MissingThrowableException extends RuntimeException
|
||||
{
|
||||
/** serial version uid */
|
||||
private static final long serialVersionUID = -988022536370047222L;
|
||||
|
||||
private final Class<? extends Throwable> expected;
|
||||
|
||||
public MissingThrowableException(Class<? extends Throwable> expected)
|
||||
@@ -121,6 +127,7 @@ public class ExceptionUtils
|
||||
* @throws UnexpectedThrowableException if a non-matching throwable was thrown out of the code block.
|
||||
* @throws MissingThrowableException if the expected throwable was not thrown out of the code block.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <R, T extends Throwable> T expectedException(final Class<T> expected, final Supplier<R> code)
|
||||
{
|
||||
// The code block may throw an exception or it may not.
|
||||
|
Reference in New Issue
Block a user