[Git][java-team/easymock][upstream] New upstream version 4.0.2
Markus Koschany
gitlab at salsa.debian.org
Sun Dec 2 22:23:03 GMT 2018
Markus Koschany pushed to branch upstream at Debian Java Maintainers / easymock
Commits:
a020c92e by Markus Koschany at 2018-12-02T22:03:57Z
New upstream version 4.0.2
- - - - -
17 changed files:
- README.md
- ReleaseNotes.md
- bench/pom.xml
- core/pom.xml
- core/src/main/java/org/easymock/EasyMock.java
- core/src/main/java/org/easymock/internal/MockBuilder.java
- deploy-easymock.sh
- generate-changelog.sh
- pom.xml
- start-next-version.sh
- test-android/pom.xml
- test-deploy/pom.xml
- test-integration/pom.xml
- test-java8/pom.xml
- test-nodeps/pom.xml
- test-osgi/pom.xml
- test-testng/pom.xml
Changes:
=====================================
README.md
=====================================
@@ -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`
=====================================
ReleaseNotes.md
=====================================
@@ -1,8 +1,6 @@
-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))
=====================================
bench/pom.xml
=====================================
@@ -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>
=====================================
core/pom.xml
=====================================
@@ -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>
=====================================
core/src/main/java/org/easymock/EasyMock.java
=====================================
@@ -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);
}
=====================================
core/src/main/java/org/easymock/internal/MockBuilder.java
=====================================
@@ -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;
}
=====================================
deploy-easymock.sh
=====================================
@@ -1,7 +1,6 @@
#!/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
=====================================
generate-changelog.sh
=====================================
@@ -1,19 +1,17 @@
#!/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
=====================================
pom.xml
=====================================
@@ -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>
=====================================
start-next-version.sh
=====================================
@@ -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
=====================================
test-android/pom.xml
=====================================
@@ -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>
=====================================
test-deploy/pom.xml
=====================================
@@ -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>
=====================================
test-integration/pom.xml
=====================================
@@ -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>
=====================================
test-java8/pom.xml
=====================================
@@ -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>
=====================================
test-nodeps/pom.xml
=====================================
@@ -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>
=====================================
test-osgi/pom.xml
=====================================
@@ -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>
=====================================
test-testng/pom.xml
=====================================
@@ -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>
View it on GitLab: https://salsa.debian.org/java-team/easymock/commit/a020c92e4bf9e4e1d710746982139e58c5e09205
--
View it on GitLab: https://salsa.debian.org/java-team/easymock/commit/a020c92e4bf9e4e1d710746982139e58c5e09205
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20181202/d40c07b5/attachment.html>
More information about the pkg-java-commits
mailing list