|
||||||||||
| 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.expectation.ExpectationModel
public class ExpectationModel
A class that models a Mock Object method expectation data defined in the JDOM
Element of an ExpectationNode object.
| Field Summary |
|---|
| Fields inherited from class org.mockcentral.editor.nodes.MockCentralNodeModel |
|---|
element, node, observers |
| Constructor Summary | |
|---|---|
ExpectationModel(ExpectationNode node)
Creates a new instance, assigning the MockCentralNode. |
|
| Method Summary | |
|---|---|
void |
addParameter(int index,
org.mockcentral.server.SignaturePartBean model)
Adds the supplied SignaturePartBean to the list of modeled
Mock Object method parameters. |
void |
deleteParameter(org.mockcentral.server.SignaturePartBean spb)
Deletes the supplied SignaturePartBean from the list of
modeled Mock Object method parameters. |
java.lang.String |
getMethodName()
Returns the value for the Mock Object method name. |
java.lang.String |
getMethodType()
Returns the value for the Mock Object method type. |
NodeProblem |
getNodeProblem(java.lang.Object o)
Returns the stored NodeProblem associated with the supplied Object, if any. |
java.util.ArrayList<org.mockcentral.server.SignaturePartBean> |
getParametersList()
Returns the ArrayList containing the list of models of the
Mock Object method parameters. |
org.mockcentral.server.SignaturePartBean |
getResult()
Returns the SignaturePartBean modeling the Mock Object
method expectation result. |
boolean |
hasReferenceTo(java.lang.String mockObjectName,
MockObjectGroupModel mockObjectGroupModel)
Returns whether the method expectation modeled in this class makes reference (as a parameter or the result) to the Mock Object modeled by the supplied MockObjectGroupModel. |
boolean |
isAnyParameters()
Returns whether the Mock Object method expectation will accept all/any parameters. |
void |
loadElementData(boolean refreshUI)
Loads the data from the JDOM Element provided by the
MockCentralNode into the model. |
void |
setAnyParameters(boolean any)
Based on the argument, sets or clears the value for whether the Mock Object method expectation will accept all/any parameters. |
void |
setMethodName(java.lang.String methodName)
Sets the Mock Object method name value and updates the JDOM Element. |
void |
setMethodType(java.lang.String methodType)
Sets the Mock Object method type value and updates the JDOM Element. |
void |
setParameter(int index,
org.mockcentral.server.SignaturePartBean spb)
Sets the data for the indexed modeled method parameter to that contained in the SignaturePartBean argument. |
void |
setResult(org.mockcentral.server.SignaturePartBean result)
Sets the Mock Object method result. |
void |
updateMockObjectReference(java.lang.String oldName,
java.lang.String newName)
Updates the value for the name of a Mock Object referenced within the method expectation. |
| Methods inherited from class org.mockcentral.editor.nodes.MockCentralNodeModel |
|---|
addObserver, getElement, 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 ExpectationModel(ExpectationNode node)
MockCentralNode.
node - the MockCentralNode associated with this model.| Method Detail |
|---|
public void loadElementData(boolean refreshUI)
MockCentralNodeModelElement provided by the
MockCentralNode into the model.
loadElementData in class MockCentralNodeModelrefreshUI - whether to send notification to ui components to update
the display.
public boolean hasReferenceTo(java.lang.String mockObjectName,
MockObjectGroupModel mockObjectGroupModel)
MockObjectGroupModel. This value is used to
determine if removing that Mock Object defintion would break this
expectation.
mockObjectName - the name of the Mock Object to look for a reference
to.mockObjectGroupModel - the MockObjectGroupModel, used
to look up referenced Mock Objects other than the enclosing one (for
looking for indirect, i.e second-hand, references).
MockObjectGroupModel.
public void updateMockObjectReference(java.lang.String oldName,
java.lang.String newName)
oldName - the old value for the name.newName - the new value for the name.public void setMethodName(java.lang.String methodName)
Element.
methodName - the value to set.public java.lang.String getMethodName()
public void setMethodType(java.lang.String methodType)
Element.
methodType - the value to set.public java.lang.String getMethodType()
public java.util.ArrayList<org.mockcentral.server.SignaturePartBean> getParametersList()
ArrayList containing the list of models of the
Mock Object method parameters.
ArrayList containing the list of models of the
Mock Object method parameters.
public void addParameter(int index,
org.mockcentral.server.SignaturePartBean model)
SignaturePartBean to the list of modeled
Mock Object method parameters.
index - the index at which to add the the supplied
SignaturePartBean.model - the SignaturePartBean to add to the modeled
list of Mock Object method parameters.public void deleteParameter(org.mockcentral.server.SignaturePartBean spb)
SignaturePartBean from the list of
modeled Mock Object method parameters.
spb - the SignaturePartBean to remove from the modeled
list of Mock Object method parameters.
public void setParameter(int index,
org.mockcentral.server.SignaturePartBean spb)
SignaturePartBean argument.
index - the index of the modeled method paramter in the list.spb - the SignaturePartBean containing the new
parameter data.public void setAnyParameters(boolean any)
List containing the Mock Object method parameters,
updates the JDOM Element by removing the parameter child
Elements and adding a new anyParams child
Element. This will result in an
AnyConstraintMatcher being created for the Mock Object
method expectation at runtime. If false, removes the Element
's anyParams child.
any - whether all/any parameters will be accepted.public boolean isAnyParameters()
public void setResult(org.mockcentral.server.SignaturePartBean result)
result - the SignaturePartBean modeling the Mock Object
method result, or null if the result is to be void.public org.mockcentral.server.SignaturePartBean getResult()
SignaturePartBean modeling the Mock Object
method expectation result.
SignaturePartBean modeling the Mock Object
method expectation result.public NodeProblem getNodeProblem(java.lang.Object o)
INodeProblemParticipantNodeProblem associated with the supplied Object, if any.
getNodeProblem in interface INodeProblemParticipanto - the Object which may have an associated NodeProblem.
NodeProblem associated with the supplied Object, if any.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||