├── easymock-android-tck ├── res │ └── .gitkeep ├── .gitignore ├── project.properties └── AndroidManifest.xml ├── website ├── api │ ├── easymock │ │ ├── 2.5.1 │ │ │ ├── packages │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ └── inherit.gif │ │ │ ├── options │ │ │ ├── index.html │ │ │ └── stylesheet.css │ │ ├── 2.5.2 │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ └── inherit.gif │ │ │ ├── index.html │ │ │ └── stylesheet.css │ │ ├── 2.5 │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ └── inherit.gif │ │ │ ├── index.html │ │ │ └── stylesheet.css │ │ ├── 3.0 │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ └── inherit.gif │ │ │ ├── index.html │ │ │ └── stylesheet.css │ │ ├── 3.1 │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ └── inherit.gif │ │ │ ├── stylesheet.css │ │ │ ├── overview-frame.html │ │ │ └── index.html │ │ ├── 3.2 │ │ │ ├── package-list │ │ │ ├── resources │ │ │ │ ├── tab.gif │ │ │ │ ├── background.gif │ │ │ │ ├── titlebar.gif │ │ │ │ └── titlebar_end.gif │ │ │ └── overview-frame.html │ │ └── 2.4 │ │ │ ├── help-doc.html │ │ │ ├── index-all.html │ │ │ ├── overview-tree.html │ │ │ ├── constant-values.html │ │ │ ├── deprecated-list.html │ │ │ ├── resources │ │ │ └── inherit.gif │ │ │ ├── serialized-form.html │ │ │ ├── org │ │ │ └── easymock │ │ │ │ ├── Capture.html │ │ │ │ ├── EasyMock.html │ │ │ │ ├── IAnswer.html │ │ │ │ ├── MockControl.html │ │ │ │ ├── IMocksControl.html │ │ │ │ ├── package-tree.html │ │ │ │ ├── AbstractMatcher.html │ │ │ │ ├── ArgumentsMatcher.html │ │ │ │ ├── IArgumentMatcher.html │ │ │ │ ├── LogicalOperator.html │ │ │ │ ├── package-summary.html │ │ │ │ └── IExpectationSetters.html │ │ │ ├── index.html │ │ │ ├── stylesheet.css │ │ │ └── allclasses-noframe.html │ └── easymockclassextension │ │ ├── 2.5.1 │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── META-INF │ │ │ ├── MANIFEST.MF │ │ │ └── NOTICE │ │ ├── stylesheet.css │ │ ├── allclasses-noframe.html │ │ ├── index.html │ │ ├── allclasses-frame.html │ │ └── org │ │ │ └── easymock │ │ │ └── classextension │ │ │ └── package-frame.html │ │ ├── 2.5.2 │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── stylesheet.css │ │ ├── index.html │ │ ├── allclasses-noframe.html │ │ └── allclasses-frame.html │ │ ├── 2.5 │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── stylesheet.css │ │ ├── allclasses-noframe.html │ │ ├── index.html │ │ ├── allclasses-frame.html │ │ └── org │ │ │ └── easymock │ │ │ └── classextension │ │ │ └── package-frame.html │ │ ├── 3.0 │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── stylesheet.css │ │ ├── allclasses-noframe.html │ │ ├── index.html │ │ ├── allclasses-frame.html │ │ └── org │ │ │ └── easymock │ │ │ └── classextension │ │ │ └── package-frame.html │ │ ├── 3.1 │ │ ├── package-list │ │ ├── resources │ │ │ └── inherit.gif │ │ ├── org │ │ │ └── easymock │ │ │ │ └── classextension │ │ │ │ ├── internal │ │ │ │ └── package-frame.html │ │ │ │ └── package-frame.html │ │ ├── overview-frame.html │ │ ├── stylesheet.css │ │ ├── index.html │ │ └── allclasses-noframe.html │ │ ├── 3.2 │ │ ├── package-list │ │ ├── resources │ │ │ ├── tab.gif │ │ │ ├── titlebar.gif │ │ │ ├── background.gif │ │ │ └── titlebar_end.gif │ │ ├── overview-frame.html │ │ ├── org │ │ │ └── easymock │ │ │ │ └── classextension │ │ │ │ ├── internal │ │ │ │ └── package-frame.html │ │ │ │ └── package-frame.html │ │ ├── allclasses-noframe.html │ │ └── allclasses-frame.html │ │ └── 2.4 │ │ ├── allclasses-noframe.html │ │ ├── allclasses-frame.html │ │ ├── index.html │ │ ├── stylesheet.css │ │ └── org │ │ └── easymock │ │ └── classextension │ │ └── package-frame.html ├── robots.txt ├── googlefda9c590a38fa17b.html ├── favicon.ico ├── easymock.gif ├── easymock0.8.zip ├── easymock073.zip ├── img │ └── easymock.gif ├── EasyMock2_3_ClassExtension_Documentation_fr.html ├── EasyMock2_4_ClassExtension_Documentation_fr.html ├── EasyMock2_5_ClassExtension_Documentation_fr.html ├── EasyMock3_0_ClassExtension_Documentation_fr.html ├── EasyMock3_1_ClassExtension_Documentation_fr.html ├── EasyMock3_2_ClassExtension_Documentation_fr.html ├── EasyMock2_5_1_ClassExtension_Documentation_fr.html ├── EasyMock2_5_2_ClassExtension_Documentation_fr.html ├── Error.html └── ReleaseNotes.html ├── easymock-classextension ├── src │ ├── site │ │ └── Documentation_fr.html │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── assembly-samples.xml │ │ │ └── assembly-tests.xml │ │ └── java │ │ │ └── org │ │ │ └── easymock │ │ │ └── classextension │ │ │ ├── IMockBuilder.java │ │ │ ├── IMocksControl.java │ │ │ ├── internal │ │ │ ├── MockBuilder.java │ │ │ └── MocksClassControl.java │ │ │ └── ConstructorArgs.java │ └── test │ │ └── java │ │ └── org │ │ └── easymock │ │ └── classextension │ │ ├── tests │ │ └── MockingTest.java.rej │ │ └── tests2 │ │ ├── NopInvocationHandler.java │ │ └── ClassProxyFactoryTest.java ├── ReleaseNotes.txt └── findbugs-exclude.xml ├── README.md ├── .gitignore ├── easymock-integration └── src │ └── test │ ├── resources │ └── log4j.properties │ └── java │ └── org │ └── itests │ └── StaticService.java ├── refresh-website.sh ├── header.txt ├── easymock ├── findbugs-exclude.xml ├── src │ ├── main │ │ ├── assembly │ │ │ ├── assembly.xml │ │ │ ├── assembly-samples.xml │ │ │ └── assembly-tests.xml │ │ └── java │ │ │ └── org │ │ │ └── easymock │ │ │ ├── internal │ │ │ ├── ObjenesisClassInstantiator.java │ │ │ ├── ThrowableWrapper.java │ │ │ ├── AssertionErrorWrapper.java │ │ │ ├── RuntimeExceptionWrapper.java │ │ │ ├── matchers │ │ │ │ ├── Any.java │ │ │ │ ├── LessThan.java │ │ │ │ ├── Null.java │ │ │ │ ├── GreaterThan.java │ │ │ │ ├── CompareEqual.java │ │ │ │ ├── LessOrEqual.java │ │ │ │ ├── GreaterOrEqual.java │ │ │ │ ├── NotNull.java │ │ │ │ ├── EndsWith.java │ │ │ │ ├── InstanceOf.java │ │ │ │ ├── Not.java │ │ │ │ ├── StartsWith.java │ │ │ │ ├── Matches.java │ │ │ │ ├── Contains.java │ │ │ │ ├── Find.java │ │ │ │ ├── Same.java │ │ │ │ ├── EqualsWithDelta.java │ │ │ │ ├── CompareTo.java │ │ │ │ ├── And.java │ │ │ │ └── Or.java │ │ │ ├── IMocksBehavior.java │ │ │ ├── IClassInstantiator.java │ │ │ ├── JavaProxyFactory.java │ │ │ ├── ExpectedInvocationAndResult.java │ │ │ ├── AndroidSupport.java │ │ │ ├── EasyMockStatement.java │ │ │ ├── ExpectedInvocationAndResults.java │ │ │ ├── IMocksControlState.java │ │ │ └── IProxyFactory.java │ │ │ ├── MockType.java │ │ │ ├── TestSubject.java │ │ │ ├── CaptureType.java │ │ │ ├── EasyMockRule.java │ │ │ ├── IAnswer.java │ │ │ └── EasyMockRunner.java │ ├── test │ │ └── java │ │ │ └── org │ │ │ └── easymock │ │ │ ├── tests2 │ │ │ ├── ParentEquals.java │ │ │ ├── ChildEquals.java │ │ │ ├── EasyMockRunnerTest.java │ │ │ ├── EasyMockRuleTest.java │ │ │ ├── UsageMatchersTest.java │ │ │ └── NiceMockTest.java │ │ │ └── tests │ │ │ ├── BaseEasyMockRunnerTest.java │ │ │ ├── MockNameTest.java │ │ │ ├── Util.java │ │ │ ├── IVarArgs.java │ │ │ ├── RecordStateInvalidDefaultReturnValueTest.java │ │ │ ├── MethodSerializationWrapperTest.java │ │ │ ├── ExpectedMethodCallTest.java │ │ │ └── NiceMockControlTest.java │ └── samples │ │ └── java │ │ └── org │ │ └── easymock │ │ └── samples │ │ ├── Collaborator.java │ │ ├── AnnotatedMockWithRuleTest.java │ │ ├── AnnotatedMockWithRunnerTest.java │ │ └── ThrowableEquals.java └── ReleaseNotes.txt └── easymock-test-deploy └── src └── test └── java └── org └── easymock └── test ├── EasyMockTest.java └── EasyMockClassExtensionTest.java /easymock-android-tck/res/.gitkeep: -------------------------------------------------------------------------------- 1 | empty 2 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/packages: -------------------------------------------------------------------------------- 1 | org.easymock -------------------------------------------------------------------------------- /website/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.2/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | -------------------------------------------------------------------------------- /website/api/easymock/2.5/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | -------------------------------------------------------------------------------- /website/api/easymock/3.0/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | -------------------------------------------------------------------------------- /website/googlefda9c590a38fa17b.html: -------------------------------------------------------------------------------- 1 | google-site-verification: googlefda9c590a38fa17b.html -------------------------------------------------------------------------------- /website/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/favicon.ico -------------------------------------------------------------------------------- /website/easymock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/easymock.gif -------------------------------------------------------------------------------- /website/easymock0.8.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/easymock0.8.zip -------------------------------------------------------------------------------- /website/easymock073.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/easymock073.zip -------------------------------------------------------------------------------- /website/img/easymock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/img/easymock.gif -------------------------------------------------------------------------------- /website/api/easymock/3.1/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | org.easymock.internal 3 | org.easymock.internal.matchers 4 | -------------------------------------------------------------------------------- /website/api/easymock/3.2/package-list: -------------------------------------------------------------------------------- 1 | org.easymock 2 | org.easymock.internal 3 | org.easymock.internal.matchers 4 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | org.easymock.classextension.internal 3 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/package-list: -------------------------------------------------------------------------------- 1 | org.easymock.classextension 2 | org.easymock.classextension.internal 3 | -------------------------------------------------------------------------------- /website/api/easymock/2.4/help-doc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/help-doc.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/index-all.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/index-all.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/overview-tree.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/overview-tree.html -------------------------------------------------------------------------------- /website/api/easymock/3.2/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.2/resources/tab.gif -------------------------------------------------------------------------------- /website/api/easymock/2.4/constant-values.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/constant-values.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/deprecated-list.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/deprecated-list.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/2.4/serialized-form.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/serialized-form.html -------------------------------------------------------------------------------- /website/api/easymock/2.5/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.5/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/3.0/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.0/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/3.1/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.1/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.5.1/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/2.5.2/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.5.2/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymock/3.2/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.2/resources/background.gif -------------------------------------------------------------------------------- /website/api/easymock/3.2/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.2/resources/titlebar.gif -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/Capture.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/Capture.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/EasyMock.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/EasyMock.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/IAnswer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/IAnswer.html -------------------------------------------------------------------------------- /website/api/easymock/3.2/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/3.2/resources/titlebar_end.gif -------------------------------------------------------------------------------- /easymock-classextension/src/site/Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/easymock-classextension/src/site/Documentation_fr.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/MockControl.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/MockControl.html -------------------------------------------------------------------------------- /website/EasyMock2_3_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock2_3_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock2_4_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock2_4_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock2_5_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock2_5_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock3_0_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock3_0_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock3_1_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock3_1_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock3_2_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock3_2_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/IMocksControl.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/IMocksControl.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/package-tree.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/package-tree.html -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/resources/tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.2/resources/tab.gif -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project Status: 🚨 Archived Fork 🚨 2 | 3 | This project was forked for development. The fork is no longer needed/used, so this project is now archived. 4 | 5 | -------------------------------------------------------------------------------- /website/EasyMock2_5_1_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock2_5_1_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/EasyMock2_5_2_ClassExtension_Documentation_fr.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/EasyMock2_5_2_ClassExtension_Documentation_fr.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/AbstractMatcher.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/AbstractMatcher.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/ArgumentsMatcher.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/ArgumentsMatcher.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/IArgumentMatcher.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/IArgumentMatcher.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/LogicalOperator.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/LogicalOperator.html -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/package-summary.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/package-summary.html -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/2.5/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.0/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.1/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/resources/titlebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.2/resources/titlebar.gif -------------------------------------------------------------------------------- /website/api/easymock/2.4/org/easymock/IExpectationSetters.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymock/2.4/org/easymock/IExpectationSetters.html -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/2.5.1/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/resources/inherit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/2.5.2/resources/inherit.gif -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/resources/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.2/resources/background.gif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | clover.license 3 | .project 4 | .classpath 5 | .settings 6 | target 7 | /easymock-integration/eclipse_config 8 | *.patch 9 | .idea/ 10 | *.iml 11 | sys$command 12 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/resources/titlebar_end.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebookarchive/easymock/HEAD/website/api/easymockclassextension/3.2/resources/titlebar_end.gif -------------------------------------------------------------------------------- /easymock-android-tck/.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | gen/ 3 | target/ 4 | .classpath 5 | .project 6 | org.eclipse.m2e.core.prefs 7 | org.eclipse.core.resources.prefs 8 | org.eclipse.pde.core.prefs 9 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Archiver-Version: Plexus Archiver 3 | Created-By: Apache Maven 4 | Built-By: Henri 5 | Build-Jdk: 1.6.0_17 6 | 7 | -------------------------------------------------------------------------------- /easymock-classextension/ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Release Notes - EasyMock Class extension- Version 3.2 2 | 3 | EasyMock Class extension is now deprecated. You should now use standard EasyMock for your class mocking. 4 | This version is only provided to make the migration easier. 5 | 6 | See EasyMock bundle for the complete release notes. 7 | -------------------------------------------------------------------------------- /easymock-integration/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 2 | log4j.appender.stdout.layout.ConversionPattern=%p [%c] - %m%n 3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 4 | 5 | log4j.rootCategory=WARN, stdout 6 | 7 | # Uncomment to add logs 8 | #log4j.logger.org.easymock.itests.OsgiTest=TRACE, stdout 9 | -------------------------------------------------------------------------------- /refresh-website.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Has to be executed on shell.sourceforge.net with appropriate rights! 4 | # To create a shell replace USERNAME with your username in the following snippet: 5 | # ssh -t USERNAME,easymock@shell.sourceforge.net create 6 | 7 | cd /home/project-web/easymock \ 8 | && rm -rf htdocs-bak \ 9 | && git clone https://github.com/easymock/easymock.git htdocs2 \ 10 | && chmod -R g+w htdocs2/website \ 11 | && mv htdocs htdocs-bak \ 12 | && mv htdocs2/website htdocs \ 13 | && rm -rf htdocs2 14 | 15 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | bundle 3 | 4 | zip 5 | 6 | 7 | 8 | 9 | ${project.basedir}/src/site 10 | true 11 | 12 | 13 | 14 | ${project.build.directory} 15 | 16 | *.jar 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /easymock-classextension/src/test/java/org/easymock/classextension/tests/MockingTest.java.rej: -------------------------------------------------------------------------------- 1 | @@ -54,8 +53,8 @@ 2 | ClassToMock transition2 = createMock(ClassToMock.class); 3 | 4 | // Should have two different callbacks 5 | - assertNotSame(ClassExtensionHelper.getInterceptor(transition2), 6 | - ClassExtensionHelper.getInterceptor(transition1)); 7 | + assertNotSame(MocksControl.getInvocationHandler(transition2), 8 | + MocksControl.getInvocationHandler(transition1)); 9 | 10 | transition2.foo(); 11 | transition1.foo(); 12 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/options: -------------------------------------------------------------------------------- 1 | -classpath 2 | 'D:/Programmation/easymock/easymock/target/classes' 3 | -encoding 4 | 'Cp1252' 5 | -protected 6 | -sourcepath 7 | 'D:/Programmation/easymock/easymock/src/main/java' 8 | -author 9 | -bottom 10 | 'Copyright © 2001-2009 OFFIS, Tammo Freese, Henri Tremblay. This documentation is provided under the terms of the Apache 2 licence.' 11 | -charset 12 | 'UTF-8' 13 | -d 14 | 'D:/Programmation/easymock/easymock/target/apidocs' 15 | -docencoding 16 | 'UTF-8' 17 | -doctitle 18 | 'EasyMock 2.5.1 API' 19 | -use 20 | -version 21 | -windowtitle 22 | 'EasyMock 2.5.1 API' -------------------------------------------------------------------------------- /header.txt: -------------------------------------------------------------------------------- 1 | Copyright ${inceptionYear}-${year} the original author or authors. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /easymock-android-tck/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-17 15 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/assembly/assembly-samples.xml: -------------------------------------------------------------------------------- 1 | 2 | samples 3 | 4 | jar 5 | 6 | false 7 | 8 | 9 | 10 | ${project.build.testOutputDirectory} 11 | 12 | org/easymock/classextension/samples/** 13 | 14 | 15 | 16 | 17 | ${basedir}/src/samples/java 18 | 19 | 20 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/assembly/assembly-tests.xml: -------------------------------------------------------------------------------- 1 | 2 | tests 3 | 4 | jar 5 | 6 | false 7 | 8 | 9 | 10 | ${project.build.testOutputDirectory} 11 | 12 | org/easymock/classextension/samples/** 13 | 14 | 15 | 16 | 17 | ${project.build.testSourceDirectory} 18 | 19 | 20 | -------------------------------------------------------------------------------- /easymock/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /easymock/src/main/assembly/assembly.xml: -------------------------------------------------------------------------------- 1 | 2 | bundle 3 | 4 | zip 5 | 6 | 7 | 8 | 9 | ${project.basedir}/src/site 10 | true 11 | 12 | 13 | 14 | ${project.basedir} 15 | 16 | LICENSE.txt 17 | 18 | 19 | 20 | 21 | ${project.build.directory} 22 | 23 | *.jar 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /easymock/src/main/assembly/assembly-samples.xml: -------------------------------------------------------------------------------- 1 | 2 | samples 3 | 4 | jar 5 | 6 | false 7 | 8 | 9 | 10 | ${project.build.testOutputDirectory} 11 | 12 | org/easymock/samples/** 13 | 14 | 15 | 16 | 17 | ${basedir}/src/samples/java 18 | 19 | 20 | META-INF 21 | ${project.basedir} 22 | 23 | LICENSE.txt 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /easymock/src/main/assembly/assembly-tests.xml: -------------------------------------------------------------------------------- 1 | 2 | tests 3 | 4 | jar 5 | 6 | false 7 | 8 | 9 | 10 | ${project.build.testOutputDirectory} 11 | 12 | org/easymock/samples/** 13 | 14 | 15 | 16 | 17 | ${project.build.testSourceDirectory} 18 | 19 | 20 | META-INF 21 | ${project.basedir} 22 | 23 | LICENSE.txt 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/META-INF/NOTICE: -------------------------------------------------------------------------------- 1 | // ------------------------------------------------------------------ 2 | // NOTICE file corresponding to the section 4d of The Apache License, 3 | // Version 2.0, in this case for EasyMock class extension 4 | // ------------------------------------------------------------------ 5 | 6 | EasyMock class extension 7 | Copyright 2003-2009 OFFIS, Henri Tremblay 8 | 9 | This product includes/uses software(s) developed by 'an unknown organization' 10 | - Code Generation Library (http://cglib.sourceforge.net/) 11 | 12 | This product includes/uses software(s) developed by 'Joe Walnes, Henri Tremblay, Leonardo Mesquita' 13 | - Objenesis (http://objenesis.googlecode.com/svn/docs/index.html) 14 | 15 | This product includes/uses software(s) developed by 'OFFIS, Tammo Freese, Henri Tremblay' 16 | - EasyMock (http://www.easymock.org) 17 | 18 | 19 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/ParentEquals.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | /** 19 | * @author Henri Tremblay 20 | */ 21 | class ParentEquals { 22 | public boolean equals(Object o) { 23 | return super.equals(o); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/ChildEquals.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | /** 19 | * @author Henri Tremblay 20 | */ 21 | public class ChildEquals extends ParentEquals { 22 | public String getString() { 23 | return "x"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /easymock-integration/src/test/java/org/itests/StaticService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2009-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.itests; 17 | 18 | /** 19 | * @author Henri Tremblay 20 | */ 21 | public class StaticService { 22 | 23 | public static String say(final String string) { 24 | return "Hello " + string; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/BaseEasyMockRunnerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import org.easymock.EasyMockSupport; 19 | 20 | /** 21 | * @author Henri Tremblay 22 | */ 23 | public abstract class BaseEasyMockRunnerTest extends EasyMockSupport{ 24 | 25 | protected IMethods superMock; 26 | } 27 | -------------------------------------------------------------------------------- /easymock-classextension/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /easymock/src/samples/java/org/easymock/samples/Collaborator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.samples; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public interface Collaborator { 22 | void documentAdded(String title); 23 | 24 | void documentChanged(String title); 25 | 26 | void documentRemoved(String title); 27 | 28 | byte voteForRemoval(String title); 29 | 30 | byte voteForRemovals(String... titles); 31 | } 32 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/EasyMockRunnerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | import org.easymock.EasyMockRunner; 19 | import org.junit.runner.RunWith; 20 | 21 | /** 22 | * Runs annotation-driven tests from base class with the EasyMockRunner JUnit Runner. 23 | * 24 | * @author Henri Tremblay 25 | */ 26 | @RunWith(EasyMockRunner.class) 27 | public class EasyMockRunnerTest extends EasyMockAnnotationsTest { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List (EasyMock Class extension 3.2 API) 8 | 9 | 10 | 11 | 12 |
All Classes
13 |
14 |

Packages

15 | 19 |
20 |

 

21 | 22 | 23 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/EasyMockRuleTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | import org.easymock.EasyMockRule; 19 | import org.junit.Rule; 20 | 21 | /** 22 | * Runs annotation-driven tests from base class with the EasyMockRule JUnit Rule. 23 | * 24 | * @author Alistair Todd 25 | */ 26 | public class EasyMockRuleTest extends EasyMockAnnotationsTest { 27 | 28 | @Rule 29 | public EasyMockRule mocks = new EasyMockRule(this); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/ObjenesisClassInstantiator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import org.objenesis.ObjenesisHelper; 19 | 20 | /** 21 | * @author Henri Tremblay 22 | */ 23 | public class ObjenesisClassInstantiator implements IClassInstantiator { 24 | 25 | public Object newInstance(final Class clazz) throws InstantiationException { 26 | return ObjenesisHelper.newInstance(clazz); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /website/api/easymock/3.2/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List (EasyMock 3.2 API) 8 | 9 | 10 | 11 | 12 |
All Classes
13 |
14 |

Packages

15 | 20 |
21 |

 

22 | 23 | 24 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/ThrowableWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public class ThrowableWrapper extends Throwable { 22 | 23 | private static final long serialVersionUID = -4434322855124959723L; 24 | 25 | private final Throwable throwable; 26 | 27 | public ThrowableWrapper(final Throwable throwable) { 28 | this.throwable = throwable; 29 | } 30 | 31 | public Throwable getThrowable() { 32 | return throwable; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/UsageMatchersTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | import static org.easymock.EasyMock.*; 19 | 20 | import org.easymock.tests.IMethods; 21 | import org.junit.Test; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public class UsageMatchersTest { 27 | @Test(expected = IllegalStateException.class) 28 | public void additionalMatchersFailAtReplay() { 29 | 30 | final IMethods mock = createMock(IMethods.class); 31 | lt(5); 32 | 33 | replay(mock); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/AssertionErrorWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public class AssertionErrorWrapper extends RuntimeException { 22 | 23 | private static final long serialVersionUID = -2087349195182278608L; 24 | 25 | private final AssertionError error; 26 | 27 | public AssertionErrorWrapper(final AssertionError error) { 28 | this.error = error; 29 | } 30 | 31 | public AssertionError getAssertionError() { 32 | return error; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/org/easymock/classextension/internal/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.easymock.classextension.internal (EasyMock Class extension 3.2 API) 8 | 9 | 10 | 11 | 12 |

org.easymock.classextension.internal

13 |
14 |

Classes

15 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/MockType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | /** 19 | * Enum describing the 3 possibles kind of mocks 20 | * 21 | * @author Henri Tremblay 22 | * @since 3.2 23 | */ 24 | public enum MockType { 25 | /** A nice mock expects recorded calls in any order and returning null for other calls */ 26 | NICE, 27 | /** A default mock expects only recorded calls but in any order */ 28 | DEFAULT, 29 | /** A strict mock expects only recorded calls and they should be replayed in their recorded order */ 30 | STRICT 31 | } 32 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/MockNameTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import static org.easymock.EasyMock.*; 19 | import static org.junit.Assert.*; 20 | 21 | import org.junit.Test; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public class MockNameTest { 27 | 28 | @Test 29 | public void defaultName() { 30 | final IMethods mock = createMock(IMethods.class); 31 | final String expected = "EasyMock for " + IMethods.class.toString(); 32 | final String actual = mock.toString(); 33 | assertEquals(expected, actual); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/java/org/easymock/classextension/IMockBuilder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension; 17 | 18 | /** 19 | * This class is provided solely to allow an easier transition to EasyMock 3.0. 20 | * You should now use {@link org.easymock.IMockBuilder} instead. 21 | * 22 | * @param 23 | * type of the object being created 24 | * 25 | * @author Henri Tremblay 26 | * 27 | * @deprecated Use {@link org.easymock.IMockBuilder} instead 28 | */ 29 | @Deprecated 30 | public interface IMockBuilder extends org.easymock.IMockBuilder { 31 | } 32 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/java/org/easymock/classextension/IMocksControl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension; 17 | 18 | /** 19 | * This class is provided solely to allow an easier transition to EasyMock 3.0. 20 | * You should now use {@link org.easymock.IMocksControl} for classes and 21 | * interfaces mocking. 22 | * 23 | * @author Henri Tremblay 24 | * 25 | * @deprecated You can now mock classes directly with 26 | * {@link org.easymock.IMocksControl} 27 | */ 28 | @Deprecated 29 | public interface IMocksControl extends org.easymock.IMocksControl { 30 | } 31 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/java/org/easymock/classextension/internal/MockBuilder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension.internal; 17 | 18 | import org.easymock.classextension.IMockBuilder; 19 | 20 | /** 21 | * 22 | * @author Henri Tremblay 23 | * 24 | * @param type of the mock created 25 | */ 26 | @SuppressWarnings("deprecation") 27 | @Deprecated 28 | public class MockBuilder extends org.easymock.internal.MockBuilder 29 | implements IMockBuilder { 30 | 31 | public MockBuilder(Class toMock) { 32 | super(toMock); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/TestSubject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | import java.lang.annotation.*; 19 | 20 | /** 21 | * Annotation to set on a field so that {@link EasyMockRunner}, {@link EasyMockRule} or {@link EasyMockSupport#injectMocks(Object)} 22 | * will inject mocks created with {@link Mock} on its fields. 23 | *

24 | * See {@link EasyMockSupport#injectMocks(Object)} for the injection rules. 25 | * 26 | * @author Henri Tremblay 27 | * @since 3.2 28 | */ 29 | @Target(ElementType.FIELD) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Documented 32 | public @interface TestSubject { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/java/org/easymock/classextension/internal/MocksClassControl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension.internal; 17 | 18 | import org.easymock.classextension.IMocksControl; 19 | import org.easymock.internal.MocksControl; 20 | 21 | /** 22 | * @author Henri Tremblay 23 | * 24 | */ 25 | @Deprecated 26 | public class MocksClassControl extends MocksControl implements IMocksControl { 27 | 28 | private static final long serialVersionUID = 3968868667140288891L; 29 | 30 | public MocksClassControl(final MockType type) { 31 | super(type); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/RuntimeExceptionWrapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public class RuntimeExceptionWrapper extends RuntimeException { 22 | 23 | private static final long serialVersionUID = -3483500330975410177L; 24 | 25 | private final RuntimeException runtimeException; 26 | 27 | public RuntimeExceptionWrapper(final RuntimeException runtimeException) { 28 | this.runtimeException = runtimeException; 29 | } 30 | 31 | public RuntimeException getRuntimeException() { 32 | return runtimeException; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /easymock/ReleaseNotes.txt: -------------------------------------------------------------------------------- 1 | Release Notes - EasyMock - Version 3.2 2 | 3 | This release contains two important features: 4 | * A support for Android. EasyMock now works on Dalvik 5 | * New @Mock and @TestSubject annotations 6 | 7 | And the complete release notes: 8 | 9 | ** Bug 10 | * [EASYMOCK-101] - EasyMock not compiling with JDK 7 or Eclipse Helios or later (phase 2) 11 | * [EASYMOCK-106] - EasyMockProperties use of System properties isn't thread safe 12 | * [EASYMOCK-110] - bridged equals(Object) method causes StackOverflow 13 | * [EASYMOCK-117] - Exception mocks have a different behavior between Java 6 and 7 14 | * [EASYMOCK-121] - Upgrade to Objenesis 1.3 15 | * [EASYMOCK-124] - Website text gets badly truncate on certain screens 16 | 17 | ** Improvement 18 | * [EASYMOCK-107] - Remove the possibility to override easymock.properties with system properties 19 | * [EASYMOCK-108] - Android support 20 | * [EASYMOCK-115] - Improvement to org.easymock.Capture.java 21 | 22 | ** New Feature 23 | * [EASYMOCK-24] - Provide mockType to createMock() method 24 | * [EASYMOCK-51] - @Mock annotation to provide mock autowiring 25 | * [EASYMOCK-112] - anyString() in EasyMock desired 26 | 27 | 28 | ** Task 29 | * [EASYMOCK-122] - Move source code to GitHub 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.4/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (EasyMockClassExtension) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 33 | 34 |
ConstructorArgs 25 |
26 | EasyMock 27 |
28 | IMocksControl 29 |
30 | MockClassControl 31 |
32 |
35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/CaptureType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | /** 19 | * Defines how arguments will be captured by a Capture object 20 | * 21 | * @author Henri Tremblay 22 | * @see Capture 23 | */ 24 | public enum CaptureType { 25 | /** 26 | * Do not capture anything 27 | */ 28 | NONE, 29 | 30 | /** 31 | * Will capture the argument of the first matching call 32 | */ 33 | FIRST, 34 | 35 | /** 36 | * Will capture the argument of the last matching call 37 | */ 38 | LAST, 39 | 40 | /** 41 | * Will capture, in order, the arguments of each matching calls 42 | */ 43 | ALL 44 | } 45 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Any.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public final class Any implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -3743894206806704049L; 28 | 29 | public static final Any ANY = new Any(); 30 | 31 | private Any() { 32 | 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return true; 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append(""); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/LessThan.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | /** 19 | * @param 20 | * Type of the values compared 21 | * 22 | * @author OFFIS, Tammo Freese 23 | */ 24 | public class LessThan> extends CompareTo { 25 | 26 | private static final long serialVersionUID = 6004888476822043880L; 27 | 28 | public LessThan(final Comparable value) { 29 | super(value); 30 | } 31 | 32 | @Override 33 | protected String getName() { 34 | return "lt"; 35 | } 36 | 37 | @Override 38 | protected boolean matchResult(final int result) { 39 | return result < 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Null.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class Null implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = 6077244839421122011L; 28 | 29 | public static final Null NULL = new Null(); 30 | 31 | private Null() { 32 | } 33 | 34 | public boolean matches(final Object actual) { 35 | return actual == null; 36 | } 37 | 38 | public void appendTo(final StringBuffer buffer) { 39 | buffer.append("isNull()"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/GreaterThan.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | /** 19 | * @param 20 | * Type of the values compared 21 | * 22 | * @author OFFIS, Tammo Freese 23 | */ 24 | public class GreaterThan> extends CompareTo { 25 | 26 | private static final long serialVersionUID = 2736983121197045828L; 27 | 28 | public GreaterThan(final Comparable value) { 29 | super(value); 30 | } 31 | 32 | @Override 33 | protected String getName() { 34 | return "gt"; 35 | } 36 | 37 | @Override 38 | protected boolean matchResult(final int result) { 39 | return result > 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/CompareEqual.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | /** 19 | * @param 20 | * Type of the values compared 21 | * 22 | * @author Henri Tremblay 23 | */ 24 | public class CompareEqual> extends CompareTo { 25 | 26 | private static final long serialVersionUID = 7616033998227799268L; 27 | 28 | public CompareEqual(final Comparable value) { 29 | super(value); 30 | } 31 | 32 | @Override 33 | protected String getName() { 34 | return "cmpEq"; 35 | } 36 | 37 | @Override 38 | protected boolean matchResult(final int result) { 39 | return result == 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/LessOrEqual.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | /** 19 | * @param 20 | * Type of the values compared 21 | * 22 | * @author OFFIS, Tammo Freese 23 | */ 24 | public class LessOrEqual> extends CompareTo { 25 | 26 | private static final long serialVersionUID = -2485406702001842607L; 27 | 28 | public LessOrEqual(final Comparable value) { 29 | super(value); 30 | } 31 | 32 | @Override 33 | protected String getName() { 34 | return "leq"; 35 | } 36 | 37 | @Override 38 | protected boolean matchResult(final int result) { 39 | return result <= 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/GreaterOrEqual.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | /** 19 | * @param 20 | * Type of the values compared 21 | * 22 | * @author OFFIS, Tammo Freese 23 | */ 24 | public class GreaterOrEqual> extends CompareTo { 25 | 26 | private static final long serialVersionUID = -504083241204488174L; 27 | 28 | public GreaterOrEqual(final Comparable value) { 29 | super(value); 30 | } 31 | 32 | @Override 33 | protected String getName() { 34 | return "geq"; 35 | } 36 | 37 | @Override 38 | protected boolean matchResult(final int result) { 39 | return result >= 0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.4/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (EasyMockClassExtension) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 33 | 34 |
ConstructorArgs 25 |
26 | EasyMock 27 |
28 | IMocksControl 29 |
30 | MockClassControl 31 |
32 |
35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/IMocksBehavior.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public interface IMocksBehavior { 22 | 23 | // record 24 | void addExpected(ExpectedInvocation expected, Result result, Range count); 25 | 26 | void addStub(ExpectedInvocation expected, Result result); 27 | 28 | void checkOrder(boolean value); 29 | 30 | void makeThreadSafe(boolean isThreadSafe); 31 | 32 | void shouldBeUsedInOneThread(boolean shouldBeUsedInOneThread); 33 | 34 | // replay 35 | Result addActual(Invocation invocation); 36 | 37 | boolean isThreadSafe(); 38 | 39 | void checkThreadSafety(); 40 | 41 | // verify 42 | void verify(); 43 | } 44 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/NotNull.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public final class NotNull implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -2689588759855326190L; 28 | 29 | public static final NotNull NOT_NULL = new NotNull(); 30 | 31 | private NotNull() { 32 | 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return actual != null; 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("notNull()"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /website/api/easymock/2.4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | EasyMock 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | <H2> 28 | Frame Alert</H2> 29 | 30 | <P> 31 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 32 | <BR> 33 | Link to<A HREF="org/easymock/package-summary.html">Non-frame version.</A> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/org/easymock/classextension/internal/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.easymock.classextension.internal (EasyMock class extension 3.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.easymock.classextension.internal 21 | 22 | 23 | 30 | 31 |
24 | Classes  25 | 26 |
27 | MockBuilder 28 |
29 | MocksClassControl
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /easymock-test-deploy/src/test/java/org/easymock/test/EasyMockTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2009-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.test; 17 | 18 | import java.io.IOException; 19 | 20 | import org.junit.Test; 21 | 22 | import static org.easymock.EasyMock.*; 23 | import static org.junit.Assert.*; 24 | 25 | /** 26 | * Test that everything is working fine after a deployment to Sonatype 27 | * 28 | * @author Henri Tremblay 29 | */ 30 | public class EasyMockTest { 31 | 32 | @Test 33 | public void test() throws IOException { 34 | Appendable mock = createMock(Appendable.class); 35 | expect(mock.append("test")).andReturn(mock); 36 | replay(mock); 37 | assertSame(mock, mock.append("test")); 38 | verify(mock); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/EasyMockRule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | import org.easymock.internal.EasyMockStatement; 19 | import org.junit.rules.TestRule; 20 | import org.junit.runner.Description; 21 | import org.junit.runners.model.Statement; 22 | 23 | /** 24 | * JUnit Rule used to process {@link Mock} and {@link TestSubject} annotations. 25 | * 26 | * @author Alistair Todd 27 | * @since 3.3 28 | */ 29 | public class EasyMockRule implements TestRule { 30 | 31 | private final Object test; 32 | 33 | public EasyMockRule(final Object test) { 34 | this.test = test; 35 | } 36 | 37 | public Statement apply(final Statement base, final Description description) { 38 | return new EasyMockStatement(base, test); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /website/Error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | EasyMock : Error 8 | 9 | 10 | 11 | 12 |

13 | 14 |

EasyMock

15 | 16 |
17 | Home     18 | Downloads     19 | Documentation     20 | License     21 | User Comments     22 | Links 23 |
24 | 25 | 26 |

27 | Error 28 |

29 | 30 |

31 | The page you requested was not found. 32 |

33 | 34 |
35 | © 2001-2013 Tammo Freese, Henri Tremblay 36 |
37 | 38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/IClassInstantiator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * Used to instantiate a given class. 20 | * 21 | * @author Henri Tremblay 22 | */ 23 | public interface IClassInstantiator { 24 | 25 | /** 26 | * Return a new instance of the specified class. The recommended way is 27 | * without calling any constructor. This is usually done by doing like 28 | * ObjectInputStream.readObject() which is JVM specific. 29 | * 30 | * @param clazz 31 | * class to instantiate 32 | * @return new instance of clazz 33 | * @throws InstantiationException 34 | */ 35 | Object newInstance(Class clazz) throws InstantiationException; 36 | } 37 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/Util.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import java.io.PrintWriter; 19 | import java.io.StringWriter; 20 | 21 | /** 22 | * @author OFFIS, Tammo Freese 23 | */ 24 | public final class Util { 25 | 26 | private Util() { 27 | } 28 | 29 | public static String getStackTrace(final Throwable throwable) { 30 | final StringWriter stackTrace = new StringWriter(); 31 | throwable.printStackTrace(new PrintWriter(stackTrace)); 32 | return stackTrace.getBuffer().toString(); 33 | } 34 | 35 | public static boolean startWithClass(final Throwable throwable, final Class clazz) { 36 | final StackTraceElement[] elements = throwable.getStackTrace(); 37 | return elements[0].getClassName().equals(clazz.getName()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | EasyMockClassExtension 8 | 9 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | <H2> 28 | Frame Alert</H2> 29 | 30 | <P> 31 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 32 | <BR> 33 | Link to<A HREF="org/easymock/classextension/package-summary.html">Non-frame version.</A> 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /easymock-test-deploy/src/test/java/org/easymock/test/EasyMockClassExtensionTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2009-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.test; 17 | 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | 21 | import org.junit.Test; 22 | 23 | import static org.easymock.classextension.EasyMock.*; 24 | import static org.junit.Assert.*; 25 | 26 | /** 27 | * Test that everything is working fine after a deployment to Sonatype 28 | * 29 | * @author Henri Tremblay 30 | */ 31 | public class EasyMockClassExtensionTest { 32 | 33 | @Test 34 | public void test() throws IOException { 35 | ArrayList mock = createMock(ArrayList.class); 36 | expect(mock.size()).andReturn(5); 37 | replay(mock); 38 | assertEquals(5, mock.size()); 39 | verify(mock); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/IAnswer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | /** 19 | * Used to answer expected calls. 20 | * 21 | * @param 22 | * the type to return. 23 | * 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public interface IAnswer { 27 | 28 | /** 29 | * Is called by EasyMock to answer an expected call. The answer may be to 30 | * return a value, or to throw an exception. The arguments of the call for 31 | * which the answer is generated are available via 32 | * {@link EasyMock#getCurrentArguments()} - be careful here, using the 33 | * arguments is not refactoring-safe. 34 | * 35 | * @return the value to be returned 36 | * @throws Throwable 37 | * the throwable to be thrown 38 | */ 39 | T answer() throws Throwable; 40 | } 41 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/JavaProxyFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import java.lang.reflect.InvocationHandler; 19 | import java.lang.reflect.Method; 20 | import java.lang.reflect.Proxy; 21 | import org.easymock.ConstructorArgs; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public class JavaProxyFactory implements IProxyFactory { 27 | @SuppressWarnings("unchecked") 28 | public T createProxy(Class toMock, InvocationHandler handler, 29 | Method[] mockedMethods, ConstructorArgs constructorArgs) { 30 | return (T) Proxy.newProxyInstance(toMock.getClassLoader(), new Class[] { toMock }, handler); 31 | } 32 | 33 | public InvocationHandler getInvocationHandler(Object mock) { 34 | return Proxy.getInvocationHandler(mock); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/EndsWith.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class EndsWith implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = 5159338714596685067L; 28 | 29 | private final String suffix; 30 | 31 | public EndsWith(final String suffix) { 32 | this.suffix = suffix; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return (actual instanceof String) && ((String) actual).endsWith(suffix); 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("endsWith(\"" + suffix + "\")"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/InstanceOf.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class InstanceOf implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -551735356674347591L; 28 | 29 | private final Class clazz; 30 | 31 | public InstanceOf(final Class clazz) { 32 | this.clazz = clazz; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return (actual != null) && clazz.isAssignableFrom(actual.getClass()); 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("isA(" + clazz.getName() + ")"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Not.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class Not implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -5160559075998939348L; 28 | 29 | private final IArgumentMatcher first; 30 | 31 | public Not(final IArgumentMatcher first) { 32 | this.first = first; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return !first.matches(actual); 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("not("); 41 | first.appendTo(buffer); 42 | buffer.append(")"); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/IVarArgs.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | /** 19 | * @author OFFIS, Tammo Freese 20 | */ 21 | public interface IVarArgs { 22 | public void withVarargsString(int value, String... s); 23 | 24 | public void withVarargsObject(int value, Object... o); 25 | 26 | public void withVarargsBoolean(int value, boolean... b); 27 | 28 | public void withVarargsByte(int value, byte... b); 29 | 30 | public void withVarargsChar(int value, char... c); 31 | 32 | public void withVarargsDouble(int value, double... d); 33 | 34 | public void withVarargsFloat(int value, float... f); 35 | 36 | public void withVarargsInt(int value, int... i); 37 | 38 | public void withVarargsLong(int value, long... l); 39 | 40 | public void withVarargsShort(int value, short... s); 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/StartsWith.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class StartsWith implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -658998692584342514L; 28 | 29 | private final String prefix; 30 | 31 | public StartsWith(final String prefix) { 32 | this.prefix = prefix; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return (actual instanceof String) && ((String) actual).startsWith(prefix); 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("startsWith(\"" + prefix + "\")"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Matches.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class Matches implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -6657694947057597484L; 28 | 29 | private final String regex; 30 | 31 | public Matches(final String regex) { 32 | this.regex = regex; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return (actual instanceof String) && ((String) actual).matches(regex); 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("matches(\"" + regex.replaceAll("\\\\", "\\\\\\\\") + "\")"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /website/api/easymock/2.4/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview List (EasyMock class extension 3.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 |
23 |
26 | 27 | 28 | 29 | 39 | 40 |
All Classes 30 |

31 | 32 | Packages 33 |
34 | org.easymock.classextension 35 |
36 | org.easymock.classextension.internal 37 |
38 |

41 | 42 |

43 |   44 | 45 | 46 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Contains.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class Contains implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -6785245714002503134L; 28 | 29 | private final String substring; 30 | 31 | public Contains(final String substring) { 32 | this.substring = substring; 33 | } 34 | 35 | public boolean matches(final Object actual) { 36 | return (actual instanceof String) && ((String) actual).indexOf(substring) >= 0; 37 | } 38 | 39 | public void appendTo(final StringBuffer buffer) { 40 | buffer.append("contains(\"" + substring + "\")"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /easymock-android-tck/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 25 | 26 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.4/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymock/2.5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock 2.5 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymock/3.0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock 3.0 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/ExpectedInvocationAndResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * @author OFFIS, Tammo Freese 22 | */ 23 | public class ExpectedInvocationAndResult implements Serializable { 24 | 25 | private static final long serialVersionUID = -1951159588262854559L; 26 | 27 | private final ExpectedInvocation expectedInvocation; 28 | 29 | private final Result result; 30 | 31 | public ExpectedInvocationAndResult(final ExpectedInvocation expectedInvocation, final Result result) { 32 | this.expectedInvocation = expectedInvocation; 33 | this.result = result; 34 | } 35 | 36 | public ExpectedInvocation getExpectedInvocation() { 37 | return expectedInvocation; 38 | } 39 | 40 | public Result getResult() { 41 | return result; 42 | } 43 | } -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock 2.5.1 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock 2.5.2 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.1/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymock/2.5.2/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymock/2.5/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymock/3.0/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymock/3.1/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/AndroidSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | /** 19 | * Android-specific support. 20 | */ 21 | public final class AndroidSupport { 22 | // ///CLOVER:OFF 23 | private static boolean isAndroid; 24 | static { 25 | try { 26 | Class.forName("dalvik.system.PathClassLoader"); 27 | 28 | // Also verify that dexmaker is present, if not we might 29 | // be running under something like robolectric, which 30 | // means we should not use dexmaker 31 | Class.forName("com.google.dexmaker.Code"); 32 | 33 | isAndroid = true; 34 | } catch (final ClassNotFoundException e) { 35 | isAndroid = false; 36 | } 37 | } 38 | 39 | public static boolean isAndroid() { 40 | return isAndroid; 41 | } 42 | // ///CLOVER:ON 43 | } 44 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF; color:#000000 } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF; color:#000000 } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} 29 | 30 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Find.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | import java.util.regex.Pattern; 20 | 21 | import org.easymock.IArgumentMatcher; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public class Find implements IArgumentMatcher, Serializable { 27 | 28 | private static final long serialVersionUID = -7104607303959381785L; 29 | 30 | private final String regex; 31 | 32 | public Find(final String regex) { 33 | this.regex = regex; 34 | } 35 | 36 | public boolean matches(final Object actual) { 37 | return (actual instanceof String) && Pattern.compile(regex).matcher((String) actual).find(); 38 | } 39 | 40 | public void appendTo(final StringBuffer buffer) { 41 | buffer.append("find(\"" + regex.replaceAll("\\\\", "\\\\\\\\") + "\")"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Same.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | import org.easymock.internal.ArgumentToString; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public class Same implements IArgumentMatcher, Serializable { 27 | 28 | private static final long serialVersionUID = 1094930851962278376L; 29 | 30 | private final Object expected; 31 | 32 | public Same(final Object expected) { 33 | this.expected = expected; 34 | } 35 | 36 | public boolean matches(final Object actual) { 37 | return expected == actual; 38 | } 39 | 40 | public void appendTo(final StringBuffer buffer) { 41 | buffer.append("same("); 42 | ArgumentToString.appendArgument(expected, buffer); 43 | buffer.append(")"); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/EasyMockRunner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock; 17 | 18 | import org.easymock.internal.EasyMockStatement; 19 | import org.junit.runners.BlockJUnit4ClassRunner; 20 | import org.junit.runners.model.FrameworkMethod; 21 | import org.junit.runners.model.InitializationError; 22 | import org.junit.runners.model.Statement; 23 | 24 | /** 25 | * JUnit runner used to process {@link Mock} and {@link TestSubject} annotations 26 | * 27 | * @author Henri Tremblay 28 | * @since 3.2 29 | */ 30 | public class EasyMockRunner extends BlockJUnit4ClassRunner { 31 | 32 | public EasyMockRunner(final Class klass) throws InitializationError { 33 | super(klass); 34 | } 35 | 36 | @Override 37 | protected Statement methodInvoker(final FrameworkMethod method, final Object test) { 38 | return new EasyMockStatement(super.methodInvoker(method, test), test); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/RecordStateInvalidDefaultReturnValueTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import static org.easymock.EasyMock.*; 19 | import static org.junit.Assert.*; 20 | 21 | import org.junit.Before; 22 | import org.junit.Test; 23 | 24 | /** 25 | * @author OFFIS, Tammo Freese 26 | */ 27 | public class RecordStateInvalidDefaultReturnValueTest { 28 | 29 | private IMethods mock; 30 | 31 | @Before 32 | public void setup() { 33 | mock = createMock(IMethods.class); 34 | } 35 | 36 | @Test 37 | public void setInvalidStubReturnValue() { 38 | try { 39 | expect((Object) mock.oneArg(false)).andStubReturn(false); 40 | fail("IllegalStateException expected"); 41 | } catch (final IllegalStateException e) { 42 | assertEquals("incompatible return value type", e.getMessage()); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | IMockBuilder 30 |
31 | IMocksControl 32 |
33 | MockClassControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 3.0 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | EasyMockSupport 30 |
31 | IMockBuilder 32 |
33 | IMocksControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymock/3.1/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Overview List (EasyMock 3.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 |
23 |
26 | 27 | 28 | 29 | 41 | 42 |
All Classes 30 |

31 | 32 | Packages 33 |
34 | org.easymock 35 |
36 | org.easymock.internal 37 |
38 | org.easymock.internal.matchers 39 |
40 |

43 | 44 |

45 |   46 | 47 | 48 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | IMockBuilder 30 |
31 | IMocksControl 32 |
33 | MockClassControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock class extension 2.5 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/classextension/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock class extension 3.0 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/classextension/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock class extension 2.5.1 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/classextension/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock class extension 2.5.2 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | <H2> 29 | Frame Alert</H2> 30 | 31 | <P> 32 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 33 | <BR> 34 | Link to<A HREF="org/easymock/classextension/package-summary.html">Non-frame version.</A> 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /easymock-classextension/src/main/java/org/easymock/classextension/ConstructorArgs.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension; 17 | 18 | import java.lang.reflect.Constructor; 19 | 20 | /** 21 | * This class is provided solely to allow an easier transition to EasyMock 3.0. 22 | * You should now use {@link org.easymock.ConstructorArgs} instead. 23 | * 24 | * @author Henri Tremblay 25 | * 26 | * @deprecated Use {@link org.easymock.ConstructorArgs} instead 27 | */ 28 | @Deprecated 29 | public class ConstructorArgs extends org.easymock.ConstructorArgs { 30 | 31 | /** 32 | * @param constructor 33 | * Constructor to be called when creating the mock 34 | * @param initArgs 35 | * Arguments passed to the constructor 36 | */ 37 | public ConstructorArgs(Constructor constructor, Object... initArgs) { 38 | super(constructor, initArgs); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/EasyMockStatement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import org.easymock.EasyMockSupport; 19 | import org.easymock.Mock; 20 | import org.easymock.TestSubject; 21 | import org.junit.runners.model.Statement; 22 | 23 | /** 24 | * JUnit Statement for use by JUnit Rule or JUnit Runner to process {@link Mock} and {@link TestSubject} annotations. 25 | * 26 | * @author Henri Tremblay 27 | * @since 3.3 28 | */ 29 | public class EasyMockStatement extends Statement { 30 | 31 | private final Statement originalStatement; 32 | 33 | private final Object test; 34 | 35 | public EasyMockStatement(final Statement originalStatement, final Object test) { 36 | this.originalStatement = originalStatement; 37 | this.test = test; 38 | } 39 | 40 | @Override 41 | public void evaluate() throws Throwable { 42 | EasyMockSupport.injectMocks(test); 43 | originalStatement.evaluate(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.easymock.classextension (EasyMock Class extension 3.2 API) 8 | 9 | 10 | 11 | 12 |

org.easymock.classextension

13 |
14 |

Interfaces

15 | 19 |

Classes

20 | 25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/MethodSerializationWrapperTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import java.lang.reflect.Method; 21 | 22 | import org.easymock.internal.MethodSerializationWrapper; 23 | import org.junit.Test; 24 | 25 | /** 26 | * @author OFFIS, Tammo Freese 27 | */ 28 | public class MethodSerializationWrapperTest { 29 | 30 | public static class A { 31 | public void foo(final String s, final int i, final String[] sArray, final int[] iArray, 32 | final String... varargs) { 33 | } 34 | } 35 | 36 | @Test 37 | public void testGetMethod() throws Exception { 38 | final Method foo = A.class.getMethod("foo", String.class, Integer.TYPE, String[].class, int[].class, 39 | String[].class); 40 | final MethodSerializationWrapper wrapper = new MethodSerializationWrapper(foo); 41 | assertEquals(foo, wrapper.getMethod()); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /easymock-classextension/src/test/java/org/easymock/classextension/tests2/NopInvocationHandler.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension.tests2; 17 | 18 | import java.lang.reflect.InvocationHandler; 19 | import java.lang.reflect.Method; 20 | 21 | /** 22 | * InvocationHandler that just do nothing. 23 | * 24 | * @author Henri Tremblay 25 | */ 26 | public class NopInvocationHandler implements InvocationHandler { 27 | 28 | public static final InvocationHandler NOP = new NopInvocationHandler(); 29 | 30 | @SuppressWarnings("unused") 31 | private transient Method equalsMethod; 32 | 33 | @SuppressWarnings("unused") 34 | private transient Method hashCodeMethod; 35 | 36 | @SuppressWarnings("unused") 37 | private transient Method toStringMethod; 38 | 39 | private NopInvocationHandler() { 40 | } 41 | 42 | public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { 43 | return null; 44 | } 45 | } -------------------------------------------------------------------------------- /website/api/easymock/3.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock 3.1 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | <H2> 32 | Frame Alert</H2> 33 | 34 | <P> 35 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 36 | <BR> 37 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | IMockBuilder 30 |
31 | IMocksControl 32 |
33 | MockClassControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 3.0 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | EasyMockSupport 30 |
31 | IMockBuilder 32 |
33 | IMocksControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 36 | 37 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | IMockBuilder 30 |
31 | IMocksControl 32 |
33 | MockClassControl 34 |
35 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (EasyMock Class extension 3.2 API) 8 | 9 | 10 | 11 | 12 |

All Classes

13 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/ExpectedInvocationAndResults.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * @author OFFIS, Tammo Freese 22 | */ 23 | public class ExpectedInvocationAndResults implements Serializable { 24 | 25 | private static final long serialVersionUID = 8189985418895395472L; 26 | 27 | private final ExpectedInvocation expectedInvocation; 28 | 29 | private final Results results; 30 | 31 | public ExpectedInvocationAndResults(final ExpectedInvocation expectedInvocation, final Results results) { 32 | this.expectedInvocation = expectedInvocation; 33 | this.results = results; 34 | } 35 | 36 | public ExpectedInvocation getExpectedInvocation() { 37 | return expectedInvocation; 38 | } 39 | 40 | public Results getResults() { 41 | return results; 42 | } 43 | 44 | @Override 45 | public String toString() { 46 | return expectedInvocation.toString() + ": " + results.toString(); 47 | } 48 | } -------------------------------------------------------------------------------- /easymock/src/samples/java/org/easymock/samples/AnnotatedMockWithRuleTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.samples; 17 | 18 | import org.easymock.EasyMockRule; 19 | import org.easymock.EasyMockSupport; 20 | import org.easymock.Mock; 21 | import org.easymock.TestSubject; 22 | import org.junit.Rule; 23 | import org.junit.Test; 24 | 25 | /** 26 | * Example of how to use @Mock and @TestSubject annotations with Junit Rule. 27 | * 28 | * @author Alistair Todd 29 | */ 30 | public class AnnotatedMockWithRuleTest extends EasyMockSupport { 31 | 32 | @Rule 33 | public EasyMockRule mocks = new EasyMockRule(this); 34 | 35 | @TestSubject 36 | private final ClassTested classUnderTest = new ClassTested(); 37 | 38 | @Mock 39 | private Collaborator collaborator; 40 | 41 | @Test 42 | public void addDocument() { 43 | collaborator.documentAdded("New Document"); 44 | replayAll(); 45 | classUnderTest.addDocument("New Document", new byte[0]); 46 | verifyAll(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | EasyMock class extension 3.1 API 9 | 10 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | <H2> 32 | Frame Alert</H2> 33 | 34 | <P> 35 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. 36 | <BR> 37 | Link to<A HREF="overview-summary.html">Non-frame version.</A> 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /easymock/src/samples/java/org/easymock/samples/AnnotatedMockWithRunnerTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.samples; 17 | 18 | import org.easymock.EasyMockRunner; 19 | import org.easymock.EasyMockSupport; 20 | import org.easymock.Mock; 21 | import org.easymock.TestSubject; 22 | import org.junit.Test; 23 | import org.junit.runner.RunWith; 24 | 25 | /** 26 | * Example of how to use @Mock and @TestSubject annotations with JUnit Runner. 27 | * 28 | * @author Henri Tremblay 29 | */ 30 | @RunWith(EasyMockRunner.class) 31 | public class AnnotatedMockWithRunnerTest extends EasyMockSupport { 32 | 33 | @TestSubject 34 | private final ClassTested classUnderTest = new ClassTested(); 35 | 36 | @Mock 37 | private Collaborator collaborator; 38 | 39 | @Test 40 | public void addDocument() { 41 | collaborator.documentAdded("New Document"); 42 | replayAll(); 43 | classUnderTest.addDocument("New Document", new byte[0]); 44 | verifyAll(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/IMocksControlState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import org.easymock.IAnswer; 19 | 20 | /** 21 | * @author OFFIS, Tammo Freese 22 | */ 23 | public interface IMocksControlState { 24 | 25 | Object invoke(Invocation invocation) throws Throwable; 26 | 27 | void assertRecordState(); 28 | 29 | void andReturn(Object value); 30 | 31 | void andThrow(Throwable throwable); 32 | 33 | void andAnswer(IAnswer answer); 34 | 35 | void andDelegateTo(Object answer); 36 | 37 | void andStubReturn(Object value); 38 | 39 | void andStubThrow(Throwable throwable); 40 | 41 | void andStubAnswer(IAnswer answer); 42 | 43 | void andStubDelegateTo(Object delegateTo); 44 | 45 | void asStub(); 46 | 47 | void times(Range range); 48 | 49 | void checkOrder(boolean value); 50 | 51 | void makeThreadSafe(boolean threadSafe); 52 | 53 | void checkIsUsedInOneThread(boolean shouldBeUsedInOneThread); 54 | 55 | void replay(); 56 | 57 | void verify(); 58 | } 59 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.4/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.easymock.classextension (EasyMockClassExtension) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | org.easymock.classextension 20 | 21 | 22 | 27 | 28 |
23 | Interfaces  24 | 25 |
26 | IMocksControl
29 | 30 | 31 | 32 | 33 | 42 | 43 |
34 | Classes  35 | 36 |
37 | ConstructorArgs 38 |
39 | EasyMock 40 |
41 | MockClassControl
44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5.2 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 38 | 39 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | EasyMockSupport 30 |
31 | IMockBuilder 32 |
33 | IMocksControl 34 |
35 | MockClassControl 36 |
37 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/EqualsWithDelta.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class EqualsWithDelta implements IArgumentMatcher, Serializable { 26 | 27 | private static final long serialVersionUID = -3018631689416120154L; 28 | 29 | private final Number expected; 30 | 31 | private final Number delta; 32 | 33 | public EqualsWithDelta(final Number value, final Number delta) { 34 | this.expected = value; 35 | this.delta = delta; 36 | } 37 | 38 | public boolean matches(final Object actual) { 39 | final Number actualNumber = (Number) actual; 40 | return expected.doubleValue() - delta.doubleValue() <= actualNumber.doubleValue() 41 | && actualNumber.doubleValue() <= expected.doubleValue() + delta.doubleValue(); 42 | } 43 | 44 | public void appendTo(final StringBuffer buffer) { 45 | buffer.append("eq(" + expected + ", " + delta + ")"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /website/ReleaseNotes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | EasyMock : Release Notes 6 | 7 | 8 | 9 |
10 | 11 |

EasyMock

12 | 13 |
14 | Home     15 | Downloads     16 | Documentation     17 | Release Notes     18 | License     19 | User Comments     20 | Links 21 |
22 | 23 |

24 | Release Notes 25 |

26 |

27 | Release Notes are available on Jira at Codehaus. 28 |

29 |

30 | Release Notes prior to version 3.2 are also available at the end of the documentation for each version. They could be a bit 31 | more accurate and explained than what you will find in Jira. 32 |

33 |
34 | © 2001-2013 Tammo Freese, Henri Tremblay 35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/ExpectedMethodCallTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import java.lang.reflect.Method; 21 | 22 | import org.easymock.internal.ExpectedInvocation; 23 | import org.easymock.internal.Invocation; 24 | import org.junit.Before; 25 | import org.junit.Test; 26 | 27 | /** 28 | * @author OFFIS, Tammo Freese 29 | */ 30 | public class ExpectedMethodCallTest { 31 | 32 | private ExpectedInvocation call; 33 | 34 | @Before 35 | public void setup() throws SecurityException, NoSuchMethodException { 36 | final Object[] arguments1 = new Object[] { "" }; 37 | final Method m = Object.class.getMethod("equals", new Class[] { Object.class }); 38 | call = new ExpectedInvocation(new Invocation(null, m, arguments1), null); 39 | } 40 | 41 | @Test 42 | public void testHashCode() { 43 | try { 44 | call.hashCode(); 45 | fail(); 46 | } catch (final UnsupportedOperationException expected) { 47 | assertEquals("hashCode() is not implemented", expected.getMessage()); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.2/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (EasyMock Class extension 3.2 API) 8 | 9 | 10 | 11 | 12 |

All Classes

13 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /website/api/easymock/2.4/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (EasyMock) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | All Classes 20 |
21 | 22 | 23 | 24 | 45 | 46 |
AbstractMatcher 25 |
26 | ArgumentsMatcher 27 |
28 | Capture 29 |
30 | EasyMock 31 |
32 | IAnswer 33 |
34 | IArgumentMatcher 35 |
36 | IExpectationSetters 37 |
38 | IMocksControl 39 |
40 | LogicalOperator 41 |
42 | MockControl 43 |
44 |
47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.2/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 2.5.2 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 38 | 39 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | EasyMockSupport 30 |
31 | IMockBuilder 32 |
33 | IMocksControl 34 |
35 | MockClassControl 36 |
37 |
40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests/NiceMockControlTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests; 17 | 18 | import static org.easymock.EasyMock.*; 19 | import static org.junit.Assert.*; 20 | 21 | import org.junit.Before; 22 | import org.junit.Test; 23 | 24 | /** 25 | * @author OFFIS, Tammo Freese 26 | */ 27 | public class NiceMockControlTest { 28 | 29 | private IMethods mock; 30 | 31 | @Before 32 | public void setup() { 33 | mock = createNiceMock(IMethods.class); 34 | replay(mock); 35 | } 36 | 37 | @Test 38 | public void defaultReturnValueBoolean() { 39 | assertEquals(false, mock.booleanReturningMethod(12)); 40 | verify(mock); 41 | } 42 | 43 | @Test 44 | public void defaultReturnValueFloat() { 45 | assertEquals(0.0f, mock.floatReturningMethod(12), 0.0f); 46 | verify(mock); 47 | } 48 | 49 | @Test 50 | public void defaultReturnValueDouble() { 51 | assertEquals(0.0d, mock.doubleReturningMethod(12), 0.0d); 52 | verify(mock); 53 | } 54 | 55 | @Test 56 | public void defaultReturnValueObject() { 57 | assertEquals(null, mock.objectReturningMethod(12)); 58 | verify(mock); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/CompareTo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @param 24 | * Type of the values compared 25 | * 26 | * @author Henri Tremblay 27 | */ 28 | public abstract class CompareTo> implements IArgumentMatcher, Serializable { 29 | 30 | private static final long serialVersionUID = -8447010713532143168L; 31 | 32 | private final Comparable expected; 33 | 34 | public CompareTo(final Comparable value) { 35 | this.expected = value; 36 | } 37 | 38 | @SuppressWarnings({ "unchecked", "rawtypes" }) 39 | public boolean matches(final Object actual) { 40 | 41 | if (!(actual instanceof Comparable)) { 42 | return false; 43 | } 44 | 45 | return matchResult(((Comparable) actual).compareTo(expected)); 46 | } 47 | 48 | public void appendTo(final StringBuffer buffer) { 49 | buffer.append(getName() + "(" + expected + ")"); 50 | } 51 | 52 | protected abstract String getName(); 53 | 54 | protected abstract boolean matchResult(int result); 55 | } 56 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | All Classes (EasyMock class extension 3.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | All Classes 21 |
22 | 23 | 24 | 25 | 40 | 41 |
ConstructorArgs 26 |
27 | EasyMock 28 |
29 | EasyMockSupport 30 |
31 | IMockBuilder 32 |
33 | IMocksControl 34 |
35 | MockBuilder 36 |
37 | MocksClassControl 38 |
39 |
42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /easymock/src/test/java/org/easymock/tests2/NiceMockTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.tests2; 17 | 18 | import static org.easymock.EasyMock.*; 19 | import static org.junit.Assert.*; 20 | 21 | import org.easymock.tests.IMethods; 22 | import org.junit.Before; 23 | import org.junit.Test; 24 | 25 | /** 26 | * @author OFFIS, Tammo Freese 27 | */ 28 | public class NiceMockTest { 29 | 30 | IMethods mock; 31 | 32 | @Before 33 | public void setup() { 34 | mock = createNiceMock(IMethods.class); 35 | replay(mock); 36 | } 37 | 38 | @Test 39 | public void defaultReturnValueBoolean() { 40 | assertEquals(false, mock.booleanReturningMethod(12)); 41 | verify(mock); 42 | } 43 | 44 | @Test 45 | public void defaultReturnValueFloat() { 46 | assertEquals(0.0f, mock.floatReturningMethod(12), 0.0f); 47 | verify(mock); 48 | } 49 | 50 | @Test 51 | public void defaultReturnValueDouble() { 52 | assertEquals(0.0d, mock.doubleReturningMethod(12), 0.0d); 53 | verify(mock); 54 | } 55 | 56 | @Test 57 | public void defaultReturnValueObject() { 58 | assertEquals(null, mock.objectReturningMethod(12)); 59 | verify(mock); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/IProxyFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal; 17 | 18 | import java.lang.reflect.InvocationHandler; 19 | import java.lang.reflect.Method; 20 | 21 | import org.easymock.ConstructorArgs; 22 | 23 | /** 24 | * @author OFFIS, Tammo Freese 25 | */ 26 | public interface IProxyFactory { 27 | 28 | /** 29 | * @param toMock the class to mock by the factory 30 | * @param handler the handler that will be linked to the created proxy 31 | * @param mockedMethods the subset of {@code toMock}'s methods to mock, or 32 | * null to mock all methods. 33 | * @param constructorArgs the constructor arguments to use, or null to use 34 | * heuristics to choose a constructor. 35 | * @return the newly created proxy 36 | */ 37 | T createProxy(Class toMock, InvocationHandler handler, Method[] mockedMethods, 38 | ConstructorArgs constructorArgs); 39 | 40 | /** 41 | * Returns the invocation handler for {@code mock}; 42 | * 43 | * @param mock a mock instance previously returned by {@code createProxy}. 44 | * @return the handler handling method calls for the {@code mock} 45 | */ 46 | InvocationHandler getInvocationHandler(Object mock); 47 | } 48 | -------------------------------------------------------------------------------- /easymock-classextension/src/test/java/org/easymock/classextension/tests2/ClassProxyFactoryTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2003-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.classextension.tests2; 17 | 18 | import static org.junit.Assert.*; 19 | 20 | import java.lang.reflect.Field; 21 | 22 | import net.sf.cglib.proxy.Callback; 23 | 24 | import org.easymock.internal.ClassProxyFactory; 25 | import org.junit.Test; 26 | 27 | /** 28 | * @author Henri Tremblay 29 | */ 30 | public class ClassProxyFactoryTest { 31 | 32 | private final ClassProxyFactory factory = new ClassProxyFactory(); 33 | 34 | @SuppressWarnings("unchecked") 35 | @Test 36 | public void testRegisterClassNotLeaking() throws Exception { 37 | final ClassProxyFactoryTest mock = factory.createProxy(ClassProxyFactoryTest.class, 38 | NopInvocationHandler.NOP, null, null); 39 | // Go deep in the cglib implementation to make sure the callback was released on the mocked class 40 | final Field field = mock.getClass().getDeclaredField("CGLIB$THREAD_CALLBACKS"); 41 | field.setAccessible(true); 42 | final ThreadLocal tl = (ThreadLocal) field.get(mock); 43 | final Callback callback = tl.get(); 44 | assertNull(callback); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/And.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | import java.util.Iterator; 20 | import java.util.List; 21 | 22 | import org.easymock.IArgumentMatcher; 23 | 24 | /** 25 | * @author OFFIS, Tammo Freese 26 | */ 27 | public class And implements IArgumentMatcher, Serializable { 28 | 29 | private static final long serialVersionUID = 3874580646798403818L; 30 | 31 | private final List matchers; 32 | 33 | public And(final List matchers) { 34 | this.matchers = matchers; 35 | } 36 | 37 | public boolean matches(final Object actual) { 38 | for (final IArgumentMatcher matcher : matchers) { 39 | if (!matcher.matches(actual)) { 40 | return false; 41 | } 42 | } 43 | return true; 44 | } 45 | 46 | public void appendTo(final StringBuffer buffer) { 47 | buffer.append("and("); 48 | for (final Iterator it = matchers.iterator(); it.hasNext();) { 49 | it.next().appendTo(buffer); 50 | if (it.hasNext()) { 51 | buffer.append(", "); 52 | } 53 | } 54 | buffer.append(")"); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /easymock/src/main/java/org/easymock/internal/matchers/Or.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.internal.matchers; 17 | 18 | import java.io.Serializable; 19 | import java.util.Iterator; 20 | import java.util.List; 21 | 22 | import org.easymock.IArgumentMatcher; 23 | 24 | /** 25 | * @author OFFIS, Tammo Freese 26 | */ 27 | public class Or implements IArgumentMatcher, Serializable { 28 | 29 | private static final long serialVersionUID = -5701204283180444317L; 30 | 31 | private final List matchers; 32 | 33 | public Or(final List matchers) { 34 | this.matchers = matchers; 35 | } 36 | 37 | public boolean matches(final Object actual) { 38 | for (final IArgumentMatcher matcher : matchers) { 39 | if (matcher.matches(actual)) { 40 | return true; 41 | } 42 | } 43 | return false; 44 | } 45 | 46 | public void appendTo(final StringBuffer buffer) { 47 | buffer.append("or("); 48 | for (final Iterator it = matchers.iterator(); it.hasNext();) { 49 | it.next().appendTo(buffer); 50 | if (it.hasNext()) { 51 | buffer.append(", "); 52 | } 53 | } 54 | buffer.append(")"); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /easymock/src/samples/java/org/easymock/samples/ThrowableEquals.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2001-2013 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.easymock.samples; 17 | 18 | import static org.easymock.EasyMock.*; 19 | 20 | import org.easymock.IArgumentMatcher; 21 | 22 | /** 23 | * @author OFFIS, Tammo Freese 24 | */ 25 | public class ThrowableEquals implements IArgumentMatcher { 26 | private final Throwable expected; 27 | 28 | public ThrowableEquals(final Throwable expected) { 29 | this.expected = expected; 30 | } 31 | 32 | public boolean matches(final Object actual) { 33 | if (!(actual instanceof Throwable)) { 34 | return false; 35 | } 36 | final String actualMessage = ((Throwable) actual).getMessage(); 37 | return expected.getClass().equals(actual.getClass()) && expected.getMessage().equals(actualMessage); 38 | } 39 | 40 | public void appendTo(final StringBuffer buffer) { 41 | buffer.append("<"); 42 | buffer.append(expected.getClass().getName()); 43 | buffer.append(" with message \""); 44 | buffer.append(expected.getMessage()); 45 | buffer.append("\">"); 46 | 47 | } 48 | 49 | public static T eqException(final T in) { 50 | reportMatcher(new ThrowableEquals(in)); 51 | return in; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.easymock.classextension (EasyMock class extension 2.5 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.easymock.classextension 21 | 22 | 23 | 30 | 31 |
24 | Interfaces  25 | 26 |
27 | IMockBuilder 28 |
29 | IMocksControl
32 | 33 | 34 | 35 | 36 | 45 | 46 |
37 | Classes  38 | 39 |
40 | ConstructorArgs 41 |
42 | EasyMock 43 |
44 | MockClassControl
47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.0/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.easymock.classextension (EasyMock class extension 3.0 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.easymock.classextension 21 | 22 | 23 | 30 | 31 |
24 | Interfaces  25 | 26 |
27 | IMockBuilder 28 |
29 | IMocksControl
32 | 33 | 34 | 35 | 36 | 45 | 46 |
37 | Classes  38 | 39 |
40 | ConstructorArgs 41 |
42 | EasyMock 43 |
44 | EasyMockSupport
47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/3.1/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.easymock.classextension (EasyMock class extension 3.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.easymock.classextension 21 | 22 | 23 | 30 | 31 |
24 | Interfaces  25 | 26 |
27 | IMockBuilder 28 |
29 | IMocksControl
32 | 33 | 34 | 35 | 36 | 45 | 46 |
37 | Classes  38 | 39 |
40 | ConstructorArgs 41 |
42 | EasyMock 43 |
44 | EasyMockSupport
47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /website/api/easymockclassextension/2.5.1/org/easymock/classextension/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | org.easymock.classextension (EasyMock class extension 2.5.1 API) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.easymock.classextension 21 | 22 | 23 | 30 | 31 |
24 | Interfaces  25 | 26 |
27 | IMockBuilder 28 |
29 | IMocksControl
32 | 33 | 34 | 35 | 36 | 45 | 46 |
37 | Classes  38 | 39 |
40 | ConstructorArgs 41 |
42 | EasyMock 43 |
44 | MockClassControl
47 | 48 | 49 | 50 | 51 | --------------------------------------------------------------------------------