From 9abe17b6d87a75fb04111687d6039f75f01a0891 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:08:41 -0400 Subject: [PATCH 01/62] spelling: GitHub (brand) --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef5bcc76d..f5f79f3c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,4 +68,4 @@ Fixes #777 : Refactors this part of PowerMock to make feature possible * Documentation !!! Always document the public API with love. Internals could use some love too but it's argubly not as important. In all cases the code should _auto-document_ itself like any [well designed API](rebased and squashed if necessary, so that each commit clearly changes one things and there are no extraneous fix-ups). -* We use (4) spaces instead of tabs. Make sure line ending is Unix style (LF). More on line ending on the [Github help](https://help.github.com/articles/dealing-with-line-endings/). +* We use (4) spaces instead of tabs. Make sure line ending is Unix style (LF). More on line ending on the [GitHub help](https://help.github.com/articles/dealing-with-line-endings/). From c2713eb0cbcbd2fc2c005b13f154621ef8fb6a66 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 11 Jun 2019 23:54:42 -0400 Subject: [PATCH 02/62] spelling: accessible --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index f5a99cb5c..725277d98 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -515,7 +515,7 @@ Change log 1.1 (released 2008-12-12) * Changed so that the default suppression value for methods returning java.lang.String is null to conform with EasyMock and Mockito. * Added Whitebox.getFieldsOfType(..) that can be used to retreive all fields of a particular type in a class hierarchy. * Added support for mock policies. A mock policy can be used to make it easier to unit test some code with PowerMock in isolation from a certain framework. Three mock policies are available in the EasyMock API, JclMockPolicy, Slf4jMockPolicy and Log4jMockPolicy which helps with mocking java commons-lang, log4j or slf4j in PowerMock. Use the @MockPolicy annotation at the class-level of the test case to use one of the mock policies. -* Whitebox.getMethod(..) sets the accessable flag to true if a method is found. +* Whitebox.getMethod(..) sets the accessible flag to true if a method is found. * Added Whitebox.getMethod(Class type, Class... parameterTypes) that let's you get a single method without specifying the method name. * Fixed a bug in WhiteboxImpl.checkIfTypesAreSame(..) that prevented classes to be identified correctly. * Fixed a bug in the PowerMockJUnit44RunnerDelegateImpl that caused a NoClassDefFoundError to be thrown when using JUnit 4.5 when a AssumptionViolatedException was thrown. The reason for this was that JUnit has changed to locatation of this exception. From 96c6ae0219be7189435872bf6317d179c99b96aa Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 11 Jun 2019 23:53:43 -0400 Subject: [PATCH 03/62] spelling: additional --- .../src/main/java/org/powermock/reflect/Whitebox.java | 2 +- .../main/java/org/powermock/reflect/internal/WhiteboxImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java b/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java index 3feb54a0c..cb7dad33d 100644 --- a/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java +++ b/powermock-reflect/src/main/java/org/powermock/reflect/Whitebox.java @@ -194,7 +194,7 @@ public static void setInternalState(Object object, String fieldName, Object[] va * Set the value of a field using reflection. This method will traverse the * super class hierarchy until the first field assignable to the * value type is found. The value (or - * additionaValues if present) will then be assigned to this field. + * additionalValues if present) will then be assigned to this field. * * @param object * the object to modify diff --git a/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java b/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java index a326eb91c..bb35d0517 100644 --- a/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java +++ b/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java @@ -334,7 +334,7 @@ public static void setInternalState(Object object, Class fieldType, Object va * Set the value of a field using reflection. This method will traverse the * super class hierarchy until the first field assignable to the * value type is found. The value (or - * additionaValues if present) will then be assigned to this field. + * additionalValues if present) will then be assigned to this field. * * @param object the object to modify * @param value the new value of the field From e7d02ec409072542f58a409afbdb7ec365528175 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 11 Jun 2019 23:55:34 -0400 Subject: [PATCH 04/62] spelling: arguably --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5f79f3c3..9a833cc42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -66,6 +66,6 @@ Fixes #777 : Refactors this part of PowerMock to make feature possible * New test methods should follow a snake case convention (`ensure_that_stuff_is_doing_that`), this allows the test name to be fully expressive on intent while still readable. -* Documentation !!! Always document the public API with love. Internals could use some love too but it's argubly not as important. In all cases the code should _auto-document_ itself like any [well designed API](rebased and squashed if necessary, so that each commit clearly changes one things and there are no extraneous fix-ups). +* Documentation !!! Always document the public API with love. Internals could use some love too but it's arguably not as important. In all cases the code should _auto-document_ itself like any [well designed API](rebased and squashed if necessary, so that each commit clearly changes one things and there are no extraneous fix-ups). * We use (4) spaces instead of tabs. Make sure line ending is Unix style (LF). More on line ending on the [GitHub help](https://help.github.com/articles/dealing-with-line-endings/). From 16c1faada0af671858a1fc6f2cbd428ce8b80255 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 11 Jun 2019 23:57:27 -0400 Subject: [PATCH 05/62] spelling: arthur --- .../java/org/powermock/core/classloader/MockClassLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/main/java/org/powermock/core/classloader/MockClassLoader.java b/powermock-core/src/main/java/org/powermock/core/classloader/MockClassLoader.java index e144edab3..b03946146 100644 --- a/powermock-core/src/main/java/org/powermock/core/classloader/MockClassLoader.java +++ b/powermock-core/src/main/java/org/powermock/core/classloader/MockClassLoader.java @@ -48,7 +48,7 @@ * * @author Johan Haleby * @author Jan Kronquist - * @author Artur Zagretdinov + * @author Arthur Zagretdinov * * @see MockClassLoaderConfiguration * @see ClassLoader#getSystemClassLoader() From f64bd223c7cdcc9547eb320803eb2ad56992a034 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 11 Jun 2019 23:59:38 -0400 Subject: [PATCH 06/62] spelling: available --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b62520577..ada10bd6b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ When writing unit tests it is often useful to bypass encapsulation and therefore Please note that PowerMock is mainly intended for people with expert knowledge in unit testing. Putting it in the hands of junior developers may cause more harm than good. ## News -* 2019-04-21: PowerMock 2.0.2 has been release and avaliable in Maven Central. The release includes fix the [issue](https://github.com/powermock/powermock/issues/979) wiht PowerMock JavaAgent with latest JDK and [security issue](https://github.com/powermock/powermock/issues/973) wiht build script. +* 2019-04-21: PowerMock 2.0.2 has been release and available in Maven Central. The release includes fix the [issue](https://github.com/powermock/powermock/issues/979) wiht PowerMock JavaAgent with latest JDK and [security issue](https://github.com/powermock/powermock/issues/973) wiht build script. * 2019-01-07: PowerMock 2.0.0 has been released. Main changes: offical supporting Mockito 2.x and dropping supporting Mockito 1.x. This release also supports Java 9. Other change read in [release notes](https://github.com/powermock/powermock/releases/tag/powermock-2.0.0). * 2017-08-12: PowerMock 1.7.1 has been released with one, but significant change: the old API for verifying static mock has been deprecated and a new one has been added. Old API will be removed in version PowerMock 2.0 due to incompatibility with Mockito Public API. * 2017-06-16: PowerMock 1.7.0 has been released with support for Mockito 2 (not only beta versions) and new features such as global `@PowerMockIgnore` as well as bug fixes and other improvements. See [release notes](https://github.com/powermock/powermock/releases/tag/powermock-1.7.0) and [change log](https://raw.githubusercontent.com/powermock/powermock/master/docs/changelog.txt) for details. From 1da3c790edc4971d6ce59adf55da1c821a1f329d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:00:34 -0400 Subject: [PATCH 07/62] spelling: bytecode --- .../junit4/misc/PrivateInnerInterfacesInTestClassTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/misc/PrivateInnerInterfacesInTestClassTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/misc/PrivateInnerInterfacesInTestClassTest.java index e1c479f68..ddceb8daf 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/misc/PrivateInnerInterfacesInTestClassTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/misc/PrivateInnerInterfacesInTestClassTest.java @@ -12,7 +12,7 @@ public class PrivateInnerInterfacesInTestClassTest { @Test - public void privateInterfacesCanBeLoadedAndBytcodeManipulatedByPowerMock() throws Exception { + public void privateInterfacesCanBeLoadedAndBytecodeManipulatedByPowerMock() throws Exception { InnerInterface innerInterface = new InnerInterface() { public String aMethod() { return "ok"; From a51ab03eb883fe3be58f3292ffa745038caec4f9 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:01:04 -0400 Subject: [PATCH 08/62] spelling: changeable --- .../ChangeValueOfStaticFinalFieldInInterfacesDefect.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/interfacefieldchange/ChangeValueOfStaticFinalFieldInInterfacesDefect.java b/tests/easymock/junit4/src/test/java/samples/junit4/interfacefieldchange/ChangeValueOfStaticFinalFieldInInterfacesDefect.java index 5b13f20b9..d45cf5080 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/interfacefieldchange/ChangeValueOfStaticFinalFieldInInterfacesDefect.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/interfacefieldchange/ChangeValueOfStaticFinalFieldInInterfacesDefect.java @@ -34,7 +34,7 @@ public class ChangeValueOfStaticFinalFieldInInterfacesDefect { @Test - public void assertThatStaticFinalFieldValuesInInterfacesAreChangable() throws Exception { + public void assertThatStaticFinalFieldValuesInInterfacesAreChangeable() throws Exception { final String value = "new value"; Whitebox.setInternalState(InterfaceWithStaticFinalField.class, value); assertEquals(value, Whitebox.getInternalState(InterfaceWithStaticFinalField.class, String.class)); From 4374552deac2ee540c61ee19fa89a722c1459724 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:01:25 -0400 Subject: [PATCH 09/62] spelling: classes --- .../java/org/powermock/core/bytebuddy/MockGetawayCall.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powermock-core/src/main/java/org/powermock/core/bytebuddy/MockGetawayCall.java b/powermock-core/src/main/java/org/powermock/core/bytebuddy/MockGetawayCall.java index db84196c8..14ac3fb5d 100644 --- a/powermock-core/src/main/java/org/powermock/core/bytebuddy/MockGetawayCall.java +++ b/powermock-core/src/main/java/org/powermock/core/bytebuddy/MockGetawayCall.java @@ -103,7 +103,7 @@ private ConstructorMockGetawayCall(final Method getawayMethod, this.targetParameters = targetParameters; } - private List loadSignatureParametersClasess() { + private List loadSignatureParametersClasses() { List constructorSignature = new ArrayList(); for (InDefinedShape targetParameter : targetParameters) { @@ -133,7 +133,7 @@ public boolean isValid() { @Override public Size apply(final MethodVisitor mv, final Context implementationContext) { List loadTargetParameters = loadArgumentsFromVariable(); - List constructorSignature = loadSignatureParametersClasess(); + List constructorSignature = loadSignatureParametersClasses(); return new Compound( ClassConstant.of(targetType), From 4c2ead0b6e4f2ddf8ba1ca18d1945c3edab16c59 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:03:14 -0400 Subject: [PATCH 10/62] spelling: criteria --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 725277d98..dcdf9bade 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -357,7 +357,7 @@ Change log 1.3.5 (2009-12-13) * DeepCloner should now support cloning of static final fields on SUN JVM. * Fixed a minor bug in Whitebox#getInternalState so that a better error message is given when the instance argument is null (issue 205). * Fixed some typos in the javadoc of PowerMockito#verifyNew (issue 187). -* Fixed so that Whitebox#getInternalState(..) now supports passing in super types as field-type critiera (issue 210). +* Fixed so that Whitebox#getInternalState(..) now supports passing in super types as field-type criteria (issue 210). * Fixed so that Whitebox#getInternalState(..) and Whitebox#setInternalState(..) doesn't cause NPE when too many fields matched the criteria (issue 211). * Basic support for TestNG (5.11) implemented. * Fixed so that Whitebox#invokeMethod now works for overridden methods. From 2f3fc0a1af1900475b1382e5318e38817ef7023d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:03:03 -0400 Subject: [PATCH 11/62] spelling: critical --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index dcdf9bade..ff06d6b82 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -366,7 +366,7 @@ Change log 1.3.5 (2009-12-13) Change log 1.3.1 (released 2009-10-28) -------------------------------------- -* Critial bug resolved in the PowerMock JUnit 4.7 runner: Before tests would not be executed at all if a JUnit rule was used in the test (even though it looked like they were). This has now been resolved an thus support for JUnit 4.7 rules should _really_ work. +* Critical bug resolved in the PowerMock JUnit 4.7 runner: Before tests would not be executed at all if a JUnit rule was used in the test (even though it looked like they were). This has now been resolved an thus support for JUnit 4.7 rules should _really_ work. * DeepCloner now supports cloning of one dimensional arrays, primitives, enums and collections. * Test case is now always prepared for test even if no @PrepareForTest annotation is specified * Fixed a bug in Whitebox#setInternalState so that it now works to supply an array when specifying a method name again. From 3c096666d40db33dac9c2899b31c53a86d549e26 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:03:39 -0400 Subject: [PATCH 12/62] spelling: delegates --- ...t.java => AssertPowerMockRuleDelegatesToOtherRulesTest.java} | 2 +- ...t.java => AssertPowerMockRuleDelegatesToOtherRulesTest.java} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/{AssertPowerMockRuleDelagatesToOtherRulesTest.java => AssertPowerMockRuleDelegatesToOtherRulesTest.java} (97%) rename tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/{AssertPowerMockRuleDelagatesToOtherRulesTest.java => AssertPowerMockRuleDelegatesToOtherRulesTest.java} (97%) diff --git a/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelagatesToOtherRulesTest.java b/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelegatesToOtherRulesTest.java similarity index 97% rename from tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelagatesToOtherRulesTest.java rename to tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelegatesToOtherRulesTest.java index cbf8dfedc..cd341e1af 100644 --- a/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelagatesToOtherRulesTest.java +++ b/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/AssertPowerMockRuleDelegatesToOtherRulesTest.java @@ -32,7 +32,7 @@ /** * This test demonstrates that the PowerMockRule delegates to other rules. */ -public class AssertPowerMockRuleDelagatesToOtherRulesTest { +public class AssertPowerMockRuleDelegatesToOtherRulesTest { private static final MyObject BEFORE = new MyObject(); private final List objects = new LinkedList(); diff --git a/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelagatesToOtherRulesTest.java b/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelegatesToOtherRulesTest.java similarity index 97% rename from tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelagatesToOtherRulesTest.java rename to tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelegatesToOtherRulesTest.java index 0d2116495..5168cdb3a 100644 --- a/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelagatesToOtherRulesTest.java +++ b/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/AssertPowerMockRuleDelegatesToOtherRulesTest.java @@ -34,7 +34,7 @@ /** * This test demonstrates that the PowerMockRule delegates to other rules. */ -public class AssertPowerMockRuleDelagatesToOtherRulesTest { +public class AssertPowerMockRuleDelegatesToOtherRulesTest { private static final MyObject BEFORE = new MyObject(); private final List objects = new LinkedList(); From 3fabd602deb62a40c883f8499606ce61117d98a3 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:03:55 -0400 Subject: [PATCH 13/62] spelling: different --- .../java/samples/junit4/overloading/OverloadingDemoTest.java | 2 +- .../src/main/java/samples/overloading/OverloadingDemo.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/overloading/OverloadingDemoTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/overloading/OverloadingDemoTest.java index 2b6cb8d30..c353e541e 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/overloading/OverloadingDemoTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/overloading/OverloadingDemoTest.java @@ -90,7 +90,7 @@ public void mockGatewayFindsBestOverloadedMethodCandidateWhenOneArgumentSameAndO replayAll(); final OverloadingDemo demo = new OverloadingDemo(); - demo.performMethodOverloadTestWithOneArgumentSameAndOneDiffernt(); + demo.performMethodOverloadTestWithOneArgumentSameAndOneDifferent(); verifyAll(); } diff --git a/tests/utils/src/main/java/samples/overloading/OverloadingDemo.java b/tests/utils/src/main/java/samples/overloading/OverloadingDemo.java index ed10949cb..72e7ccab7 100644 --- a/tests/utils/src/main/java/samples/overloading/OverloadingDemo.java +++ b/tests/utils/src/main/java/samples/overloading/OverloadingDemo.java @@ -35,7 +35,7 @@ public void performMethodOverloadTestWhenBothArgumentSame() { OverloadedMethodsExample.overloadedMethodWithTwoArguments(object1, object2); } - public void performMethodOverloadTestWithOneArgumentSameAndOneDiffernt() { + public void performMethodOverloadTestWithOneArgumentSameAndOneDifferent() { Parent object1 = new ChildA(); Parent object2 = new Parent(); OverloadedMethodsExample.overloadedMethodWithTwoArguments(object2, object1); From 745dbfdbd47223139ed0e9d2417aac552b39e30a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:04:24 -0400 Subject: [PATCH 14/62] spelling: erroneous --- .../junit4/privatemocking/PrivateInstanceMockingCases.java | 2 +- .../powermockito/junit4/staticmocking/MockStaticCases.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/privatemocking/PrivateInstanceMockingCases.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/privatemocking/PrivateInstanceMockingCases.java index 9c38cb106..a0655fa88 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/privatemocking/PrivateInstanceMockingCases.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/privatemocking/PrivateInstanceMockingCases.java @@ -124,7 +124,7 @@ public void spyingOnPrivateFinalMethodsWorksWhenClassIsNotFinal() throws Excepti } @Test - public void errorousVerificationOnPrivateMethodGivesFilteredErrorMessage() throws Exception { + public void erroneousVerificationOnPrivateMethodGivesFilteredErrorMessage() throws Exception { PrivateMethodDemo tested = spy(new PrivateMethodDemo()); assertEquals("Hello Temp, you are 50 old.", tested.sayYear("Temp", 50)); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/staticmocking/MockStaticCases.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/staticmocking/MockStaticCases.java index 240a73722..94230a45c 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/staticmocking/MockStaticCases.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/staticmocking/MockStaticCases.java @@ -131,7 +131,7 @@ public void testMockStaticWithExpectations() throws Exception { } @Test - public void errorousVerificationOfStaticMethodsGivesANonMockitoStandardMessage() throws Exception { + public void erroneousVerificationOfStaticMethodsGivesANonMockitoStandardMessage() throws Exception { final String expected = "Hello world"; final String argument = "hello"; From b78f9b72841c3f5ba65afe11e66feb89485e4050 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:04:45 -0400 Subject: [PATCH 15/62] spelling: exception --- .../main/java/org/powermock/api/support/ClassLoaderUtil.java | 2 +- .../SuppressSpecificConstructorDemoTest.java | 2 +- .../mockito/junit4/delegate/parameterized/FinalDemoTest.java | 2 +- .../powermockito/junit4/proxymethod/ProxyMethodTest.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java b/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java index 40985539c..b4ece2d38 100644 --- a/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java +++ b/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/ClassLoaderUtil.java @@ -19,7 +19,7 @@ public class ClassLoaderUtil { /** * Loads a class with a specific classloader, wraps the - * {@link ClassNotFoundException} in a runtime exeception. + * {@link ClassNotFoundException} in a runtime exception. */ @SuppressWarnings("unchecked") public static Class loadClass(Class type, ClassLoader classloader) { diff --git a/tests/easymock/junit4/src/test/java/samples/suppressconstructor/SuppressSpecificConstructorDemoTest.java b/tests/easymock/junit4/src/test/java/samples/suppressconstructor/SuppressSpecificConstructorDemoTest.java index 50a299657..e7a158525 100644 --- a/tests/easymock/junit4/src/test/java/samples/suppressconstructor/SuppressSpecificConstructorDemoTest.java +++ b/tests/easymock/junit4/src/test/java/samples/suppressconstructor/SuppressSpecificConstructorDemoTest.java @@ -33,7 +33,7 @@ public void testMockStringConstructor() throws Exception { suppress(constructor(SuppressSpecificConstructorDemo.class, String.class)); // This should be fine - new SuppressSpecificConstructorDemo("This expection should not occur"); + new SuppressSpecificConstructorDemo("This exception should not occur"); // This should not be fine! try { new SuppressSpecificConstructorDemo(); diff --git a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/FinalDemoTest.java b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/FinalDemoTest.java index 2bef0aa7a..ee6f8025e 100644 --- a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/FinalDemoTest.java +++ b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/FinalDemoTest.java @@ -48,7 +48,7 @@ public class FinalDemoTest { public String expected; @Parameterized.Parameters(name = "expected={0}") - public static Collection expections() { + public static Collection exceptions() { return java.util.Arrays.asList(new Object[][]{ {"Hello altered World"}, {"something"}, {"test"} }); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java index 0eca76c5f..d7e23ec6b 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java @@ -39,14 +39,14 @@ public class ProxyMethodTest { @Test(expected = ArrayStoreException.class) - public void expectionThrowingMethodProxyWorksForJavaLangReflectMethods() throws Exception { + public void exceptionThrowingMethodProxyWorksForJavaLangReflectMethods() throws Exception { replace(method(SuppressMethod.class, "getObject")).with(new ThrowingInvocationHandler()); new SuppressMethod().getObject(); } @Test(expected = ArrayStoreException.class) - public void expectionThrowingMethodProxyWorksForMethodNames() throws Exception { + public void exceptionThrowingMethodProxyWorksForMethodNames() throws Exception { replace(method(SuppressMethod.class, "getObject")).with(new ThrowingInvocationHandler()); new SuppressMethod().getObject(); From 9e3d2651f32000d86f4f5c5a79048e1c448be863 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:06:35 -0400 Subject: [PATCH 16/62] spelling: exempli gratia (e.g.) https://www.dictionary.com/browse/eg --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a833cc42..9b10f7f97 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ Issues should always have a [Short, Self Contained, Correct (Compilable)](http:/ For that matter it's possible to commit [_semantic_ changes](http://lemike-de.tumblr.com/post/79041908218/semantic-commits). _Tests are an asset, so is history_. - _Exemple gratia_: + _Exempli gratia_: ``` Fixes #777 : The new feature Fixes #777 : Refactors this part of PowerMock to make feature possible From 6cf36e40d11af7b63756533f08e6bd5d5e5e26de Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:07:35 -0400 Subject: [PATCH 17/62] spelling: friendly --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index ff06d6b82..10b86bea1 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -51,7 +51,7 @@ Change log 1.6.5 (2016-04-30) * PowerMockRunner now processes JUnit Rules correctly (thanks to Stefan Birkner for pull request) (issue 427) * Added support for @TestSubject in EasyMock API. This is the equivalent of @InjectMocks in Mockito (big thanks to Arthur Zagretdinov for pull request) * Added experimental support for mockito 2.x -* Ensuring JVM method size limit is never exceeded. Throw an user frendly exception if method size is exceeded. (thanks to Tomasz Przybyla for pull request) (issue #661) +* Ensuring JVM method size limit is never exceeded. Throw an user friendly exception if method size is exceeded. (thanks to Tomasz Przybyla for pull request) (issue #661) * Fix #214: Whitebox.invokeConstructor may not work as expected with overloaded constructors * Fix #352: PowerMockRunner should run tests defined in super class * Fix #510: Static method mocking with Mockito 1.9.5 and Powermock fails with Java 8 Consumer Interface From f086039a91b4e3c978a40214f50d521a20c854e2 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:09:47 -0400 Subject: [PATCH 18/62] spelling: hierarchy --- docs/changelog.txt | 2 +- .../SuppressConstructorHierarchyDemoTest.java | 4 ++-- ....java => SuppressConstructorHierarchyEvilGrandParent.java} | 4 ++-- .../SuppressConstructorHierarchyParent.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename tests/utils/src/main/java/samples/suppressconstructor/{SuppressConstructorHeirarchyEvilGrandParent.java => SuppressConstructorHierarchyEvilGrandParent.java} (86%) diff --git a/docs/changelog.txt b/docs/changelog.txt index 10b86bea1..cb9c6f51d 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -560,7 +560,7 @@ Change log 0.9 (released 2008-11-10) * Structural refactoring to remove Structure 101 XS: moved WhiteBox implementation to separate class in core and moved IndicateReloadClass * By default Whitebox.getInternalState and Whitebox.setInternalState now traverses the class hierarchy when looking for a field. * Better error message if a NPE is caught in a subclass of a class being prepared for test. -* The PrepareForTest annotation now manipulates the full (super) class hierachy by default. This makes it easier to perform mocking of super class methods. +* The PrepareForTest annotation now manipulates the full (super) class hierarchy by default. This makes it easier to perform mocking of super class methods. * A new annotation called PrepareOnlyThisForTest has been added and works in the same way that PrepareForTest previously did, i.e. ONLY the specified classes are prepared and not the entire hierarchy. * Fixed a bug that made it impossible to invoke vararg constructors. * createMockAndExpectNew now takes expected arguments as the second parameter. diff --git a/tests/easymock/junit4-legacy/src/test/java/samples/junit4/legacy/suppressconstructor/SuppressConstructorHierarchyDemoTest.java b/tests/easymock/junit4-legacy/src/test/java/samples/junit4/legacy/suppressconstructor/SuppressConstructorHierarchyDemoTest.java index cc8c474c8..6f0f3b90b 100644 --- a/tests/easymock/junit4-legacy/src/test/java/samples/junit4/legacy/suppressconstructor/SuppressConstructorHierarchyDemoTest.java +++ b/tests/easymock/junit4-legacy/src/test/java/samples/junit4/legacy/suppressconstructor/SuppressConstructorHierarchyDemoTest.java @@ -19,7 +19,7 @@ import org.junit.runner.RunWith; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.legacy.PowerMockRunner; -import samples.suppressconstructor.SuppressConstructorHeirarchyEvilGrandParent; +import samples.suppressconstructor.SuppressConstructorHierarchyEvilGrandParent; import samples.suppressconstructor.SuppressConstructorHierarchy; import samples.suppressconstructor.SuppressConstructorHierarchyParent; @@ -29,7 +29,7 @@ import static org.powermock.api.support.membermodification.MemberModifier.suppress; @PrepareForTest( { SuppressConstructorHierarchy.class, SuppressConstructorHierarchyParent.class, - SuppressConstructorHeirarchyEvilGrandParent.class }) + SuppressConstructorHierarchyEvilGrandParent.class }) @RunWith(PowerMockRunner.class) public class SuppressConstructorHierarchyDemoTest { diff --git a/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHeirarchyEvilGrandParent.java b/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyEvilGrandParent.java similarity index 86% rename from tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHeirarchyEvilGrandParent.java rename to tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyEvilGrandParent.java index b50afae73..7acd2e312 100644 --- a/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHeirarchyEvilGrandParent.java +++ b/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyEvilGrandParent.java @@ -15,9 +15,9 @@ */ package samples.suppressconstructor; -public class SuppressConstructorHeirarchyEvilGrandParent { +public class SuppressConstructorHierarchyEvilGrandParent { - SuppressConstructorHeirarchyEvilGrandParent() { + SuppressConstructorHierarchyEvilGrandParent() { throw new RuntimeException("This should be suppressed!!"); } } diff --git a/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyParent.java b/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyParent.java index af76f6efa..9ffe49ce7 100644 --- a/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyParent.java +++ b/tests/utils/src/main/java/samples/suppressconstructor/SuppressConstructorHierarchyParent.java @@ -16,7 +16,7 @@ package samples.suppressconstructor; public class SuppressConstructorHierarchyParent extends - SuppressConstructorHeirarchyEvilGrandParent { + SuppressConstructorHierarchyEvilGrandParent { private String message; From b0c2f46ff5d46d59b567a3a4f40bfebd6461bb76 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:11:51 -0400 Subject: [PATCH 19/62] spelling: implemented --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index cb9c6f51d..e8e2183ef 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -285,7 +285,7 @@ Change log 1.4.5 (2010-08-30) Change log 1.4 (2010-07-22) --------------------------- -* Implemeted support for mocking instance methods of final system classes with the Mockito extension API (issue 169) +* Implemented support for mocking instance methods of final system classes with the Mockito extension API (issue 169) * Partial mocking of instance methods in final system classes not having a default constructor now works in the EasyMock extension API (issue 170) * The deep cloner can now clone java.reflect.Method objects correctly to a different classloader. * Fixed a critical bug in the ClassloaderExecutor which prevented it from running methods returning void. This affected the PowerMockRule which prevented it from executing test methods (even though it looked like it did) (issue 268, also closes issue 245) From 556d3a29fec8cc49e0fbefe4f806198df212c0a4 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:11:09 -0400 Subject: [PATCH 20/62] spelling: implementers --- .../java/org/powermock/tests/utils/PowerMockTestNotifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/main/java/org/powermock/tests/utils/PowerMockTestNotifier.java b/powermock-core/src/main/java/org/powermock/tests/utils/PowerMockTestNotifier.java index ae67865e3..2e6e11847 100644 --- a/powermock-core/src/main/java/org/powermock/tests/utils/PowerMockTestNotifier.java +++ b/powermock-core/src/main/java/org/powermock/tests/utils/PowerMockTestNotifier.java @@ -21,7 +21,7 @@ import java.lang.reflect.Method; /** - * Implementors of this interface that must provide the ability to notify + * Implementers of this interface that must provide the ability to notify * PowerMock test listeners with the events as specified by the methods declared * in this interface. */ From 2f5292b4aab8df191e13a8e5c5a81d60fc1b3108 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:12:13 -0400 Subject: [PATCH 21/62] spelling: implicitly --- .../src/main/java/org/powermock/classloading/DeepCloner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powermock-classloading/powermock-classloading-objenesis/src/main/java/org/powermock/classloading/DeepCloner.java b/powermock-classloading/powermock-classloading-objenesis/src/main/java/org/powermock/classloading/DeepCloner.java index 63fe26c2f..827f005aa 100644 --- a/powermock-classloading/powermock-classloading-objenesis/src/main/java/org/powermock/classloading/DeepCloner.java +++ b/powermock-classloading/powermock-classloading-objenesis/src/main/java/org/powermock/classloading/DeepCloner.java @@ -172,12 +172,12 @@ private boolean isJavaReflectClass(Class cls) { private boolean isSerializableCandidate(Class targetClass, Object source) { return isStandardJavaType(targetClass) - && (isSerializable(targetClass) || isImpliticlySerializable(targetClass)) + && (isSerializable(targetClass) || isImplicitlySerializable(targetClass)) && !Map.class.isAssignableFrom(source.getClass()) && !Iterable.class.isAssignableFrom(source.getClass()); } - private static boolean isImpliticlySerializable(Class cls) { + private static boolean isImplicitlySerializable(Class cls) { return cls.isPrimitive(); } From c7c8e6f2fae756671cc58dc4b08f49af974f9b84 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:12:56 -0400 Subject: [PATCH 22/62] spelling: impossible --- .../java/org/powermock/reflect/internal/ConstructorFinder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-reflect/src/main/java/org/powermock/reflect/internal/ConstructorFinder.java b/powermock-reflect/src/main/java/org/powermock/reflect/internal/ConstructorFinder.java index 88e83dbb5..38fdf3e63 100644 --- a/powermock-reflect/src/main/java/org/powermock/reflect/internal/ConstructorFinder.java +++ b/powermock-reflect/src/main/java/org/powermock/reflect/internal/ConstructorFinder.java @@ -42,7 +42,7 @@ public java.lang.reflect.Constructor findConstructor() { // if a constructor is found and it has varargs parameters then the constructor will be used even if // other constructor is matcher the given arguments. It is done, because when Argument Matchers are used - // arguments passed to the method are null value and it's imposable to determinate whether parameters + // arguments passed to the method are null value and it's impossible to determinate whether parameters // match to arguments or not. if (isVarArgConstructorFound()){ From e685e9896a8666c852af92cca8cf7866d013a054 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:13:12 -0400 Subject: [PATCH 23/62] spelling: initialized --- .../testclass/ForMethodsJavaAssistTestClassTransformer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/main/java/org/powermock/core/transformers/javassist/testclass/ForMethodsJavaAssistTestClassTransformer.java b/powermock-core/src/main/java/org/powermock/core/transformers/javassist/testclass/ForMethodsJavaAssistTestClassTransformer.java index d3af84010..69ef3036e 100644 --- a/powermock-core/src/main/java/org/powermock/core/transformers/javassist/testclass/ForMethodsJavaAssistTestClassTransformer.java +++ b/powermock-core/src/main/java/org/powermock/core/transformers/javassist/testclass/ForMethodsJavaAssistTestClassTransformer.java @@ -13,7 +13,7 @@ public class ForMethodsJavaAssistTestClassTransformer extends JavaAssistTestClas private final Collection testMethodsThatRunOnOtherClassLoaders; /** - * Is lazily initilized because of + * Is lazily initialized because of * AbstractTestSuiteChunkerImpl#chunkClass(Class) */ private Collection methodsThatRunOnOtherClassLoaders; From 9c5d84363d84fe570c8a1475929a41dbbb11d4fe Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:16:21 -0400 Subject: [PATCH 24/62] spelling: initializer --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index e8e2183ef..14ac5fc01 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -397,7 +397,7 @@ Change log 1.3 (released 2009-10-06) * PowerMock now supports mocking instance methods of final system classes (such as java.lang.String). To do this you need to prepare the class that invokes the method of the system class. Note that partial mocking of instance methods in final system classes doesn't yet work if a constructor needs to be invoked on the mock. * You can now mock new instance calls to final system classes in the same was you'd mock any other new instance call. * Improved error message in Whitebox when getting a method or constructor which was not found and no parameter types were supplied. -* The state of classes that should have their static intializers suppressed are no longer clear after each atomic test. This means that suppression of static initializers works (again) in test suites. +* The state of classes that should have their static initializers suppressed are no longer clear after each atomic test. This means that suppression of static initializers works (again) in test suites. * Begun working with support for TestNG (thanks to Dan Fabulich for helping us with this). * Deprecated Whitebox#getInternalState(Object object, String fieldName, Class where, Class type), use "Whitebox. getInternalState(Object object, String fieldName, Class where)" instead. * Changed return type of Whitebox#getInternalState(Object object, String fieldName) from Object to T. This means that you can avoid cast using e.g. "Whitebox. getInternalState(instance, "myFieldName")". From 333c47a28f56dfce984e9a8ab643e2cdf7122ad7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:13:31 -0400 Subject: [PATCH 25/62] spelling: instance --- .../MethodWithSameNameButDifferentDefinitionTypeTest.java | 2 +- .../powermockito/junit4/proxymethod/ProxyMethodTest.java | 2 +- .../overloading/StaticAndInstanceMethodWithSameNameUser.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/overloading/MethodWithSameNameButDifferentDefinitionTypeTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/overloading/MethodWithSameNameButDifferentDefinitionTypeTest.java index 544ca82f0..a476570ed 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/overloading/MethodWithSameNameButDifferentDefinitionTypeTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/overloading/MethodWithSameNameButDifferentDefinitionTypeTest.java @@ -45,7 +45,7 @@ public void mockGatewayCanInvokeInstanceMethodWhenClassContainsStaticAndInstance replayAll(); - new StaticAndInstanceMethodWithSameNameUser().performInstaceInvocation(mock); + new StaticAndInstanceMethodWithSameNameUser().performInstanceInvocation(mock); verifyAll(); } diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java index d7e23ec6b..dbfc21c33 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/proxymethod/ProxyMethodTest.java @@ -94,7 +94,7 @@ public void replaceInstanceMethodToStaticMethodDoesntWork() throws Exception { } @Test(expected = IllegalArgumentException.class) - public void replaceStaticMethodToInstaceMethodDoesntWork() throws Exception { + public void replaceStaticMethodToInstanceMethodDoesntWork() throws Exception { replace(method(SuppressMethod.class, "getObjectStatic")).with(method(SuppressMethodExample.class, "getStringObject")); } diff --git a/tests/utils/src/main/java/samples/overloading/StaticAndInstanceMethodWithSameNameUser.java b/tests/utils/src/main/java/samples/overloading/StaticAndInstanceMethodWithSameNameUser.java index ed6a3623b..13c9bd8d4 100644 --- a/tests/utils/src/main/java/samples/overloading/StaticAndInstanceMethodWithSameNameUser.java +++ b/tests/utils/src/main/java/samples/overloading/StaticAndInstanceMethodWithSameNameUser.java @@ -24,7 +24,7 @@ */ public class StaticAndInstanceMethodWithSameNameUser { - public void performInstaceInvocation(StaticAndInstanceMethodWithSameName object) { + public void performInstanceInvocation(StaticAndInstanceMethodWithSameName object) { Parent child = new ChildA(); object.overloaded(child); } From 4375c83feb2835d96d51d6a27ed556ba8fb6f85b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:13:46 -0400 Subject: [PATCH 26/62] spelling: instantiated --- .../java/samples/junit4/suppressfield/SuppressFieldTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java index 3c86c02d1..5b1d79110 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java @@ -90,7 +90,7 @@ public void assertThatAllFieldSuppressionWorks() throws Exception { } @Test - public void assertThatObjectIsNeverInstansiated() throws Exception { + public void assertThatObjectIsNeverInstantiated() throws Exception { suppress(field(SuppressField.class, "domainObject")); SuppressField suppressField = new SuppressField(); assertNull(suppressField.getDomainObject()); From 66ea0a2fb50dae7164e5f20f4593bf7d05a57b58 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:15:19 -0400 Subject: [PATCH 27/62] spelling: insufficient --- .../src/main/java/sun/tools/attach/HotSpotVirtualMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java b/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java index 5835e0e3e..71c18b7e2 100644 --- a/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java +++ b/powermock-modules/powermock-module-javaagent/src/main/java/sun/tools/attach/HotSpotVirtualMachine.java @@ -114,7 +114,7 @@ public void loadAgent(String agent, String options) int rc = x.returnValue(); switch (rc) { case JNI_ENOMEM: - throw new AgentLoadException("Insuffient memory"); + throw new AgentLoadException("Insufficient memory"); case ATTACH_ERROR_BADJAR: throw new AgentLoadException("Agent JAR not found or no Agent-Class attribute"); case ATTACH_ERROR_NOTONCP: From 3627fecd68d0a5657716867a37608448345c9a1a Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:15:42 -0400 Subject: [PATCH 28/62] spelling: intellij --- gradle/shipkit.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/shipkit.gradle b/gradle/shipkit.gradle index 8490f63f5..84dc7ce45 100644 --- a/gradle/shipkit.gradle +++ b/gradle/shipkit.gradle @@ -9,7 +9,7 @@ shipkit { git.tagPrefix = "powermock-" - // fix for Intellj Idea, because IDE does not read env properties from ${user.home}/.profile file on MacOS + // fix for IntelliJ Idea, because IDE does not read env properties from ${user.home}/.profile file on MacOS gitHub.writeAuthUser = System.getenv("GH_USER") gitHub.writeAuthToken = System.getenv("GH_WRITE_TOKEN") From d32cf9a6dca7cd141a954d917847181f5e034641 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:16:02 -0400 Subject: [PATCH 29/62] spelling: internal --- .../src/test/java/org/powermock/reflect/WhiteBoxTest.java | 8 ++++---- .../reflect/testclasses/ClassWithInternalState.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java index 7c63025f3..b57413701 100644 --- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java +++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java @@ -116,7 +116,7 @@ public void testFindMethod_noMethodFound() throws Exception { @Test public void testGetInternalState_object() throws Exception { ClassWithInternalState tested = new ClassWithInternalState(); - tested.increaseInteralState(); + tested.increaseInternalState(); Object internalState = Whitebox.getInternalState(tested, "internalState"); assertTrue("InternalState should be instanceof Integer", internalState instanceof Integer); assertEquals(1, internalState); @@ -126,7 +126,7 @@ public void testGetInternalState_object() throws Exception { @Test public void testGetInternalState_parmaterizedType() throws Exception { ClassWithInternalState tested = new ClassWithInternalState(); - tested.increaseInteralState(); + tested.increaseInternalState(); int internalState = Whitebox.getInternalState(tested, "internalState", tested.getClass(), int.class); assertEquals(1, internalState); } @@ -134,7 +134,7 @@ public void testGetInternalState_parmaterizedType() throws Exception { @Test public void testSetInternalState() throws Exception { ClassWithInternalState tested = new ClassWithInternalState(); - tested.increaseInteralState(); + tested.increaseInternalState(); Whitebox.setInternalState(tested, "anotherInternalState", 2); assertEquals(2, tested.getAnotherInternalState()); } @@ -152,7 +152,7 @@ public void testSetInternalStateWithMultipleValues() throws Exception { @Test public void testSetInternalState_superClass() throws Exception { ClassWithChildThatHasInternalState tested = new ClassWithChildThatHasInternalState(); - tested.increaseInteralState(); + tested.increaseInternalState(); Whitebox.setInternalState(tested, "anotherInternalState", 2, ClassWithInternalState.class); assertEquals(2, tested.getAnotherInternalState()); } diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/testclasses/ClassWithInternalState.java b/powermock-reflect/src/test/java/org/powermock/reflect/testclasses/ClassWithInternalState.java index bcb8806ac..d1b84fc46 100644 --- a/powermock-reflect/src/test/java/org/powermock/reflect/testclasses/ClassWithInternalState.java +++ b/powermock-reflect/src/test/java/org/powermock/reflect/testclasses/ClassWithInternalState.java @@ -47,11 +47,11 @@ public String getFinalString() { return finalString; } - public void increaseInteralState() { + public void increaseInternalState() { internalState++; } - public void decreaseInteralState() { + public void decreaseInternalState() { internalState--; } From ff90a2e76a367bba2d23c0e107133aee5ff1a9cb Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Wed, 12 Jun 2019 00:16:44 -0400 Subject: [PATCH 30/62] spelling: invocation --- .../test/java/samples/junit4/expectnew/ExpectNewCases.java | 4 ++-- .../ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java | 4 ++-- .../samples/junit4/replayall/ReplayAllForExpectNewTest.java | 2 +- .../samples/powermockito/junit4/whennew/WhenNewCases.java | 4 ++-- .../powermockito/junit4/whennew/WhenNewCases.java.orig | 4 ++-- .../utils/src/main/java/samples/expectnew/ExpectNewDemo.java | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java b/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java index 55664d529..1a0a34aa5 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java @@ -48,7 +48,7 @@ public void testNewWithCheckedException() throws Exception { replay(MyClass.class); try { - tested.throwExceptionAndWrapInRunTimeWhenInvoction(); + tested.throwExceptionAndWrapInRunTimeWhenInvocation(); fail("Should throw a checked Exception!"); } catch (RuntimeException e) { assertTrue(e.getCause() instanceof IOException); @@ -120,7 +120,7 @@ public void testNewWithRuntimeException() throws Exception { replay(MyClass.class); try { - tested.throwExceptionWhenInvoction(); + tested.throwExceptionWhenInvocation(); fail("Should throw RuntimeException!"); } catch (RuntimeException e) { assertEquals(expectedFailMessage, e.getMessage()); diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java index 52b18571d..26b67e11f 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java @@ -57,7 +57,7 @@ public void testNewWithCheckedException() throws Exception { replayAll(); try { - tested.throwExceptionAndWrapInRunTimeWhenInvoction(); + tested.throwExceptionAndWrapInRunTimeWhenInvocation(); fail("Should throw a checked Exception!"); } catch (RuntimeException e) { assertTrue(e.getCause() instanceof IOException); @@ -130,7 +130,7 @@ public void testNewWithRuntimeException() throws Exception { replayAll(); try { - tested.throwExceptionWhenInvoction(); + tested.throwExceptionWhenInvocation(); fail("Should throw RuntimeException!"); } catch (RuntimeException e) { assertEquals(expectedFailMessage, e.getMessage()); diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/replayall/ReplayAllForExpectNewTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/replayall/ReplayAllForExpectNewTest.java index 37118209c..4af5c9e7c 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/replayall/ReplayAllForExpectNewTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/replayall/ReplayAllForExpectNewTest.java @@ -49,7 +49,7 @@ public void testNewWithCheckedException() throws Exception { replayAll(); try { - tested.throwExceptionAndWrapInRunTimeWhenInvoction(); + tested.throwExceptionAndWrapInRunTimeWhenInvocation(); fail("Should throw a checked Exception!"); } catch (RuntimeException e) { assertTrue(e.getCause() instanceof IOException); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java index e44be50bd..73148f6ec 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java @@ -266,7 +266,7 @@ public void testNewWithCheckedException() throws Exception { whenNew(MyClass.class).withNoArguments().thenThrow(new IOException(expectedFailMessage)); try { - tested.throwExceptionAndWrapInRunTimeWhenInvoction(); + tested.throwExceptionAndWrapInRunTimeWhenInvocation(); fail("Should throw a checked Exception!"); } catch (RuntimeException e) { assertTrue(e.getCause() instanceof IOException); @@ -333,7 +333,7 @@ public void testNewWithRuntimeException() throws Exception { whenNew(MyClass.class).withNoArguments().thenThrow(new RuntimeException(expectedFailMessage)); try { - tested.throwExceptionWhenInvoction(); + tested.throwExceptionWhenInvocation(); fail("Should throw RuntimeException!"); } catch (RuntimeException e) { assertEquals(expectedFailMessage, e.getMessage()); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig index 0afede145..85dd3d7cf 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig @@ -88,7 +88,7 @@ public class WhenNewCases { whenNew(MyClass.class).withNoArguments().thenThrow(new IOException(expectedFailMessage)); try { - tested.throwExceptionAndWrapInRunTimeWhenInvoction(); + tested.throwExceptionAndWrapInRunTimeWhenInvocation(); fail("Should throw a checked Exception!"); } catch (RuntimeException e) { assertTrue(e.getCause() instanceof IOException); @@ -155,7 +155,7 @@ public class WhenNewCases { whenNew(MyClass.class).withNoArguments().thenThrow(new RuntimeException(expectedFailMessage)); try { - tested.throwExceptionWhenInvoction(); + tested.throwExceptionWhenInvocation(); fail("Should throw RuntimeException!"); } catch (RuntimeException e) { assertEquals(expectedFailMessage, e.getMessage()); diff --git a/tests/utils/src/main/java/samples/expectnew/ExpectNewDemo.java b/tests/utils/src/main/java/samples/expectnew/ExpectNewDemo.java index e8da872e8..05c07495d 100644 --- a/tests/utils/src/main/java/samples/expectnew/ExpectNewDemo.java +++ b/tests/utils/src/main/java/samples/expectnew/ExpectNewDemo.java @@ -66,7 +66,7 @@ public void invokeVoidMethod() { * The purpose of the method is to demonstrate that a test case can mock the * new instance call and throw an exception upon instantiation. */ - public void throwExceptionWhenInvoction() { + public void throwExceptionWhenInvocation() { new MyClass(); } @@ -74,7 +74,7 @@ public void throwExceptionWhenInvoction() { * The purpose of the method is to demonstrate that a test case can mock the * new instance call and throw an exception upon instantiation. */ - public void throwExceptionAndWrapInRunTimeWhenInvoction() { + public void throwExceptionAndWrapInRunTimeWhenInvocation() { try { new MyClass(); } catch (Exception e) { From 4895b4993c2db37c3f85876bb17a4f4f5ffffc2e Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:52:24 -0400 Subject: [PATCH 31/62] spelling: listener --- .../src/main/java/org/powermock/api/mockito/PowerMockito.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java index af98d5fec..feda7b31e 100644 --- a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java +++ b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/PowerMockito.java @@ -97,7 +97,7 @@ public static void mockStatic(Class classMock, @SuppressWarnings("rawtypes") *

*

      *   mockStatic(Listener.class, withSettings()
-     *     .name("firstListner").defaultBehavior(RETURNS_SMART_NULLS));
+     *     .name("firstListener").defaultBehavior(RETURNS_SMART_NULLS));
      *   );
      * 
*

@@ -160,7 +160,7 @@ public static T mock(Class classToMock, @SuppressWarnings("rawtypes") Ans *

*

      *   Listener mock = mock(Listener.class, withSettings()
-     *     .name("firstListner").defaultBehavior(RETURNS_SMART_NULLS));
+     *     .name("firstListener").defaultBehavior(RETURNS_SMART_NULLS));
      *   );
      * 
*

From 08eceeddd4003fede8059fc46db783c79e2d109f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:52:39 -0400 Subject: [PATCH 32/62] spelling: location --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 14ac5fc01..97d9e6884 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -518,7 +518,7 @@ Change log 1.1 (released 2008-12-12) * Whitebox.getMethod(..) sets the accessible flag to true if a method is found. * Added Whitebox.getMethod(Class type, Class... parameterTypes) that let's you get a single method without specifying the method name. * Fixed a bug in WhiteboxImpl.checkIfTypesAreSame(..) that prevented classes to be identified correctly. -* Fixed a bug in the PowerMockJUnit44RunnerDelegateImpl that caused a NoClassDefFoundError to be thrown when using JUnit 4.5 when a AssumptionViolatedException was thrown. The reason for this was that JUnit has changed to locatation of this exception. +* Fixed a bug in the PowerMockJUnit44RunnerDelegateImpl that caused a NoClassDefFoundError to be thrown when using JUnit 4.5 when a AssumptionViolatedException was thrown. The reason for this was that JUnit has changed to location of this exception. * Added spy functionality of final classes and methods to the Mockito API (experimental). * Fixed so that it works to place the PrepareForTest annotation at methods without specifying it at the class-level first. * Added Whitebox.getField(..) method to get a field somewhere in the hierarchy. From ffbdfded9d33692f0f6ac77fa642dff168291e00 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:53:03 -0400 Subject: [PATCH 33/62] spelling: member --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 97d9e6884..05ab5d1ed 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -453,7 +453,7 @@ Change log 1.3 (released 2009-10-06) * PowerMock and PowerMockito now supports proxying methods, including private methods using replace(..), e.g. replace(method(MyClass.class, "methodToProxy")).with(myInvocationHandler). Every call to the "methodToProxy" method will be routed to the supplied invocation handler instead. * PowerMock and PowerMockito now supports duck typing of static methods, including static private methods using replace(..), e.g. replace(method(MyClass.class, "methodToDuckType")).with(method(MyOtherClass.class, "methodToInvoke")). Every call to the "methodToDuckType" method will be routed to the "methodToInvoke" method instead. * Mock policies now supports proxing methods using proxyMethod(..). -* Private inner memeber interfaces are not changed to public anymore during the byte-code manipulation session +* Private inner member interfaces are not changed to public anymore during the byte-code manipulation session * PowerMock JUnit4 Runner can now instantiate test classes that have a String constructor if the test class extends from junit.framework.TestCase. Change log 1.2.5 (released 2009-05-05) From 779020d23840aae8a3d49105d43c3a7de637dd63 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:54:53 -0400 Subject: [PATCH 34/62] spelling: message --- .../modules/test/mockito/junit4/delegate/EnclosedTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/EnclosedTest.java b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/EnclosedTest.java index f0fa6d0c8..5da4d8475 100644 --- a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/EnclosedTest.java +++ b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/EnclosedTest.java @@ -57,7 +57,7 @@ public void stubbedStaticReturnValue() { mockStatic(StaticAndInstanceDemo.class); when(StaticAndInstanceDemo.getStaticMessage()) .thenReturn(stubbedReturnValue); - assertThat("Stubbed return-value of #getStaticMessag()", + assertThat("Stubbed return-value of #getStaticMessage()", StaticAndInstanceDemo.getStaticMessage(), equalTo(stubbedReturnValue)); verifyStatic(StaticAndInstanceDemo.class); From 590e3968f844507a9402565e80e996c81b415d0f Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:55:33 -0400 Subject: [PATCH 35/62] spelling: method --- docs/changelog.txt | 2 +- .../strategy/impl/MethodReplaceStrategyImpl.java | 2 +- .../java/org/powermock/reflect/internal/WhiteboxImpl.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 05ab5d1ed..9a83e7f02 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -38,7 +38,7 @@ Change log 1.6.6 (2016-11-04) * Fixed #645 jacoco offline instrumentation incompatibility with powermock byte-code manipulation when using @SuppressStaticInitializationFor * Fixed #704 PowerMockito 1.6.5 throws java.lang.SecurityException signer information mismatch * Refactoring: Move ProxyFramework from api modules to `reflect` module. -* Renamed org.powermock.reflect.internal.WhiteboxImpl.getAllMetodsExcept to org.powermock.reflect.internal.WhiteboxImpl.getAllMethodsExcept (typo) +* Renamed org.powermock.reflect.internal.WhiteboxImpl.getAllMethodsExcept to org.powermock.reflect.internal.WhiteboxImpl.getAllMethodsExcept (typo) * Refactoring: Fix performance issues, fix error handling issues, remove unused imports, remove verbose or redundant code constructs. (thanks to Mykhailo Kovalskyi @kovalsky for pull request) * Upgraded Assertj dependency from 3.4.1 to version 3.5.2 * Upgraded Javaassist dependency from 3.20.0-GA to version 3.21.0-GA diff --git a/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/membermodification/strategy/impl/MethodReplaceStrategyImpl.java b/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/membermodification/strategy/impl/MethodReplaceStrategyImpl.java index 3be60dd0b..40dc8159a 100644 --- a/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/membermodification/strategy/impl/MethodReplaceStrategyImpl.java +++ b/powermock-api/powermock-api-support/src/main/java/org/powermock/api/support/membermodification/strategy/impl/MethodReplaceStrategyImpl.java @@ -37,7 +37,7 @@ public MethodReplaceStrategyImpl(Method method) { @Override public void with(Method method) { if (method == null) { - throw new IllegalArgumentException("A metod cannot be replaced with null."); + throw new IllegalArgumentException("A method cannot be replaced with null."); } if (!Modifier.isStatic(this.method.getModifiers())) { throw new IllegalArgumentException(String.format("Replace requires static methods, '%s' is not static", this.method)); diff --git a/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java b/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java index bb35d0517..6c877099a 100644 --- a/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java +++ b/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java @@ -1893,13 +1893,13 @@ public static Method[] getAllMethodExcept(Class type, String... methodNam } /** - * Gets the all metods except. + * Gets the all methods except. * * @param the generic type * @param type the type * @param methodNameToExclude the method name to exclude * @param argumentTypes the argument types - * @return the all metods except + * @return the all methods except */ public static Method[] getAllMethodsExcept(Class type, String methodNameToExclude, Class[] argumentTypes) { Method[] methods = getAllMethods(type); From e799c4f063e420164efe57ff681421b99aeab50c Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:56:00 -0400 Subject: [PATCH 36/62] spelling: mockito --- docs/changelog.txt | 2 +- .../mockito/internal/expectation/PowerMockitoStubberImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 9a83e7f02..ef4b12879 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -91,7 +91,7 @@ Change log 1.6.2 (2015-01-03) * Tests can now have multiple constructors (thanks to Henrik Kaipe for pull request) * Cleanup pom files and added version numbers (thanks to René Scheibe for pull request) * Fix "Test class can only have one constructor" issue that occurs when a JUnit or 3rd-party delegate runner (specified by a PowerMockRunnerDelegate annotation) can only deal with one public constructor. (thanks to Henrik Kaipe for pull request) -* Packaged some of the Mocktio classes internally since Mockito is moving from CgLib to ByteBuddy. (thanks to Brice Dutheil for the pull request). +* Packaged some of the Mockito classes internally since Mockito is moving from CgLib to ByteBuddy. (thanks to Brice Dutheil for the pull request). * Upgraded Javassist dependency to version 3.19.0-GA. * Upgraded TestNG dependency to version 6.8.21. * The PowerMock EasyMock Api now depends on EasyMock 3.3.1. diff --git a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/expectation/PowerMockitoStubberImpl.java b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/expectation/PowerMockitoStubberImpl.java index 72c2a739b..175c89fdf 100644 --- a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/expectation/PowerMockitoStubberImpl.java +++ b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/expectation/PowerMockitoStubberImpl.java @@ -27,7 +27,7 @@ import java.lang.reflect.Method; /** - * Extension of the standard Mocktio stubber implementation that also support + * Extension of the standard Mockito stubber implementation that also support * PowerMockito created mocks. */ public class PowerMockitoStubberImpl implements PowerMockitoStubber, Stubber { From fa1bc8f6c792d33db751a60bab681fe34b7c0682 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:56:08 -0400 Subject: [PATCH 37/62] spelling: modifying --- .../samples/innerclassmocking/ClassWithPrivateInnerClass.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils/src/main/java/samples/innerclassmocking/ClassWithPrivateInnerClass.java b/tests/utils/src/main/java/samples/innerclassmocking/ClassWithPrivateInnerClass.java index 069557df4..941b9e374 100644 --- a/tests/utils/src/main/java/samples/innerclassmocking/ClassWithPrivateInnerClass.java +++ b/tests/utils/src/main/java/samples/innerclassmocking/ClassWithPrivateInnerClass.java @@ -19,7 +19,7 @@ * Used for demonstration of the ability to mock methods from a private inner * class. Due to limitations in Javassist (which doesn't seem to load inner * classes correctly??) we cannot mock private methods in inner classes. It - * doesn't seem to have any effect when modifing the method modifier and setting + * doesn't seem to have any effect when modifying the method modifier and setting * the method to public when loading the class by the mock class loader (but * why? Could be because the outer class has already been loaded?!). * From 54b48b0900ee9b34e2c24efcf0e1dc003d3f85c6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:56:53 -0400 Subject: [PATCH 38/62] spelling: objenesis --- .../javassist/support/PowerMockExpressionEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/main/java/org/powermock/core/transformers/javassist/support/PowerMockExpressionEditor.java b/powermock-core/src/main/java/org/powermock/core/transformers/javassist/support/PowerMockExpressionEditor.java index 876b3bcc4..65d443b34 100644 --- a/powermock-core/src/main/java/org/powermock/core/transformers/javassist/support/PowerMockExpressionEditor.java +++ b/powermock-core/src/main/java/org/powermock/core/transformers/javassist/support/PowerMockExpressionEditor.java @@ -69,7 +69,7 @@ public void edit(NewExpr e) throws CannotCompileException { "} else {" + " $_ = $proceed($$);" + "}"; - // TODO Change to objenisis instead + // TODO Change to objenesis instead e.replace(code); } From 24a3a676a6676f017637ea07628f72adf1fefc0d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:57:03 -0400 Subject: [PATCH 39/62] spelling: official --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ada10bd6b..e1e3a4ef5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Please note that PowerMock is mainly intended for people with expert knowledge i ## News * 2019-04-21: PowerMock 2.0.2 has been release and available in Maven Central. The release includes fix the [issue](https://github.com/powermock/powermock/issues/979) wiht PowerMock JavaAgent with latest JDK and [security issue](https://github.com/powermock/powermock/issues/973) wiht build script. -* 2019-01-07: PowerMock 2.0.0 has been released. Main changes: offical supporting Mockito 2.x and dropping supporting Mockito 1.x. This release also supports Java 9. Other change read in [release notes](https://github.com/powermock/powermock/releases/tag/powermock-2.0.0). +* 2019-01-07: PowerMock 2.0.0 has been released. Main changes: official supporting Mockito 2.x and dropping supporting Mockito 1.x. This release also supports Java 9. Other change read in [release notes](https://github.com/powermock/powermock/releases/tag/powermock-2.0.0). * 2017-08-12: PowerMock 1.7.1 has been released with one, but significant change: the old API for verifying static mock has been deprecated and a new one has been added. Old API will be removed in version PowerMock 2.0 due to incompatibility with Mockito Public API. * 2017-06-16: PowerMock 1.7.0 has been released with support for Mockito 2 (not only beta versions) and new features such as global `@PowerMockIgnore` as well as bug fixes and other improvements. See [release notes](https://github.com/powermock/powermock/releases/tag/powermock-1.7.0) and [change log](https://raw.githubusercontent.com/powermock/powermock/master/docs/changelog.txt) for details. * 2017-02-03: Johan blogs about how to mock slf4j with PowerMock at his [blog](http://code.haleby.se/2017/02/03/a-case-for-powermock/) From c37da1844db6797db9476a4c27980064c20061fe Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:57:44 -0400 Subject: [PATCH 40/62] spelling: overridden --- docs/changelog.txt | 2 +- .../src/test/java/org/powermock/reflect/WhiteBoxTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index ef4b12879..0908d58c1 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -270,7 +270,7 @@ Change log 1.4.6 (2010-10-13) * PowerMock can now be built with Maven 3 (issue 283). * Prepared pom's for Maven central synching. * Upgraded the TestNG module to version 5.14 (issue 275). -* Fixed a bug in Whitebox which caused some overriden methods to be treated as overloaded (issue 276). +* Fixed a bug in Whitebox which caused some overridden methods to be treated as overloaded (issue 276). Change log 1.4.5 (2010-08-30) ----------------------------- diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java index b57413701..bafa38427 100644 --- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java +++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java @@ -854,7 +854,7 @@ public void getInternalStateThrowsTooManyFieldsFoundWhenTooManyFieldsMatchTheSup } @Test - public void invokeMethodInvokesOverridenMethods() throws Exception { + public void invokeMethodInvokesOverriddenMethods() throws Exception { assertTrue(Whitebox.invokeMethod(new ClassWithOverriddenMethod(), 2.0d)); } From df94289ef5bab08d9e097e207e1165792f1271d6 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:58:05 -0400 Subject: [PATCH 41/62] spelling: package --- .../org/powermock/core/classloader/MockClassLoaderTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/test/java/org/powermock/core/classloader/MockClassLoaderTest.java b/powermock-core/src/test/java/org/powermock/core/classloader/MockClassLoaderTest.java index 2ac1ebca1..c1cf974be 100644 --- a/powermock-core/src/test/java/org/powermock/core/classloader/MockClassLoaderTest.java +++ b/powermock-core/src/test/java/org/powermock/core/classloader/MockClassLoaderTest.java @@ -134,7 +134,7 @@ public void should_load_defined_class() throws Exception { } @Test - public void should_ignore_pagackage_added_powerMockIgnore_Annotated() throws Exception { + public void should_ignore_package_added_powerMockIgnore_Annotated() throws Exception { MockClassLoader mockClassLoader = mockClassLoaderFactory.getInstance(new String[]{"org.ikk.Jux"}); MockClassLoaderConfiguration configuration = mockClassLoader.getConfiguration(); From e3d03fce3f09f1daf6854a47c027c9866935c0ec Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:58:31 -0400 Subject: [PATCH 42/62] spelling: parameterized --- .../src/test/java/org/powermock/reflect/WhiteBoxTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java index bafa38427..bc7d730f9 100644 --- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java +++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java @@ -124,7 +124,7 @@ public void testGetInternalState_object() throws Exception { @SuppressWarnings("deprecation") @Test - public void testGetInternalState_parmaterizedType() throws Exception { + public void testGetInternalState_parameterizedType() throws Exception { ClassWithInternalState tested = new ClassWithInternalState(); tested.increaseInternalState(); int internalState = Whitebox.getInternalState(tested, "internalState", tested.getClass(), int.class); From 08f3d69bdf2bdb75ce0dda7317bc000f33d88480 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:58:17 -0400 Subject: [PATCH 43/62] spelling: parameters --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 0908d58c1..3eb53bf77 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -253,7 +253,7 @@ Change log 1.4.7 (2010-12-27) * Fixed a bug which made it impossible to mock private methods with multiple arguments (issue 289). * Removed some unwanted debug messages from the TestNG module. * Updated javadoc in Whitebox and WhiteboxImpl. -* EasyMock and Mockito extension API now supports mocking new invocations with var args parameters when var args paramters is not the first parameter (issue 163). +* EasyMock and Mockito extension API now supports mocking new invocations with var args parameters when var args parameters is not the first parameter (issue 163). * Various improvements to var args handling for both methods and constructors. * Upgraded to Javassist 3.14 (issue 295). * Upgraded junit module to use JUnit 4.8.2 (issue 296). From 1ffbdc77df736b255efd88499c6fb54657d322c4 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:59:02 -0400 Subject: [PATCH 44/62] spelling: previous --- version.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.properties b/version.properties index a64bebb35..fc57f23b2 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ #Currently building version version=2.0.3 -#Prevoius version used to generate release notes delta +#Previous version used to generate release notes delta previousVersion=2.0.2 From c283be1f5f3afb479de4e0cca4820751d523e709 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 03:59:16 -0400 Subject: [PATCH 45/62] spelling: primitive --- .../src/test/java/org/powermock/reflect/WhiteBoxTest.java | 8 ++++---- .../java/samples/junit4/stubmethod/StubMethodTest.java | 2 +- .../samples/powermockito/junit4/agent/StubMethodTest.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java index bc7d730f9..a0d277fec 100644 --- a/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java +++ b/powermock-reflect/src/test/java/org/powermock/reflect/WhiteBoxTest.java @@ -173,12 +173,12 @@ public void testGetInternalState_superClass_parameterized() throws Exception { } @Test - public void testInvokePrivateMethod_primtiveType() throws Exception { + public void testInvokePrivateMethod_primitiveType() throws Exception { assertTrue(Whitebox.invokeMethod(new ClassWithPrivateMethods(), "primitiveMethod", 8.2)); } @Test - public void testInvokePrivateMethod_primtiveType_withoutSpecifyingMethodName() throws Exception { + public void testInvokePrivateMethod_primitiveType_withoutSpecifyingMethodName() throws Exception { assertTrue((Boolean) Whitebox.invokeMethod(new ClassWithUniquePrivateMethods(), 8.2d, 8.4d)); } @@ -220,7 +220,7 @@ public void testInvokeStaticPrivateMethod_withoutSpecifyingMethodName_onlyOneArg } @Test - public void testInvokePrivateMethod_primtiveType_Wrapped() throws Exception { + public void testInvokePrivateMethod_primitiveType_Wrapped() throws Exception { assertTrue((Boolean) Whitebox.invokeMethod(new ClassWithPrivateMethods(), "primitiveMethod", new Double(8.2))); } @@ -247,7 +247,7 @@ public void testMethodWithPrimitiveIntAndString_Wrapped() throws Exception { } @Test - public void testMethodWithPrimitiveAndWrappedInt_primtive_wrapped() throws Exception { + public void testMethodWithPrimitiveAndWrappedInt_primitive_wrapped() throws Exception { assertEquals(17, Whitebox.invokeMethod(new ClassWithPrivateMethods(), "methodWithPrimitiveAndWrappedInt", new Class[]{int.class, Integer.class}, 9, Integer.valueOf(8))); } diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/stubmethod/StubMethodTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/stubmethod/StubMethodTest.java index 86f5461e4..4af4a4252 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/stubmethod/StubMethodTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/stubmethod/StubMethodTest.java @@ -53,7 +53,7 @@ public void whenStubbingStaticMethodTheMethodReturnsTheStubbedValue() throws Exc } @Test - public void whenStubbingInstanceMethodWithPrimiteValueTheMethodReturnsTheStubbedValue() throws Exception { + public void whenStubbingInstanceMethodWithPrimitiveValueTheMethodReturnsTheStubbedValue() throws Exception { float expectedValue = 4; stub(method(SuppressMethod.class, "getFloat")).toReturn(expectedValue); diff --git a/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/StubMethodTest.java b/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/StubMethodTest.java index 07e457810..c5aa1091a 100644 --- a/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/StubMethodTest.java +++ b/tests/mockito/junit4-agent/src/test/java/samples/powermockito/junit4/agent/StubMethodTest.java @@ -55,7 +55,7 @@ public void whenStubbingStaticMethodTheMethodReturnsTheStubbedValue() throws Exc } @Test - public void whenStubbingInstanceMethodWithPrimiteValueTheMethodReturnsTheStubbedValue() throws Exception { + public void whenStubbingInstanceMethodWithPrimitiveValueTheMethodReturnsTheStubbedValue() throws Exception { float expectedValue = 4; stub(method(SuppressMethod.class, "getFloat")).toReturn(expectedValue); From e9111bd9ed0b2816c91a65903cfa583ca1b34e27 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:00:04 -0400 Subject: [PATCH 46/62] spelling: private --- .../java/samples/junit4/privateandfinal/PrivateFinalTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/privateandfinal/PrivateFinalTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/privateandfinal/PrivateFinalTest.java index 8f395deec..8bb35ccff 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/privateandfinal/PrivateFinalTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/privateandfinal/PrivateFinalTest.java @@ -36,7 +36,7 @@ public class PrivateFinalTest { @Test - public void testMockPrivatAndFinal() throws Exception { + public void testMockPrivateAndFinal() throws Exception { PrivateFinal tested = createPartialMock(PrivateFinal.class, "sayIt"); From 531b167403e3f942f1d0f50f6df769d34a74ce50 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:00:21 -0400 Subject: [PATCH 47/62] spelling: programmatically --- .../modules/testng/internal/TestClassInstanceFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-modules/powermock-module-testng/src/main/java/org/powermock/modules/testng/internal/TestClassInstanceFactory.java b/powermock-modules/powermock-module-testng/src/main/java/org/powermock/modules/testng/internal/TestClassInstanceFactory.java index c63ee9a6a..f6d9901b5 100644 --- a/powermock-modules/powermock-module-testng/src/main/java/org/powermock/modules/testng/internal/TestClassInstanceFactory.java +++ b/powermock-modules/powermock-module-testng/src/main/java/org/powermock/modules/testng/internal/TestClassInstanceFactory.java @@ -63,7 +63,7 @@ Object create() { /** * We proxy the test class in order to be able to clear state after each * test method invocation. It would be much better to be able to register a - * testng listener programmtically but I cannot find a way to do so. + * testng listener programmatically but I cannot find a way to do so. */ private Class createTestClass(Class actualTestClass) throws Exception { From 0335f2e4f7603bb961d7eca626603930ad8e7a39 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:00:34 -0400 Subject: [PATCH 48/62] spelling: proxying --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 3eb53bf77..1b7ae1caa 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -452,7 +452,7 @@ Change log 1.3 (released 2009-10-06) * PowerMock and PowerMockito now supports stubbing methods (including private methods). Use PowerMock#stub or PowerMockito#stub to accomplish this. * PowerMock and PowerMockito now supports proxying methods, including private methods using replace(..), e.g. replace(method(MyClass.class, "methodToProxy")).with(myInvocationHandler). Every call to the "methodToProxy" method will be routed to the supplied invocation handler instead. * PowerMock and PowerMockito now supports duck typing of static methods, including static private methods using replace(..), e.g. replace(method(MyClass.class, "methodToDuckType")).with(method(MyOtherClass.class, "methodToInvoke")). Every call to the "methodToDuckType" method will be routed to the "methodToInvoke" method instead. -* Mock policies now supports proxing methods using proxyMethod(..). +* Mock policies now supports proxying methods using proxyMethod(..). * Private inner member interfaces are not changed to public anymore during the byte-code manipulation session * PowerMock JUnit4 Runner can now instantiate test classes that have a String constructor if the test class extends from junit.framework.TestCase. From 4854220aac5e8cc192ca3dd7d51ce804ed0669d8 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:00:53 -0400 Subject: [PATCH 49/62] spelling: released --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 1b7ae1caa..8be916bc8 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -579,7 +579,7 @@ Change log 0.9 (released 2008-11-10) * Changed the clean-up mechanisms of PowerMock.replay(..) and PowerMock.verify(..). Should no longer clear unnecessary state. * Implemented two new PowerMock API methods: replayAll and verifyAll(). These can be used to replay and verify all classes and mocks created by the PowerMock API without having to explicitly specify each and everyone. -Change log 0.8.5 (releasd 2008-10-30) +Change log 0.8.5 (released 2008-10-30) ------------------------------------- * Fixed so that it's now possible to mock abstract methods * WhiteBox.getMethod(..) now also returns protected and package-private methods. From 87bdeeb7028a1eca5f82ba4cd74a1e18331904a5 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:01:28 -0400 Subject: [PATCH 50/62] spelling: retrieve --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index 8be916bc8..ab58d6092 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -513,7 +513,7 @@ Change log 1.1 (released 2008-12-12) * Errors are propagated correctly when invoking the PowerMock.replay(..) method (i.e. they are no longer wrapped in run-time exceptions). * Added a MockNice and MockStrict annotation which can be placed on fields to allow for the AnnotationEnabler of the EasyMock api to create and inject mock objects. * Changed so that the default suppression value for methods returning java.lang.String is null to conform with EasyMock and Mockito. -* Added Whitebox.getFieldsOfType(..) that can be used to retreive all fields of a particular type in a class hierarchy. +* Added Whitebox.getFieldsOfType(..) that can be used to retrieve all fields of a particular type in a class hierarchy. * Added support for mock policies. A mock policy can be used to make it easier to unit test some code with PowerMock in isolation from a certain framework. Three mock policies are available in the EasyMock API, JclMockPolicy, Slf4jMockPolicy and Log4jMockPolicy which helps with mocking java commons-lang, log4j or slf4j in PowerMock. Use the @MockPolicy annotation at the class-level of the test case to use one of the mock policies. * Whitebox.getMethod(..) sets the accessible flag to true if a method is found. * Added Whitebox.getMethod(Class type, Class... parameterTypes) that let's you get a single method without specifying the method name. From 9bfa2fd3c6ec8070478f3b2307a7d9ac1d2444ff Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:09:34 -0400 Subject: [PATCH 51/62] spelling: sense --- .../inline/bugs/github793/MockitoFinalClassMockingTest.java | 4 ++-- .../inline/bugs/github793/PowerMockStaticMockingTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/MockitoFinalClassMockingTest.java b/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/MockitoFinalClassMockingTest.java index 19668abf2..bd8149537 100644 --- a/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/MockitoFinalClassMockingTest.java +++ b/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/MockitoFinalClassMockingTest.java @@ -35,7 +35,7 @@ public class MockitoFinalClassMockingTest { @Test public void should_mock_final_class_with_using_mockito_inline_mock_creator() { - assumeTrue("Test make seances only for Mockito 2", MockitoVersion.isMockito2()); + assumeTrue("Test make sense only for Mockito 2", MockitoVersion.isMockito2()); FinalClass mock = Mockito.mock(FinalClass.class); @@ -51,7 +51,7 @@ public void should_mock_final_class_with_using_mockito_inline_mock_creator() { @Test public void should_mock_final_method_with_using_mockito_inline_mock_creator() { - assumeTrue("Test make seances only for Mockito 2", MockitoVersion.isMockito2()); + assumeTrue("Test make sense only for Mockito 2", MockitoVersion.isMockito2()); final FinalClass mock = Mockito.mock(FinalClass.class); diff --git a/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/PowerMockStaticMockingTest.java b/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/PowerMockStaticMockingTest.java index 00feccca8..9238eacab 100644 --- a/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/PowerMockStaticMockingTest.java +++ b/tests/mockito/inline/src/test/java/samples/powermockito/inline/bugs/github793/PowerMockStaticMockingTest.java @@ -39,7 +39,7 @@ public class PowerMockStaticMockingTest { @Test public void should_mock_static_method_when_mockito_inline_mock_creator_for_mockito_tests() { - assumeTrue("Test make seances only for Mockito 2", MockitoVersion.isMockito2()); + assumeTrue("Test make sense only for Mockito 2", MockitoVersion.isMockito2()); PowerMockito.mockStatic(StaticClass.class); @@ -55,7 +55,7 @@ public void should_mock_static_method_when_mockito_inline_mock_creator_for_mocki @Test public void should_verify_static_method_when_mockito_inline_mock_creator_for_mockito_tests() throws Exception { - assumeTrue("Test make seances only for Mockito 2", MockitoVersion.isMockito2()); + assumeTrue("Test make sense only for Mockito 2", MockitoVersion.isMockito2()); PowerMockito.mockStatic(StaticClass.class); From 805df81a5d4dac3fc1f1dddd2a4ce2a366724fd9 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:10:27 -0400 Subject: [PATCH 52/62] spelling: specifying --- .../java/samples/junit4/suppressfield/SuppressFieldTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java index 5b1d79110..ab6cbecd4 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/suppressfield/SuppressFieldTest.java @@ -63,7 +63,7 @@ public void assertThatSpecificInstanceFieldSuppressionWorks() throws Exception { } @Test - public void assertThatSpecificInstanceFieldSuppressionWhenSpecifingClassAndFieldNameWorks() throws Exception { + public void assertThatSpecificInstanceFieldSuppressionWhenSpecifyingClassAndFieldNameWorks() throws Exception { suppress(field(SuppressField.class, "mySecondValue")); SuppressField suppressField = new SuppressField(); assertNull(suppressField.getMySecondValue()); From 46ca39594b4d3b78a16245aca01a87cabd7e3704 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:10:58 -0400 Subject: [PATCH 53/62] spelling: subsequent --- .../test/java/samples/junit4/expectnew/ExpectNewCases.java | 4 ++-- .../ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java | 4 ++-- .../samples/powermockito/junit4/whennew/WhenNewCases.java | 4 ++-- .../powermockito/junit4/whennew/WhenNewCases.java.orig | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java b/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java index 1a0a34aa5..a5fc72a8c 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/expectnew/ExpectNewCases.java @@ -525,7 +525,7 @@ public void testNewWithArrayVarArgsAndMatchers() throws Exception { } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsAreNotNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubsequentArgumentsAreNotNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = createMock(VarArgsConstructorDemo.class); @@ -544,7 +544,7 @@ public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsA } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubseqentArgumentsAreNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubsequentArgumentsAreNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = createMock(VarArgsConstructorDemo.class); diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java index 26b67e11f..bbd750155 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/prepareeverything/ExpectNewDemoUsingThePrepareEverythingAnnotationTest.java @@ -535,7 +535,7 @@ public void testNewWithArrayVarArgsAndMatchers() throws Exception { } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsAreNotNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubsequentArgumentsAreNotNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = createMock(VarArgsConstructorDemo.class); @@ -554,7 +554,7 @@ public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsA } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubseqentArgumentsAreNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubsequentArgumentsAreNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = createMock(VarArgsConstructorDemo.class); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java index 73148f6ec..c7663aa08 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java @@ -681,7 +681,7 @@ public void testNewWithArrayVarArgsAndMatchers() throws Exception { } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsAreNotNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubsequentArgumentsAreNotNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = mock(VarArgsConstructorDemo.class); @@ -699,7 +699,7 @@ public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsA } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubseqentArgumentsAreNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubsequentArgumentsAreNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = mock(VarArgsConstructorDemo.class); diff --git a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig index 85dd3d7cf..2d99b8637 100644 --- a/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig +++ b/tests/mockito/junit4/src/test/java/samples/powermockito/junit4/whennew/WhenNewCases.java.orig @@ -503,7 +503,7 @@ public class WhenNewCases { } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubseqentArgumentsAreNotNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNullAndSubsequentArgumentsAreNotNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = mock(VarArgsConstructorDemo.class); @@ -521,7 +521,7 @@ public class WhenNewCases { } @Test - public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubseqentArgumentsAreNull() throws Exception { + public void testNewWithArrayVarArgsWhenFirstArgumentIsNotNullButSubsequentArgumentsAreNull() throws Exception { ExpectNewDemo tested = new ExpectNewDemo(); VarArgsConstructorDemo varArgsConstructorDemoMock = mock(VarArgsConstructorDemo.class); From 2694245587bfa3fdc6fdb6d193789cfbd219c725 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:11:37 -0400 Subject: [PATCH 54/62] spelling: substitute --- docs/changelog.txt | 2 +- .../mockpolicies/MockPolicyInterceptionSettings.java | 4 ++-- .../mockpolicies/impl/MockPolicyInterceptionSettingsImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index ab58d6092..bd9427c31 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -429,7 +429,7 @@ Change log 1.3 (released 2009-10-06) * Mockito extension API now supports verification of private methods (for both static and instance methods). Use verifyPrivate(..).invoke(..), e.g. verifyPrivate(myObject, times(2)).invoke("myMethod", argument1, argument2). * Verification behavior of static method in the Mockito extension API has changed. Before you did "verifyStatic(MyClass.class); MyClass.methodToVerify(argument);", now you do "verifyStatic(); MyClass.methodToVerify(argument);". You can also pass a verification mode when verifying static methods: "verifyStatic(times(2)); MyClass.methodToVerify(argument);". This change is NOT backward compatible with version 1.2.5. * Mockito extension API now supports "verifyNoMoreInteractions" and "verifyZeroInteractions" for both instance mocks, class mocks and new instance mocks. -* Deprecated setSubstituteReturnValues, getSubstituteReturnValues and addSubtituteReturnValue in MockPolicyInterceptionSettings, you should now use setMethodsToStub, getStubbedMethods and stubMethod instead. +* Deprecated setSubstituteReturnValues, getSubstituteReturnValues and addSubstituteReturnValue in MockPolicyInterceptionSettings, you should now use setMethodsToStub, getStubbedMethods and stubMethod instead. * Renamed MockRepository#getSubstituteReturnValue to getMethodToStub and MockRepository#putSubstituteReturnValue to putMethodToStub. * PowerMockito now supports, doAnswer, doThrow, doCallRealMethod, doNothing and doReturn for void methods defined in final classes, final void methods and static methods. Note that if a method is a private void method you should still use PowerMockito#when. * Removed the deprecated classes "org.powermock.PowerMock" and "org.powermock.Whitebox". diff --git a/powermock-core/src/main/java/org/powermock/mockpolicies/MockPolicyInterceptionSettings.java b/powermock-core/src/main/java/org/powermock/mockpolicies/MockPolicyInterceptionSettings.java index d5c35222e..64f72df76 100644 --- a/powermock-core/src/main/java/org/powermock/mockpolicies/MockPolicyInterceptionSettings.java +++ b/powermock-core/src/main/java/org/powermock/mockpolicies/MockPolicyInterceptionSettings.java @@ -93,7 +93,7 @@ public interface MockPolicyInterceptionSettings { * @deprecated Use {@link #stubMethod(Method, Object)} instead. */ @Deprecated - void setSubtituteReturnValues(Map substituteReturnValues); + void setSubstituteReturnValues(Map substituteReturnValues); /** * Add a method that should be intercepted and return another value ( @@ -104,7 +104,7 @@ public interface MockPolicyInterceptionSettings { * @deprecated Use {@link #stubMethod(Method, Object)} instead. */ @Deprecated - void addSubtituteReturnValue(Method method, Object returnObject); + void addSubstituteReturnValue(Method method, Object returnObject); /** * Set specific fields that should be suppressed upon invocation. Note that diff --git a/powermock-core/src/main/java/org/powermock/mockpolicies/impl/MockPolicyInterceptionSettingsImpl.java b/powermock-core/src/main/java/org/powermock/mockpolicies/impl/MockPolicyInterceptionSettingsImpl.java index 12d76fd3a..e4c39f5a6 100644 --- a/powermock-core/src/main/java/org/powermock/mockpolicies/impl/MockPolicyInterceptionSettingsImpl.java +++ b/powermock-core/src/main/java/org/powermock/mockpolicies/impl/MockPolicyInterceptionSettingsImpl.java @@ -123,12 +123,12 @@ public String[] getFieldTypesToSuppress() { } @Override - public void addSubtituteReturnValue(Method method, Object returnObject) { + public void addSubstituteReturnValue(Method method, Object returnObject) { substituteReturnValues.put(method, returnObject); } @Override - public void setSubtituteReturnValues(Map substituteReturnValues) { + public void setSubstituteReturnValues(Map substituteReturnValues) { this.substituteReturnValues = substituteReturnValues; } From cd442b4bc9765e5ffb9ad4032bba605a8b5ebff7 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:11:11 -0400 Subject: [PATCH 55/62] spelling: substitution --- .../EasyMockNewInvocationControl.java | 6 +++--- .../NewInvocationControlAssertionError.java | 4 ++-- .../invocation/InvocationControlAssertionError.java | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/EasyMockNewInvocationControl.java b/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/EasyMockNewInvocationControl.java index 3776abb1a..c1b4b79cd 100644 --- a/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/EasyMockNewInvocationControl.java +++ b/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/EasyMockNewInvocationControl.java @@ -28,7 +28,7 @@ public class EasyMockNewInvocationControl implements NewInvocationControl> { private final InvocationSubstitute substitute; - private final Class subsitutionType; + private final Class substitutionType; private boolean hasReplayed; private boolean hasVerified; @@ -36,7 +36,7 @@ public EasyMockNewInvocationControl(InvocationSubstitute substitute, Class if (substitute == null) { throw new IllegalArgumentException("Internal error: substitute cannot be null."); } - this.subsitutionType = type; + this.substitutionType = type; this.substitute = substitute; } @@ -58,7 +58,7 @@ public Object invoke(Class type, Object[] args, Class[] sig) throws Except if (result == null) { if (mockType == MockType.NICE) { - result = EasyMock.createNiceMock(subsitutionType); + result = EasyMock.createNiceMock(substitutionType); } else { throw new IllegalStateException("Must replay class " + type.getName() + " to get configured expectation."); } diff --git a/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/NewInvocationControlAssertionError.java b/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/NewInvocationControlAssertionError.java index 9a1ab5ce7..b1793b9c0 100644 --- a/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/NewInvocationControlAssertionError.java +++ b/powermock-api/powermock-api-easymock/src/main/java/org/powermock/api/easymock/internal/invocationcontrol/NewInvocationControlAssertionError.java @@ -13,9 +13,9 @@ public static void throwAssertionErrorForNewSubstitutionFailure(AssertionError o * instance of MyClass has been created less or more times than 3. */ String message = oldError.getMessage(); - final String newSubsitutionMethodName = InvocationSubstitute.class.getDeclaredMethods()[0].getName(); + final String newSubstitutionMethodName = InvocationSubstitute.class.getDeclaredMethods()[0].getName(); final String className = InvocationSubstitute.class.getSimpleName(); - message = message.replaceAll(className+"."+newSubsitutionMethodName, Matcher.quoteReplacement(type.getName())); + message = message.replaceAll(className+"."+newSubstitutionMethodName, Matcher.quoteReplacement(type.getName())); message = message.replaceAll("method", "constructor"); throw new AssertionError(message); diff --git a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/invocation/InvocationControlAssertionError.java b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/invocation/InvocationControlAssertionError.java index cc87e95dc..62a4e4f2b 100644 --- a/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/invocation/InvocationControlAssertionError.java +++ b/powermock-api/powermock-api-mockito2/src/main/java/org/powermock/api/mockito/internal/invocation/InvocationControlAssertionError.java @@ -83,12 +83,12 @@ public static void throwAssertionErrorForNewSubstitutionFailure(AssertionError o * whenNew(MyClass.class).thenReturn(myMock).times(3) when in fact an * instance of MyClass has been created less or more times than 3. */ - final String newSubsitutionClassName = InvocationSubstitute.class.getSimpleName(); - final String newSubsitutionClassNameInMockito = newSubsitutionClassName.substring(0, 1).toLowerCase() - + newSubsitutionClassName.substring(1); + final String newSubstitutionClassName = InvocationSubstitute.class.getSimpleName(); + final String newSubstitutionClassNameInMockito = newSubstitutionClassName.substring(0, 1).toLowerCase() + + newSubstitutionClassName.substring(1); String message = oldError.getMessage(); - final String newSubsitutionMethodName = InvocationSubstitute.class.getDeclaredMethods()[0].getName(); - message = message.replaceAll(newSubsitutionClassNameInMockito + "." + newSubsitutionMethodName, Matcher + final String newSubstitutionMethodName = InvocationSubstitute.class.getDeclaredMethods()[0].getName(); + message = message.replaceAll(newSubstitutionClassNameInMockito + "." + newSubstitutionMethodName, Matcher .quoteReplacement(type.getName())); message = message.replaceAll("method", "constructor"); throw new AssertionError(changeMessageContent(message)); From a602a45fb4b298077fc87666523cf9e78b59189b Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:11:53 -0400 Subject: [PATCH 56/62] spelling: supplying --- .../powermock/core/classloader/annotations/PrepareForTest.java | 2 +- .../core/classloader/annotations/PrepareOnlyThisForTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareForTest.java b/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareForTest.java index fefc9d55c..9e1b928c1 100644 --- a/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareForTest.java +++ b/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareForTest.java @@ -43,7 +43,7 @@ * {@link #value()} list. *

* Sometimes you need to prepare inner classes for testing, this can be done by - * suppling the fully-qualified name of the inner-class that should be mocked to + * supplying the fully-qualified name of the inner-class that should be mocked to * the {@link #fullyQualifiedNames()} list. *

* You can also prepare whole packages for test by using wildcards: diff --git a/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareOnlyThisForTest.java b/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareOnlyThisForTest.java index 0725ff4ff..bcc0aa223 100644 --- a/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareOnlyThisForTest.java +++ b/powermock-core/src/main/java/org/powermock/core/classloader/annotations/PrepareOnlyThisForTest.java @@ -43,7 +43,7 @@ * {@link #value()} list. *

* Sometimes you need to prepare inner classes for testing, this can be done by - * suppling the fully-qualified name of the inner-class that should be mocked to + * supplying the fully-qualified name of the inner-class that should be mocked to * the {@link #fullyQualifiedNames()} list. * *

From f8d3552dad0885045a1fda8497899305498fbe1d Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:12:06 -0400 Subject: [PATCH 57/62] spelling: suppress --- .../InterfaceStaticInitializerExampleTest.java | 4 ++-- .../staticinitializer/StaticInitializerExampleTest.java | 2 +- .../java/samples/testng/StaticInitializerExampleTest.java | 4 ++-- ...sMethodExampleTest.java => SuppressMethodExampleTest.java} | 4 ++-- .../junit4/rule/objenesis/StaticInitializerExampleTest.java | 2 +- .../junit4/rule/xstream/StaticInitializerExampleTest.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/{SupressMethodExampleTest.java => SuppressMethodExampleTest.java} (98%) diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/InterfaceStaticInitializerExampleTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/InterfaceStaticInitializerExampleTest.java index a167ec029..aff0d0302 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/InterfaceStaticInitializerExampleTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/InterfaceStaticInitializerExampleTest.java @@ -29,12 +29,12 @@ public class InterfaceStaticInitializerExampleTest { @Test - public void testSupressStaticInitializer() throws Exception { + public void testSuppressStaticInitializer() throws Exception { assertEquals(0, InterfaceComputation.calculateWithinHierarchy()); } @Test - public void testSupressStaticInitializer2() throws Exception { + public void testSuppressStaticInitializer2() throws Exception { assertEquals(0, InterfaceComputation.calculateWithReference()); } } diff --git a/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/StaticInitializerExampleTest.java b/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/StaticInitializerExampleTest.java index 68e89acf4..c30549846 100644 --- a/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/StaticInitializerExampleTest.java +++ b/tests/easymock/junit4/src/test/java/samples/junit4/staticinitializer/StaticInitializerExampleTest.java @@ -32,7 +32,7 @@ public class StaticInitializerExampleTest { @Test - public void testSupressStaticInitializerAndSetFinalField() throws Exception { + public void testSuppressStaticInitializerAndSetFinalField() throws Exception { assertNull("Should be null because the static initializer should be suppressed", StaticInitializerExample.getMySet()); final HashSet hashSet = new HashSet(); Whitebox.setInternalState(StaticInitializerExample.class, "mySet", hashSet); diff --git a/tests/easymock/testng/src/test/java/samples/testng/StaticInitializerExampleTest.java b/tests/easymock/testng/src/test/java/samples/testng/StaticInitializerExampleTest.java index f75d8be4f..b6ce1e95b 100644 --- a/tests/easymock/testng/src/test/java/samples/testng/StaticInitializerExampleTest.java +++ b/tests/easymock/testng/src/test/java/samples/testng/StaticInitializerExampleTest.java @@ -29,12 +29,12 @@ public class StaticInitializerExampleTest extends PowerMockTestCase { @Test - public void testSupressStaticInitializer() throws Exception { + public void testSuppressStaticInitializer() throws Exception { assertNull(StaticInitializerExample.getMySet(), "Should be null because the static initializer should be suppressed"); } @Test - public void testSupressStaticInitializerAndSetFinalField() throws Exception { + public void testSuppressStaticInitializerAndSetFinalField() throws Exception { assertNull(StaticInitializerExample.getMySet(), "Should be null because the static initializer should be suppressed"); final HashSet hashSet = new HashSet(); Whitebox.setInternalState(StaticInitializerExample.class, "mySet", hashSet); diff --git a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SupressMethodExampleTest.java b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SuppressMethodExampleTest.java similarity index 98% rename from tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SupressMethodExampleTest.java rename to tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SuppressMethodExampleTest.java index 802771d4b..52cc814f6 100644 --- a/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SupressMethodExampleTest.java +++ b/tests/mockito/junit4-delegate/src/test/java/powermock/modules/test/mockito/junit4/delegate/parameterized/SuppressMethodExampleTest.java @@ -45,7 +45,7 @@ @RunWith(PowerMockRunner.class) @PowerMockRunnerDelegate(Parameterized.class) @PrepareForTest({SuppressMethod.class, SuppressField.class, SuppressEverything.class}) -public class SupressMethodExampleTest { +public class SuppressMethodExampleTest { enum GetObjectSuppression { @@ -115,7 +115,7 @@ void doIt() { @Rule public final ExpectedException expectedException = ExpectedException.none(); - public SupressMethodExampleTest( + public SuppressMethodExampleTest( GetObjectSuppression getObjectSuppression, GetIntSuppression getIntSuppression, FieldSuppression fieldSuppression, diff --git a/tests/mockito/junit4-rule-objenesis/src/test/java/samples/powermockito/junit4/rule/objenesis/StaticInitializerExampleTest.java b/tests/mockito/junit4-rule-objenesis/src/test/java/samples/powermockito/junit4/rule/objenesis/StaticInitializerExampleTest.java index 1412913e0..9ebb0b9d1 100644 --- a/tests/mockito/junit4-rule-objenesis/src/test/java/samples/powermockito/junit4/rule/objenesis/StaticInitializerExampleTest.java +++ b/tests/mockito/junit4-rule-objenesis/src/test/java/samples/powermockito/junit4/rule/objenesis/StaticInitializerExampleTest.java @@ -19,7 +19,7 @@ public class StaticInitializerExampleTest { public PowerMockRule rule = new PowerMockRule(); @Test - public void testSupressStaticInitializerAndSetFinalField() throws Exception { + public void testSuppressStaticInitializerAndSetFinalField() throws Exception { assertNull("Should be null because the static initializer should be suppressed", StaticInitializerExample.getMySet()); final HashSet hashSet = new HashSet(); Whitebox.setInternalState(StaticInitializerExample.class, "mySet", hashSet); diff --git a/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/StaticInitializerExampleTest.java b/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/StaticInitializerExampleTest.java index 979e7a571..5f3d5d9f3 100644 --- a/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/StaticInitializerExampleTest.java +++ b/tests/mockito/junit4-rule-xstream/src/test/java/samples/powermockito/junit4/rule/xstream/StaticInitializerExampleTest.java @@ -19,7 +19,7 @@ public class StaticInitializerExampleTest { public PowerMockRule rule = new PowerMockRule(); @Test - public void testSupressStaticInitializerAndSetFinalField() throws Exception { + public void testSuppressStaticInitializerAndSetFinalField() throws Exception { assertNull("Should be null because the static initializer should be suppressed", StaticInitializerExample.getMySet()); final HashSet hashSet = new HashSet(); Whitebox.setInternalState(StaticInitializerExample.class, "mySet", hashSet); From 5a78b8cbd9b6e505a268c6797c77aea5adb18dfa Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:12:26 -0400 Subject: [PATCH 58/62] spelling: tracker --- .../src/main/java/org/powermock/PowerMockInternalException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-core/src/main/java/org/powermock/PowerMockInternalException.java b/powermock-core/src/main/java/org/powermock/PowerMockInternalException.java index f07823714..a211b5167 100644 --- a/powermock-core/src/main/java/org/powermock/PowerMockInternalException.java +++ b/powermock-core/src/main/java/org/powermock/PowerMockInternalException.java @@ -20,7 +20,7 @@ public class PowerMockInternalException extends RuntimeException{ - private static final String MESSAGE = "PowerMock internal error has happened. This exception is thrown in unexpected cases, that normally should never happen. Please, report about the issue to PowerMock issues tacker. "; + private static final String MESSAGE = "PowerMock internal error has happened. This exception is thrown in unexpected cases, that normally should never happen. Please, report about the issue to PowerMock issues tracker. "; public PowerMockInternalException(final Throwable cause) { super(MESSAGE, cause); From 562890ff36d88401f20f13c2ea74528c7213d439 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:13:18 -0400 Subject: [PATCH 59/62] spelling: unmodifiable --- .../src/main/java/com/sun/tools/attach/spi/AttachProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/spi/AttachProvider.java b/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/spi/AttachProvider.java index b5d956a3d..40c3f3234 100644 --- a/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/spi/AttachProvider.java +++ b/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/spi/AttachProvider.java @@ -207,7 +207,7 @@ public VirtualMachine attachVirtualMachine(VirtualMachineDescriptor vmd) * (using the zero-arg constructor) at the first invocation of this method. * The list returned by the first invocation of this method is the list * of providers. Subsequent invocations of this method return a list of the same - * providers. The list is unmodifable.

+ * providers. The list is unmodifiable.

* * @return A list of the installed attach providers. */ From dcf59ac679f8b5970aeeee8e6b96587620f6ebda Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:13:37 -0400 Subject: [PATCH 60/62] spelling: virtual --- .../java/com/sun/tools/attach/AttachNotSupportedException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/AttachNotSupportedException.java b/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/AttachNotSupportedException.java index acaa23c29..dbf4a0bc7 100644 --- a/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/AttachNotSupportedException.java +++ b/powermock-modules/powermock-module-javaagent/src/main/java/com/sun/tools/attach/AttachNotSupportedException.java @@ -25,7 +25,7 @@ package com.sun.tools.attach; /** - * Thrown by {@link VirtualMachine#attach VirtalMachine.attach} when attempting to attach to a Java + * Thrown by {@link VirtualMachine#attach VirtualMachine.attach} when attempting to attach to a Java * virtual machine for which a compatible {@link com.sun.tools.attach.spi.AttachProvider * AttachProvider} does not exist. It is also thrown by {@link * com.sun.tools.attach.spi.AttachProvider#attachVirtualMachine From 5ee1b8e6b2d441cb03ecb0aef265af6c4886f976 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:14:07 -0400 Subject: [PATCH 61/62] spelling: want --- docs/changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.txt b/docs/changelog.txt index bd9427c31..f247d5f56 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -508,7 +508,7 @@ Change log 1.1 (released 2008-12-12) * Added three new methods to the PowerMock API, reset(Object...mocks), reset(Class...classMocks) and resetAll(). The methods can be used to reset instance mocks, class mocks or let PowerMock reset all mocks automatically. * mockStaticNice(Class clazz, String... methodNames) was renamed to mockStaticPartialNice in the PowerMock API. * PowerMock and PowerMockito now _really_ follows the EasyMock semantics for partial mocking (e.g. PowerMock.createMock(MyClass.class, null) now mocks all methods of a class whereas PowerMock.createMock(MyClass.class, new Method[0]) mocks no methods of a class). -* The @PrepareForTest annotation now accepts interfaces as types. This is useful in situations where you wan't to make sure that a certain interface is loaded by the same classloader as the rest of the mocks. +* The @PrepareForTest annotation now accepts interfaces as types. This is useful in situations where you want to make sure that a certain interface is loaded by the same classloader as the rest of the mocks. * Updated the tutorial projects to reflect the latest changes in PowerMock. * Errors are propagated correctly when invoking the PowerMock.replay(..) method (i.e. they are no longer wrapped in run-time exceptions). * Added a MockNice and MockStrict annotation which can be placed on fields to allow for the AnnotationEnabler of the EasyMock api to create and inject mock objects. From b205c63a3cafb200dc6bdac90e7027fe1230bc0e Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Thu, 13 Jun 2019 04:14:25 -0400 Subject: [PATCH 62/62] spelling: with --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1e3a4ef5..32ea4d140 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ When writing unit tests it is often useful to bypass encapsulation and therefore Please note that PowerMock is mainly intended for people with expert knowledge in unit testing. Putting it in the hands of junior developers may cause more harm than good. ## News -* 2019-04-21: PowerMock 2.0.2 has been release and available in Maven Central. The release includes fix the [issue](https://github.com/powermock/powermock/issues/979) wiht PowerMock JavaAgent with latest JDK and [security issue](https://github.com/powermock/powermock/issues/973) wiht build script. +* 2019-04-21: PowerMock 2.0.2 has been release and available in Maven Central. The release includes fix the [issue](https://github.com/powermock/powermock/issues/979) with PowerMock JavaAgent with latest JDK and [security issue](https://github.com/powermock/powermock/issues/973) with build script. * 2019-01-07: PowerMock 2.0.0 has been released. Main changes: official supporting Mockito 2.x and dropping supporting Mockito 1.x. This release also supports Java 9. Other change read in [release notes](https://github.com/powermock/powermock/releases/tag/powermock-2.0.0). * 2017-08-12: PowerMock 1.7.1 has been released with one, but significant change: the old API for verifying static mock has been deprecated and a new one has been added. Old API will be removed in version PowerMock 2.0 due to incompatibility with Mockito Public API. * 2017-06-16: PowerMock 1.7.0 has been released with support for Mockito 2 (not only beta versions) and new features such as global `@PowerMockIgnore` as well as bug fixes and other improvements. See [release notes](https://github.com/powermock/powermock/releases/tag/powermock-1.7.0) and [change log](https://raw.githubusercontent.com/powermock/powermock/master/docs/changelog.txt) for details.