final String name = "name value";
final String value = "value value";
final String from = "from value";
final String comment = "comment value";
final String domain = "domain value";
final CookieVersion version = CookieVersion.RFC2109;
final int maxAge = 100;
final String path = "path value";
final boolean secure = false;
// =====================================================================
// Create Mocks
// =====================================================================
WebRequestCookie cookie = new WebRequestCookie();
HTTPMessageEntities entities = new SimpleHTTPMessageEntities();
// =====================================================================
// Set Expectations
// =====================================================================
expectAddSimpleElementProcess(cookie);
entityFactoryMock.expects.createCookie().returns(cookie);
contextMock.expects.getProperty(WebRequestCookie.class)
.returns(entities);
// =====================================================================
// Test Expectations
// =====================================================================
addAttribute("name", name);
addAttribute("value", value);
addAttribute("from", from);
addAttribute("comment", comment);
addAttribute("domain", domain);
addAttribute("maxAge", Integer.toString(maxAge));
addAttribute("path", path);
addAttribute("secure", "" + secure);
addAttribute("version", version.getName());
DynamicElementRule rule = new CookieRule(entityFactoryMock);
XMLProcess process = (XMLProcess) rule.startElement(dynamicProcessMock,
elementName, attributes);