// first account item
XmlElement xml = new XmlElement("account");
xml.addAttribute("name", "my account");
xml.addAttribute("uid", "0");
XmlElement child = xml.addSubElement("identity");
child.addAttribute("name", "John Doe");
child.addAttribute("attach_signature", "false");
child = xml.addSubElement("popserver");
child.addAttribute("port", "25");
child.addAttribute("login_method", "USER");
child = xml.addSubElement("specialfolders");
child.addAttribute("inbox", "101");
child.addAttribute("sent", "104");
AccountItem item = new AccountItem(xml);
// second account item
XmlElement xml2 = new XmlElement("account");
xml2.addAttribute("uid", "0");
xml2.addAttribute("name", "my account");
XmlElement child2 = xml2.addSubElement("identity");
child2.addAttribute("attach_signature", "false");
child2.addAttribute("name", "John Doe");
child2 = xml2.addSubElement("popserver");
child2.addAttribute("login_method", "USER");
child2.addAttribute("port", "25");
child2 = xml2.addSubElement("specialfolders");
child2.addAttribute("sent", "104");
child2.addAttribute("inbox", "101");
AccountItem item2 = new AccountItem(xml2);
// third item, a bit different from the first
XmlElement xml3 = new XmlElement("account");
xml3.addAttribute("name", "my account");
xml3.addAttribute("uid", "0");
XmlElement child3 = xml3.addSubElement("identity");
child3.addAttribute("name", "Kalle Kamel");
child3.addAttribute("attach_signature", "false");
child3 = xml3.addSubElement("popserver");
child3.addAttribute("port", "25");
child3.addAttribute("login_method", "USER");
child3 = xml3.addSubElement("specialfolders");
child3.addAttribute("inbox", "101");
child3.addAttribute("sent", "104");
AccountItem item3 = new AccountItem(xml3);
// should have the same hashcodes...
// test self equality...
assertTrue( [[#variable11370340]], [[#variablef32b7e0]]);
|