net.sf.jameleon.plugin.junit.tags
Class AssertEqualsTag

java.lang.Object
  extended by org.apache.commons.jelly.TagSupport
      extended by net.sf.jameleon.LocationAwareTagSupport
          extended by net.sf.jameleon.JameleonTagSupport
              extended by net.sf.jameleon.function.FunctionTag
                  extended by net.sf.jameleon.plugin.junit.JUnitFunctionTag
                      extended by net.sf.jameleon.plugin.junit.tags.AbstractAssertTag
                          extended by net.sf.jameleon.plugin.junit.tags.AssertEqualsTag
All Implemented Interfaces:
BreakPoint, Attributable, Storable, DynaTag, LocationAware, Tag

public class AssertEqualsTag
extends AbstractAssertTag

Performs an assertEquals on two variables. This tag, along with all JUnit tags can be used inside any other plug-in's session tag To compare two variables with a default JUnit error message on a failure:


 <testcase xmlns="jelly:jameleon">
     <ju-session application="someApp">
       <ju-assert-equals
           functionId="Check that var1 equals var2."
           expected="${var1}"
           actual="${var2}"/>
     </ju-session>
 </testcase>
 
To compare two variables that gives "First Name" at the beginning of the failure message:

 <testcase xmlns="jelly:jameleon">
     <jiffie-session application="someApp">
       <ju-assert-equals
           functionId="Check that var1 equals var2."
           expected="${var1}"
           actual="${var2}"
           msg="First Name"/>
     </jiffie-session>
 </testcase>
 

Tag Name: <ju-assert-equals> Type: action
Steps:
  1. Compare the expected value against the actual value.

Field Summary
protected  Object actual
          The actual value
protected  Object expected
          The expected value
protected  boolean valuesAreStrings
          Forces the values to be compared as Strings by calling the toString() method.
 
Fields inherited from class net.sf.jameleon.plugin.junit.tags.AbstractAssertTag
msg
 
Fields inherited from class net.sf.jameleon.function.FunctionTag
addt, breakPoint, expectException, expectFailure, fResults, functionDelay, functionId, lastFileWritten, log, NO_DELAY, params, postcondition, precondition, st, state, tct, vpt
 
Fields inherited from class net.sf.jameleon.JameleonTagSupport
attributes, broker, contextVars, fp, unsupportedAttributes
 
Fields inherited from class net.sf.jameleon.LocationAwareTagSupport
columnNumber, elementTagName, lineNumber, scriptFileName
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
AssertEqualsTag()
           
 
Method Summary
 void testBlock()
          Contains the actual testing of the function point.
 
Methods inherited from class net.sf.jameleon.function.FunctionTag
addParam, addRequiredAttribute, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertFalse, assertFalse, assertMethod, assertMethodWithLevel, assertNotNull, assertNotNull, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNotSame, assertNotSame, assertNull, assertNull, assertNull, assertNull, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertRegexMatches, assertSame, assertSame, assertSame, assertSame, assertTextContains, assertTextContains, assertTextContains, assertTextContains, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextEndsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTextStartsWith, assertTrue, assertTrue, assertTrue, assertTrue, checkParamTypes, cleanUp, cleanUpEnvironment, delay, delay, doTag, fail, fail, fail, fail, getFunctionId, getFunctionResults, getMatchingRegexText, getParam, getParamLength, getParams, getParentTags, getSessionTag, getStoreToFileName, getStringOrDefault, getTestCaseTag, getVariable, getVariableAsBoolean, getVariableAsList, getVariableAsString, isBreakPoint, isContextVariableNull, pluginTearDown, recordFunctionResult, regexMatches, removeFunctionResult, removeVariable, setDefaultVariableValue, setDefaultVariableValue, setExpectException, setExpectFailure, setFunctionDelay, setFunctionId, setup, setupEnvironment, setUpFunctionResults, setVariable, store, tearDown, traceMsg, validate
 
Methods inherited from class net.sf.jameleon.JameleonTagSupport
cleanVariablesInContext, createAttributes, describeAttributes, getAttributeBroker, getAttributes, getAttributeType, getClassAttributes, getFunctionalPoint, getUnsupportedAttributes, loadFunctionalPoint, resetFunctionalPoint, setAttribute, setVariableInContext, testForUnsupportedAttributesCaught
 
Methods inherited from class net.sf.jameleon.LocationAwareTagSupport
getColumnNumber, getElementName, getFileName, getLineNumber, setColumnNumber, setElementName, setFileName, setLineNumber
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.jelly.Tag
getBody, getContext, getParent, invokeBody, setBody, setContext, setParent
 

Field Detail

expected

protected Object expected
The expected value

This attribute is recognized by Jameleon

actual

protected Object actual
The actual value

This attribute is recognized by Jameleon

valuesAreStrings

protected boolean valuesAreStrings
Forces the values to be compared as Strings by calling the toString() method.

This attribute is recognized by Jameleon
Default Value: false
Constructor Detail

AssertEqualsTag

public AssertEqualsTag()
Method Detail

testBlock

public void testBlock()
Description copied from class: FunctionTag
Contains the actual testing of the function point. Implement this method with any code that would make the FunctionTag unique. The default implementation does nothing. Implement this method to make your function tag useful.

Overrides:
testBlock in class FunctionTag


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.