Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

ano-prise mocking

ano-prise mocking is an easy to use mocking mini-framework. It actually consists of three classes and is totally easy to use.

consider you have an interface you want to test, let's call it TestInterface:

svn
ano-prise/trunk/test/junit/net/anotheria/anoprise/mock/TestInterface.java
ano-prise/trunk/test/junit/net/anotheria/anoprise/mock/TestInterface.java

Now consider you have to test another component which relies on one method of the TestInterface, what can you do?

  • Create a complete Mock.
  • Use easymock (or similar) for a replay like testing strategy.
  • Create a mock onthefly which only supports the methods you needs.

The later is what ano-prise Mocking does.

svn
ano-prise/trunk/test/junit/net/anotheria/anoprise/mock/SimpleTest.java
ano-prise/trunk/test/junit/net/anotheria/anoprise/mock/SimpleTest.java