Skip to content
Commits on Source (3)
......@@ -120,7 +120,6 @@ Android
- Install the Android SDK
- Configure a device (real or simulated)
- Add an `ANDROID_HOME` to target the Android SDK
- Add `$ANDROID_HOME/platform-tools` to your path
- Activate the debug mode if it's a real device
- `mvn install -Pandroid`
......
This is a patch release with sole purpose to move ASM and CGLIB to their final version with full
Java 11 support.
This is a quick fix to remove the second generic parameter that was introduced
in version 4. It breaks backward compatibility and is actually unnecessary.
Change log
----------
* Upgrade to cglib 3.2.9 to support Java 11 ([#234](https://github.com/easymock/easymock/issues/234))
* Upgrade TestNG to version 7 ([#233](https://github.com/easymock/easymock/issues/233))
* Update to ASM 7.0 for full Java 11 support ([#232](https://github.com/easymock/easymock/pull/232))
* No need to have two generic parameters on EasyMock.createMock ([#237](https://github.com/easymock/easymock/issues/237))
......@@ -6,7 +6,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-bench</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock</artifactId>
......
......@@ -57,18 +57,16 @@ public class EasyMock {
* Creates a mock object that implements the given interface, order checking
* is disabled by default.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*
* @since 3.4
*/
public static <T, R> R mock(Class<T> toMock) {
public static <T> T mock(Class<?> toMock) {
return createControl().mock(toMock);
}
......@@ -80,19 +78,16 @@ public class EasyMock {
* the name of the mock object.
* @param toMock
* the class or interface that should be mocked.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*
* @since 3.4
*/
public static <T, R> R mock(String name, Class<T> toMock) {
public static <T> T mock(String name, Class<?> toMock) {
return createControl().mock(name, toMock);
}
......@@ -100,20 +95,18 @@ public class EasyMock {
* Creates a mock object, of the requested type, that implements the given interface
* or extends the given class
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param type
* the type of the mock to be created.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object
*
* @since 3.4
*/
public static <T, R> R mock(MockType type, Class<T> toMock) {
public static <T> T mock(MockType type, Class<?> toMock) {
return createControl(type).mock(toMock);
}
......@@ -121,22 +114,20 @@ public class EasyMock {
* Creates a mock object, of the requested type and name, that implements the given interface
* or extends the given class
*
* @param <T>
* the class or interface that should be mocked.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param name
* the name of the mock object.
* @param type
* the type of the mock to be created.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*
* @since 3.4
*/
public static <T, R> R mock(String name, MockType type, Class<T> toMock) {
public static <T> T mock(String name, MockType type, Class<?> toMock) {
return createControl(type).mock(name, toMock);
}
......@@ -144,18 +135,16 @@ public class EasyMock {
* Creates a mock object that implements the given interface, order checking
* is enabled by default.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*
* @since 3.4
*/
public static <T, R> R strictMock(Class<T> toMock) {
public static <T> T strictMock(Class<?> toMock) {
return createStrictControl().mock(toMock);
}
......@@ -168,17 +157,15 @@ public class EasyMock {
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*
* @since 3.4
*/
public static <T, R> R strictMock(String name, Class<T> toMock) {
public static <T> T strictMock(String name, Class<?> toMock) {
return createStrictControl().mock(name, toMock);
}
......@@ -187,18 +174,16 @@ public class EasyMock {
* is disabled by default, and the mock object will return {@code 0},
* {@code null} or {@code false} for unexpected invocations.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*
* @since 3.4
*/
public static <T, R> R niceMock(Class<T> toMock) {
public static <T> T niceMock(Class<?> toMock) {
return createNiceControl().mock(toMock);
}
......@@ -211,19 +196,16 @@ public class EasyMock {
* the name of the mock object.
* @param toMock
* the class or interface that should be mocked.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*
* @since 3.4
*/
public static <T, R> R niceMock(String name, Class<T> toMock) {
public static <T> T niceMock(String name, Class<?> toMock) {
return createNiceControl().mock(name, toMock);
}
......@@ -231,15 +213,15 @@ public class EasyMock {
* Create a mock builder allowing to create a partial mock for the given
* class or interface.
*
* @param <T>
* the interface that the mock object should implement.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement.
* @return a mock builder to create a partial mock
*
* @since 3.4
*/
public static <T> IMockBuilder<T> partialMockBuilder(Class<T> toMock) {
public static <T> IMockBuilder<T> partialMockBuilder(Class<?> toMock) {
return new MockBuilder<>(toMock);
}
......@@ -249,19 +231,17 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #mock(MockType, Class)}, which is more completion friendly
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param type
* the type of the mock to be created.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @since 3.2
*/
public static <T, R> R createMock(MockType type, Class<T> toMock) {
public static <T> T createMock(MockType type, Class<?> toMock) {
return mock(type, toMock);
}
......@@ -271,21 +251,19 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #mock(String, MockType, Class)}, which is more completion friendly
*
* @param <T>
* the class or interface that should be mocked.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param name
* the name of the mock object.
* @param type
* the type of the mock to be created.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @since 3.2
*/
public static <T, R> R createMock(String name, MockType type, Class<T> toMock) {
public static <T> T createMock(String name, MockType type, Class<?> toMock) {
return mock(name, type, toMock);
}
......@@ -295,16 +273,14 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #strictMock(Class)}, which is more completion friendly
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*/
public static <T, R> R createStrictMock(Class<T> toMock) {
public static <T> T createStrictMock(Class<?> toMock) {
return strictMock(toMock);
}
......@@ -319,15 +295,13 @@ public class EasyMock {
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*/
public static <T, R> R createStrictMock(String name, Class<T> toMock) {
public static <T> T createStrictMock(String name, Class<?> toMock) {
return strictMock(name, toMock);
}
......@@ -337,16 +311,14 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #mock(Class)}, which is more completion friendly
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*/
public static <T, R> R createMock(Class<T> toMock) {
public static <T> T createMock(Class<?> toMock) {
return mock(toMock);
}
......@@ -360,17 +332,14 @@ public class EasyMock {
* the name of the mock object.
* @param toMock
* the class or interface that should be mocked.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*/
public static <T, R> R createMock(String name, Class<T> toMock) {
public static <T> T createMock(String name, Class<?> toMock) {
return mock(name, toMock);
}
......@@ -381,16 +350,14 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #niceMock(Class)}, which is more completion friendly
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
*/
public static <T, R> R createNiceMock(Class<T> toMock) {
public static <T> T createNiceMock(Class<?> toMock) {
return niceMock(toMock);
}
......@@ -405,17 +372,14 @@ public class EasyMock {
* the name of the mock object.
* @param toMock
* the class or interface that should be mocked.
*
* @param <T>
* the interface that the mock object should implement.
* @param <R>
* the returned type. In general T == R but when mocking a generic type, it won't so to be nice with the
* caller, we return a different type
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return the mock object.
* @throws IllegalArgumentException
* if the name is not a valid Java identifier.
*/
public static <T, R> R createNiceMock(String name, Class<T> toMock) {
public static <T> T createNiceMock(String name, Class<?> toMock) {
return niceMock(name, toMock);
}
......@@ -425,13 +389,14 @@ public class EasyMock {
* <p>
* <b>Note:</b> This is the old version of {@link #partialMockBuilder(Class)}, which is more completion friendly
*
* @param <T>
* the interface that the mock object should implement.
* @param toMock
* the class or interface that should be mocked.
* @param <T>
* the interface that the mock object should implement. It is expected to be of
* class {@code toMock}.
* @return a mock builder to create a partial mock
*/
public static <T> IMockBuilder<T> createMockBuilder(Class<T> toMock) {
public static <T> IMockBuilder<T> createMockBuilder(Class<?> toMock) {
return partialMockBuilder(toMock);
}
......
......@@ -52,17 +52,17 @@ public class MockBuilder<T> implements IMockBuilder<T> {
return !method.isSynthetic();
};
private final Class<T> toMock;
private final Class<?> toMock;
private Set<Method> mockedMethods;
private Constructor<T> constructor;
private Constructor<?> constructor;
private ConstructorArgs constructorArgs;
private final EasyMockSupport support;
public MockBuilder(Class<T> toMock) {
public MockBuilder(Class<?> toMock) {
this(toMock, null);
}
......@@ -75,7 +75,7 @@ public class MockBuilder<T> implements IMockBuilder<T> {
* @param support
* The EasyMockSupport used to create mocks. Null if none
*/
public MockBuilder(Class<T> toMock, EasyMockSupport support) {
public MockBuilder(Class<?> toMock, EasyMockSupport support) {
this.toMock = toMock;
this.support = support;
}
......@@ -117,17 +117,15 @@ public class MockBuilder<T> implements IMockBuilder<T> {
return this;
}
@SuppressWarnings("unchecked")
public IMockBuilder<T> withConstructor(Constructor<?> constructor) {
checkConstructorNotInitialized();
this.constructor = (Constructor<T>) constructor;
this.constructor = constructor;
return this;
}
@SuppressWarnings("unchecked")
public IMockBuilder<T> withConstructor(ConstructorArgs constructorArgs) {
checkConstructorNotInitialized();
this.constructor = (Constructor<T>) constructorArgs.getConstructor();
this.constructor = constructorArgs.getConstructor();
this.constructorArgs = constructorArgs;
return this;
}
......
easymock (4.0.2-1) unstable; urgency=medium
* New upstream version 4.0.2.
-- Markus Koschany <apo@debian.org> Sun, 02 Dec 2018 23:05:08 +0100
easymock (4.0.1-1) unstable; urgency=medium
* New upstream version 4.0.1.
......
#!/bin/bash
# This script expects:
# - github_user / github_password to be available environment variables
# - gpg_passphrase to be an environment variable
# - bintray_user to be an environment variable
# - bintray_api_key to be an environment variable
......@@ -42,8 +41,6 @@ tag=easymock-${version}
# Get we have the environment variable we need
message="should be an environment variable"
[ -z "$gpg_passphrase" ] && echo "gpg_passphrase $message" && exit 1
[ -z "$github_user" ] && echo "github_user $message" && exit 1
[ -z "$github_password" ] && echo "github_password $message" && exit 1
[ -z "$bintray_api_key" ] && echo "bintray_api_key $message" && exit 1
[ -z "$bintray_user" ] && echo "bintray_user $message" && exit 1
......@@ -58,13 +55,13 @@ echo
pause
echo "Generate the changelog"
milestone=$(curl -s -u "${github_user}:${github_password}" "https://api.github.com/repos/easymock/easymock/milestones" | jq ".[] | select(.title==\"$version\") | .number")
if [ $(curl -s -u "${github_user}:${github_password}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/easymock/easymock/issues?milestone=$milestone&state=open" | wc -l) != "3" ]; then
milestone=$(curl -s "https://api.github.com/repos/easymock/easymock/milestones" | jq ".[] | select(.title==\"$version\") | .number")
if [ $(curl -s "https://api.github.com/repos/easymock/easymock/issues?milestone=${milestone}&state=open" | wc -l) != "3" ]; then
echo "There are unclosed issues on milestone $version. Please fix them or moved them to a later release"
exit 1
fi
./generate-changelog.sh easymock/easymock ${milestone} ${github_user} ${github_password} >> ReleaseNotes.md
./generate-changelog.sh easymock/easymock ${milestone} >> ReleaseNotes.md
echo "Check the release notes"
pause
......
#!/bin/bash
if [ "$#" -ne 4 ]; then
echo "Usage: ./generate-changelog.sh user/repo <milestone> <username> <password>"
if [ "$#" -ne 2 ]; then
echo "Usage: ./generate-changelog.sh user/repo <milestone>"
exit 1
fi
repository=$1
milestone=$2
user=$3
password=$4
IFS=$'\n'
echo "Change log"
echo "----------"
for i in $(curl -s -u "${user}:${password}" -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/${repository}/issues?milestone=${milestone}&state=closed" | jq -c '.[] | [.html_url, .number, .title]'); do
for i in $(curl -s "https://api.github.com/repos/${repository}/issues?milestone=${milestone}&state=closed" | jq -c '.[] | [.html_url, .number, .title]'); do
echo $i | sed 's/\["\(.*\)",\(.*\),\"\(.*\)\"\]/* \3 ([#\2](\1))/' | sed 's/\\"/"/g'
done
......@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<packaging>pom</packaging>
<name>EasyMock Parent</name>
<url>http://easymock.org</url>
......@@ -263,7 +263,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
</plugin>
<!--This plugin configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
<plugin>
......
......@@ -20,6 +20,3 @@ mvn versions:commit -Pall
# Commit
git commit -am "Start version $version"
git push
# Create next version in Jira (http://jira.codehaus.org/plugins/servlet/project-config/EASYMOCK/versions)
curl -D- -u ${jira_user}:${jira_password} -X POST --data '{ "description": "EasyMock $version", "name": "$version", "archived": false, "released": false, "project": "EASYMOCK", "projectId": 12103 }' -H "Content-Type:application/json" https://jira.codehaus.org/rest/api/2/version
......@@ -4,7 +4,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-android-tck</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-deploy</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-integration</artifactId>
......@@ -30,7 +30,7 @@
<jacoco.skip>true</jacoco.skip>
<!-- Versions -->
<powermock.version>2.0.0-RC.1</powermock.version>
<powermock.version>2.0.0-RC.4</powermock.version>
</properties>
<dependencies>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-java8</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-nodeps</artifactId>
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-osgi</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>org.easymock</groupId>
<artifactId>easymock-parent</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</parent>
<artifactId>easymock-test-testng</artifactId>
......