|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockcentral.editor.nodes.MockCentralNodeModel
org.mockcentral.editor.nodes.MockCentralGroupNodeModel
org.mockcentral.editor.nodes.expectation_group.ExpectationGroupModel
public class ExpectationGroupModel
A class that models the list of method expectations for a Mock Object definition.
| Field Summary |
|---|
| Fields inherited from class org.mockcentral.editor.nodes.MockCentralGroupNodeModel |
|---|
observers |
| Fields inherited from class org.mockcentral.editor.nodes.MockCentralNodeModel |
|---|
element, node |
| Constructor Summary | |
|---|---|
ExpectationGroupModel(MockCentralNode node)
Creates a new instance, casting and assigning the MockCentralNode reference. |
|
| Method Summary | |
|---|---|
void |
addExpectation(java.lang.reflect.Method method)
Creates a new ExpectationNode with default values using the
supplied Method and adds it to the list of child nodes. |
void |
addExpectation(java.lang.String methodName)
Creates a new ExpectationNode with default values using the
supplied method name and adds it to the list of child nodes. |
ExpectationNode |
createExpectationNode(java.lang.String methodName)
Creates and returns a new ExpectationNode constructed using
the supplied method name. |
java.lang.String |
getChildNodeTypeDescription(boolean singular)
Returns a String description of the MockCentralNode's child
type, ie "Fixture", "Mock Object" etc. |
MockCentralTableModel<MockableMethod> |
getMethodNamesTableModel(java.lang.Class<?> clazz,
boolean includeObjectMethods)
Returns a MockCentralTableModel build from the supplied
Class instance's methods. |
java.lang.String |
getMockObjectInterfaceClass()
Returns the interface Class of the current Mock Object. |
java.lang.String |
getMockObjectName()
Returns the name of the current Mock Obect. |
boolean |
isDefaultMethodVersionInUse(java.lang.reflect.Method method,
boolean matchAnyParams)
Returns whether the default version of a mocked method is already in use for the current Mock Object. |
boolean |
isDuplicateExpectation(org.jdom.Element e,
int elementHashCode)
Returns whether a new or edited Mock Object method expectation duplicates another in the list for the current Mock Object. |
boolean |
isInterfaceMethod(java.lang.String methodName,
org.jdom.Element e)
Returns whether the method defined by the parameters corresponds to one defined by the Mock Object interface. |
boolean |
isMethodNameInUse(java.lang.String methodName,
java.lang.Object excluded)
Returns whether the supplied method name is currently in use within the list of Mock Object method expectations. |
| Methods inherited from class org.mockcentral.editor.nodes.MockCentralGroupNodeModel |
|---|
addChildNode, addObserver, editSelectedChild, fireChildrenChanged, getChildren, getElement, loadElementData, removeChildNode, sortChildren |
| Methods inherited from class org.mockcentral.editor.nodes.MockCentralNodeModel |
|---|
addObserver, getEnclosingFixtureNode, getNode, getNotRemovableMessage, getObservers, registerChanges, removeObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpectationGroupModel(MockCentralNode node)
MockCentralNode reference.
node - the MockCentralNode containing the jdom
Element whose data this class models.| Method Detail |
|---|
public java.lang.String getChildNodeTypeDescription(boolean singular)
MockCentralGroupNodeModelMockCentralNode's child
type, ie "Fixture", "Mock Object" etc.
getChildNodeTypeDescription in class MockCentralGroupNodeModelsingular - value for whether the String should be in singular form.
MockCentralNode type.public java.lang.String getMockObjectName()
public java.lang.String getMockObjectInterfaceClass()
public boolean isInterfaceMethod(java.lang.String methodName,
org.jdom.Element e)
methodName - the method name.e - the Element defining the method parameters (and
other info).
public boolean isDuplicateExpectation(org.jdom.Element e,
int elementHashCode)
e - the JDOM Element containing the new or edited
method expectation data.elementHashCode - the hashcode to use to identify an instance to
exclude from testing for duplication when it is being edited itself.
public boolean isDefaultMethodVersionInUse(java.lang.reflect.Method method,
boolean matchAnyParams)
IMethodsListEditor
isDefaultMethodVersionInUse in interface IMethodsListEditormethod - the Method to be mocked.matchAnyParams - whether to match any parameters, i.e. return true
if the method name is in use at all.
public MockCentralTableModel<MockableMethod> getMethodNamesTableModel(java.lang.Class<?> clazz,
boolean includeObjectMethods)
IMethodsListEditorMockCentralTableModel build from the supplied
Class instance's methods. If the includeObjectMethods flag
is set, this model will also include all java.lang.Object
methods. The resulting table is populated with
MockableMethod objects.
getMethodNamesTableModel in interface IMethodsListEditorclazz - the Class.includeObjectMethods - whether to include
java.lang.Object methods.
MockCentralTableModel build from the supplied
Class instance's methods.
public boolean isMethodNameInUse(java.lang.String methodName,
java.lang.Object excluded)
IMethodsListEditor
isMethodNameInUse in interface IMethodsListEditormethodName - the method name.excluded - an Object to exclude from duplication testing.
public void addExpectation(java.lang.String methodName)
ExpectationNode with default values using the
supplied method name and adds it to the list of child nodes.
methodName - the name of the new Mock Object method.public void addExpectation(java.lang.reflect.Method method)
ExpectationNode with default values using the
supplied Method and adds it to the list of child nodes.
method - the Mock Object Method.public ExpectationNode createExpectationNode(java.lang.String methodName)
ExpectationNode constructed using
the supplied method name.
methodName - the name for the new Mock Object method expectation
defined by the node data.
ExpectationNode constructed using the supplied
method name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||