\r
void setUp() {\r
XMLObjectBuilder::registerBuilder(m_qname, new SimpleXMLObjectBuilder());\r
- Marshaller::registerMarshaller(m_qname, new SimpleXMLObjectMarshaller());\r
- Unmarshaller::registerUnmarshaller(m_qname, new SimpleXMLObjectUnmarshaller());\r
}\r
\r
void tearDown() {\r
XMLObjectBuilder::deregisterBuilder(m_qname);\r
- Marshaller::deregisterMarshaller(m_qname);\r
- Unmarshaller::deregisterUnmarshaller(m_qname);\r
}\r
\r
void testMarshallingWithAttributes() {\r
TS_ASSERT(sxObject.get()!=NULL);\r
sxObject->setId(expected.get());\r
\r
- DOMElement* rootElement = Marshaller::getMarshaller(sxObject.get())->marshall(sxObject.get());\r
+ DOMElement* rootElement = sxObject->marshall();\r
\r
string path=data_path + "SimpleXMLObjectWithAttribute.xml";\r
ifstream fs(path.c_str());\r
TS_ASSERT(sxObject.get()!=NULL);\r
sxObject->setValue(expected.get());\r
\r
- DOMElement* rootElement = Marshaller::getMarshaller(sxObject.get())->marshall(sxObject.get());\r
+ DOMElement* rootElement = sxObject->marshall();\r
\r
string path=data_path + "SimpleXMLObjectWithContent.xml";\r
ifstream fs(path.c_str());\r
void testMarshallingWithChildElements() {\r
TS_TRACE("testMarshallingWithChildElements");\r
\r
- const XMLObjectBuilder* b=XMLObjectBuilder::getBuilder(m_qname);\r
+ const SimpleXMLObjectBuilder* b=dynamic_cast<const SimpleXMLObjectBuilder*>(XMLObjectBuilder::getBuilder(m_qname));\r
TS_ASSERT(b!=NULL);\r
\r
- auto_ptr<SimpleXMLObject> sxObject(dynamic_cast<SimpleXMLObject*>(b->buildObject()));\r
+ auto_ptr<SimpleXMLObject> sxObject(b->buildObject());\r
TS_ASSERT(sxObject.get()!=NULL);\r
VectorOf(SimpleXMLObject) kids=sxObject->getSimpleXMLObjects();\r
- kids.push_back(dynamic_cast<SimpleXMLObject*>(b->buildObject()));\r
- kids.push_back(dynamic_cast<SimpleXMLObject*>(b->buildObject()));\r
- kids.push_back(dynamic_cast<SimpleXMLObject*>(b->buildObject()));\r
+ kids.push_back(b->buildObject());\r
+ kids.push_back(b->buildObject());\r
+ kids.push_back(b->buildObject());\r
\r
// Test some collection stuff\r
auto_ptr_XMLCh foo("Foo");\r
kids.erase(kids.begin()+1);\r
TS_ASSERT_SAME_DATA(kids.back()->getValue(), bar.get(), XMLString::stringLen(bar.get()));\r
\r
- DOMElement* rootElement = Marshaller::getMarshaller(sxObject.get())->marshall(sxObject.get());\r
+ DOMElement* rootElement = sxObject->marshall();\r
\r
string path=data_path + "SimpleXMLObjectWithChildren.xml";\r
ifstream fs(path.c_str());\r