| Home >> All >> com >> [ mockobjects Javadoc ] |
Page 1 2
| | com.mockobjects.apache.* (8) | | com.mockobjects.atg.* (10) | | com.mockobjects.beans.* (1) |
| | com.mockobjects.constraint.* (14) | | com.mockobjects.dynamic.* (20) | | com.mockobjects.examples.* (31) |
| | com.mockobjects.eziba.* (13) | | com.mockobjects.helpers.* (4) | | com.mockobjects.io.* (7) |
| | com.mockobjects.jms.* (22) |
com.mockobjects: Javadoc index of package com.mockobjects.
Package Samples:
com.mockobjects.constraint
com.mockobjects.dynamic
com.mockobjects.examples.calcserver
com.mockobjects.examples.dynamic
com.mockobjects.examples.mailinglist
com.mockobjects.examples.password
com.mockobjects.apache.commons.httpclient
com.mockobjects.atg
com.mockobjects.eziba.sql
com.mockobjects.helpers
com.mockobjects.jms
com.mockobjects.beans
com.mockobjects.io
Classes:
Null: A class that represents the null value. The Null class is used when an Expectation is set to expect nothing. Example usage: public class MockX { private Expectation... anExpectation = new Expectation...(...); public MockX() { anExpectation.setExpectNothing(); } public void setAnExpectation(Object value) { anExpectation.setExpected(value); } public void setActual(Object value) { anExpectation.setActual(value); } } The act of calling Expectation.setExpectNothing() 55 tells the expectation that it should expect no values to change. Since all Null objects are equal to themselves, most expectations ...
Verifier: Helper class to verify all Expectation s of an object. The Verifier class provides two static methods to verify objects: verifyObject(Object) 55 verifyField(Field, Object) 55 These two methods can be used to verify any expectation to assert that they still hold. Example usage: Verifying all expectations on one object at a time: public class MockX implements Verifiable { private Expectation... anExpectation = new Expectation...(...); private Expectation... aSecondExpectation = new Expectation...(...); public void verify() { Verifier.verifyObject(this); } } This example shows how most mocks implement ...
ReturnValue: The ReturnValue class allows a value to be setup which will then be returned upon a specific method call. If value.getValue() is called before value.setValue(value) the ReturnValue will raise an error warning that this value has not been set. If the required return value is null the return value can be set like this value.setValue(null) in this case calling value.getValue() will return null. The advantage of this is provide better information to the user of a mock when interacting with third party code which may expect certain values to have been set. e.g. private final ReturnValue value = new ...
MockWriter: A mock Writer . Example usage You may use the MockWriter like this: public void testSomething() throws IOException { MockWriter out = new MockWriter(); out.setExpectedSegment("some string"); out.setExpectedFlushCalls(1); out.setExpectedCloseCalls(1); ObjectUnderTest testee = new ObjectUnderTest(out); out.verify(); // If we get here, the mock's flush() and close() methods were // called exactly once each (order cannot be determined) and // the write() method was called with the string "some string" in it. }
CommonMockSingleRowResultSet: Implementation of a MockResultSet that uses the ExpectationRow object to simulate a ResultSet that returns a single row. It verifies that the values fed to it have been retrieved throw a call to next and getRow. Column values can be retrieved using any of the getters declared in MockResultSet. Depending on which constructor is used, these can be found by either column index or column name. For basic java types (e.g. int, boolean), insert an instance of the appropriate object (e.g. Integer, Boolean). To force throwing a SQLException on a getter, set the corresponding value to be of type SQLException ...
ReturnObjectList: This class allows a list of objects to be setup which can be used whilst.The list is check to make sure that all the object in it are used and that none are left over at the end of a test. For ever sucessive call to nextReturnObject the next object in the list will returned. If the nextReturnObject method is called and there are no objects in the list an assertion error will be thrown. If the verify method is called and there are objects still in the list an assertion error will also be thrown.
MockConnection2: MockConnection2 is a tempary replacement for the MockConnection. It differs from the MockConnection in the way in which PreparedStatements are handled. The changes are significant enough to break compatiblity with existing testcases so MockConnection2 provides a migration path to the new system of handling PreparedStatements. This class will eventually be merged back into MockConnection when it is felt systems using the classes have been provided with enough time to migrate.
MockResultSet: This is the base implementation of a mock result set. It manages converting objects from the current row into a other types. Entries can be found by either column index or column name. For basic java types (e.g. int, boolean), insert an instance of the appropriate object (e.g. Integer, Boolean) It also counts close() and next() calls To force throwing a SQLException on a getter, set the corresponding value to be of type SQLException.
Expectation: An Expectation is an object that we set up at the beginning of a unit test to expect certain things to happen to it. If it is possible to tell, the Expectation will fail as soon as an incorrect value has been set. Call verify() at the end of a unit test to check for missing or incomplete values. If no expectations have been set on the object, then no checking will be done and verify() will do nothing.
ReturnObjectBag: The ReturnObjectBag is a map containing instances of ReturnObjectList. A single instance is held for each mapkey. Every time a call to putObjectToReturn or getNextReturnObject is made an object is added or removed from the ReturnObjectList for the given key. This allows the ReturnObjectBag to be used to return an ordered list of objects for each key regardless of the order in which the key requests are made.
ExpectationCollection: An ExpectationCollection is an expectation that supports multiple values, such as lists and sets. The addition methods distinguish between adding a single value and unpacking the contents of a collection. We have to make this distinction so that it is possible to add an array, enumeration, or iterator as a single expected object, rather than adding its contents.
MockPropertyChangeListener: Mock object for a PropertyChangeListener. This mock object can be used in verifying the event propagation mechanism of beans. You can set the information you expect from a PropertyChangeEvent as well as the number of events. If you expect more than one event, only the actual values of the last event are stored.
ExceptionalReturnValue: Sequence of exception values as required by MockMaker This is a generic class that should have been introduced to the mockobjects code stream instead of being separately included in org.mockobjects. It is possibly similar to a ReturnObjectList?
VoidReturnValues: Sequence of void values as required by MockMaker This is a generic class that should have been introduced to the mockobjects code stream instead of being separately included in org.mockobjects. It is possibly similar to a ReturnObjectList?
ReturnValues: Sequence values as required by MockMaker This is a generic class that should have been introduced to the mockobjects code stream instead of being separately included in org.mockobjects. It is possibly similar to a ReturnObjectList?
IsEqual: Is the value equal to another value, as tested by the Object.equals(java.lang.Object) > Object.equals(java.lang.Object) 55 method?
SimpleServletTest: A sample test case showing usage of the dynamic mock library. It has also been used as an acceptance test for the implementation of the library, and so uses different variations of some of the calls
And: Calculates the logical conjunction of two constraints. Evaluation is shortcut, so that the second constraint is not called if the first constraint returns false .
Or: Calculates the logical disjunction of two constraints. Evaluation is shortcut, so that the second constraint is not called if the first constraint returns true .
CommonMockDataSource: Abstract DataSource for use with mock testing. Only the connection methods have been implemented here. If testing of the log methods is needed, please submit a patch.
MapEntry: A public MapEntry data type that can be used where the Map.Entry interface is required (needed because the Sun implementation is package protected)
TagTestHelper: Sets up mock tag objects in a common configuration. MockHttpServletRequest, MockServletContext and MockHttpSession are attached to MockPageContext
ServletTestHelper: Sets up mock servlet objects in a common configuration. HttpSession is attached to request, RequestDispatcher is connected to HttpSession
CommonMockPreparedStatement: Abstract PreparedStatement for use with mock testing. If a notImplemented method is are needed for your project, please submit a patch.
MockDataSource: Empty implementation of CommonMockDataSource . Implementations for later releases of Java may include additional members.
| Home | Contact Us | Privacy Policy | Terms of Service |