Permalink
Browse files

Migration from maven to gradle

  • Loading branch information...
thekingnothing committed May 3, 2016
1 parent 9e1f0b1 commit 56cc72ab76c727e209258a530850de6ea3362d16
Showing 326 changed files with 3,738 additions and 4,599 deletions.
View
@@ -2,7 +2,6 @@ language: java
jdk:
- oraclejdk8
script:
- mvn install -DskipTests=true
- mvn test
- mvn test -Pmockito2
- ./gradlew assemble
- ./gradlew check
View

This file was deleted.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -7,7 +7,7 @@
/**
* This annotation can be placed on those fields in your test class that should
* be mocked in a nice manner (i.e. by default allows all method calls and
* returns appropriate empty values (0, <code>null</code> or <code>false</code>
* returns appropriate empty values (0, {@code null} or {@code false}
* )). This eliminates the need to setup and tear-down mocks manually which
* minimizes repetitive test code and makes the test more readable. In order for
* PowerMock to control the life-cycle of the mocks you must supply the
@@ -44,9 +44,9 @@
* @param invocationHandler The mock invocation handler to be associated with this
* instance.
* @param methodsToMock The methods that are mocked for this instance. If
* <code>methodsToMock</code> is null all methods for the
* <code>invocationHandler</code> are considered to be mocked.
* @param mockInstance The actual mock instance. May be <code>null</code>. Even
* {@code methodsToMock} is null all methods for the
* {@code invocationHandler} are considered to be mocked.
* @param mockInstance The actual mock instance. May be {@code null}. Even
* though the mock instance may not be used it's needed to keep a
* reference to this object otherwise it may be garbage collected
* in some situations. For example when mocking static methods we
@@ -73,16 +73,13 @@ public EasyMockMethodInvocationControl(MockInvocationHandler invocationHandler,
* @param invocationHandler The mock invocation handler to be associated with this
* instance.
* @param methodsToMock The methods that are mocked for this instance. If
* <code>methodsToMock</code> is null all methods for the
* <code>invocationHandler</code> are considered to be mocked.
* {@code methodsToMock} is null all methods for the
* {@code invocationHandler} are considered to be mocked.
*/
public EasyMockMethodInvocationControl(MockInvocationHandler invocationHandler, Set<Method> methodsToMock) {
this(invocationHandler, methodsToMock, null);
}
/**
* {@inheritDoc}
*/
@Override
public boolean isMocked(Method method) {
return mockedMethods == null || (mockedMethods != null && mockedMethods.contains(method));
@@ -113,9 +110,6 @@ public Object invoke(Object proxy, Method method, Object[] arguments) throws Thr
}
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object replay(Object... mocks) {
// Silently ignore replay if someone has replayed the mock before.
@@ -126,9 +120,6 @@ public synchronized Object replay(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object verify(Object... mocks) {
// Silently ignore verify if someone has verified the mock before.
@@ -139,9 +130,6 @@ public synchronized Object verify(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object reset(Object... mocks) {
invocationHandler.getControl().reset();
@@ -76,9 +76,6 @@ public Object invoke(Class<?> type, Object[] args, Class<?>[] sig) throws Except
return EasyMock.expect(substitute.performSubstitutionLogic(arguments));
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object replay(Object... mocks) {
if (!hasReplayed) {
@@ -88,9 +85,6 @@ public synchronized Object replay(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object verify(Object... mocks) {
if (!hasVerified) {
@@ -100,9 +94,6 @@ public synchronized Object verify(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object reset(Object... mocks) {
EasyMock.reset(substitute);
@@ -30,17 +30,11 @@
*/
abstract class AbstractEasyMockLogPolicyBase implements PowerMockPolicy {
/**
* {@inheritDoc}
*/
@Override
public void applyClassLoadingPolicy(MockPolicyClassLoadingSettings settings) {
settings.addFullyQualifiedNamesOfClassesToLoadByMockClassloader(getFullyQualifiedNamesOfClassesToLoadByMockClassloader());
}
/**
* {@inheritDoc}
*/
@Override
public void applyInterceptionPolicy(MockPolicyInterceptionSettings settings) {
LogPolicySupport support = new LogPolicySupport();
@@ -27,6 +27,7 @@
* @deprecated Test Runners uses an annotation enabling listener per default
* since version 1.3. You should just remove this listener.
*/
@Deprecated
public class AnnotationEnabler extends org.powermock.api.extension.listener.AnnotationEnabler {
}
@@ -39,15 +39,15 @@
* </p>
* <p>
* It will only inject to fields that haven't been set before (i.e that are
* <code>null</code>).
* {@code null}).
* </p>
*
* @see org.powermock.api.easymock.annotation.Mock
* @see org.easymock.Mock
* @see org.easymock.TestSubject
*
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "JavadocReference"})
public class AnnotationEnabler extends AbstractPowerMockTestListenerBase implements AnnotationEnablerListener {
@@ -35,7 +35,7 @@
* @see org.easymock.Mock
* @see org.easymock.TestSubject
*/
@SuppressWarnings("WeakerAccess")
@SuppressWarnings({"WeakerAccess", "JavadocReference"})
public class EasyMockAnnotationSupport {
private final Object testInstance;
View

This file was deleted.

Oops, something went wrong.
@@ -75,17 +75,11 @@ public Object invoke(Class<?> type, Object[] args, Class<?>[] sig) throws Except
return substitute;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object replay(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public synchronized Object verify(Object... mocks) {
final VerificationMode verificationMode;
@@ -104,9 +98,6 @@ public synchronized Object verify(Object... mocks) {
return null;
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public synchronized Object reset(Object... mocks) {
View

This file was deleted.

Oops, something went wrong.
@@ -44,7 +44,7 @@
* captors etc.
* <p/>
* It will only inject to fields that haven't been set before (i.e that are
* <code>null</code>).
* {@code null}).
*/
@SuppressWarnings("deprecation")
public class AnnotationEnabler extends AbstractPowerMockTestListenerBase implements AnnotationEnablerListener {
@@ -94,8 +94,6 @@ public static synchronized void mockStatic(Class<?> type, Class<?>... types) {
* class to mock
* @param defaultAnswer
* default answer for unstubbed methods
*
* @return mock object
*/
public static void mockStatic(Class<?> classMock, @SuppressWarnings("rawtypes") Answer defaultAnswer) {
mockStatic(classMock, withSettings().defaultAnswer(defaultAnswer));
@@ -125,7 +123,6 @@ public static void mockStatic(Class<?> classMock, @SuppressWarnings("rawtypes")
* class to mock
* @param mockSettings
* additional mock settings
* @return mock object
*/
public static void mockStatic(Class<?> classToMock, MockSettings mockSettings) {
DefaultMockCreator.mock(classToMock, true, false, null, mockSettings, (Method[]) null);
@@ -238,7 +235,7 @@ public static void mockStatic(Class<?> classToMock, MockSettings mockSettings) {
/**
* Verifies certain behavior <b>happened once</b>
* <p>
* Alias to <code>verifyStatic(times(1))</code> E.g:
* Alias to {@code verifyStatic(times(1))} E.g:
*
* <pre>
* verifyStatic();
@@ -342,7 +339,7 @@ public static PrivateMethodVerification verifyPrivate(Class<?> clazz, Verificati
/**
* Verifies certain behavior <b>happened once</b>
* <p>
* Alias to <code>verifyNew(mockClass, times(1))</code> E.g:
* Alias to {@code verifyNew(mockClass, times(1))} E.g:
*
* <pre>
* verifyNew(ClassWithStaticMethod.class);
@@ -33,9 +33,6 @@
*/
public class PowerMockitoStubberImpl extends StubberImpl implements PowerMockitoStubber {
/**
* {@inheritDoc}
*/
@Override
public void when(Class<?> classMock) {
MockitoMethodInvocationControl invocationControl = (MockitoMethodInvocationControl) MockRepository
@@ -44,7 +41,7 @@ public void when(Class<?> classMock) {
}
/**
* Supports PowerMockito mocks. If <code>mock</code> is not a PowerMockito
* Supports PowerMockito mocks. If {@code mock} is not a PowerMockito
* mock it will delegate to Mockito.
*
* @see Stubber#when(Object)
Oops, something went wrong.

0 comments on commit 56cc72a

Please sign in to comment.