Multi-line svn commit, see body.
[shibboleth/cpp-opensaml.git] / samltest / saml2 / core / impl / StatusDetail20Test.h
1 /*\r
2  *  Copyright 2001-2006 Internet2\r
3  * \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 #include "internal.h"\r
18 #include <saml/saml2/core/Protocols.h>\r
19 \r
20 using namespace opensaml::saml2p;\r
21 \r
22 class StatusDetail20Test : public CxxTest::TestSuite, public SAMLObjectBaseTestCase {\r
23 \r
24 public:\r
25     void setUp() {\r
26         singleElementFile = data_path + "saml2/core/impl/StatusDetail.xml";\r
27         childElementsFile  = data_path + "saml2/core/impl/StatusDetailChildElements.xml";    \r
28         SAMLObjectBaseTestCase::setUp();\r
29     }\r
30     \r
31     void tearDown() {\r
32         SAMLObjectBaseTestCase::tearDown();\r
33     }\r
34 \r
35     void testSingleElementUnmarshall() {\r
36         auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));\r
37         StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());\r
38         TS_ASSERT(sd!=NULL);\r
39         TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 0);\r
40     }\r
41 \r
42     //TODO test with some XMLObject child elements from another namespace\r
43     void IGNOREtestChildElementsUnmarshall() {\r
44         auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));\r
45         StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());\r
46         TS_ASSERT(sd!=NULL);\r
47         TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 3);\r
48     }\r
49 \r
50     void testSingleElementMarshall() {\r
51         StatusDetail* sd=StatusDetailBuilder::buildStatusDetail();\r
52         assertEquals(expectedDOM, sd);\r
53     }\r
54 \r
55     //TODO test with some XMLObject child elements from another namespace\r
56     void IGNOREtestChildElementsMarshall() {\r
57         StatusDetail* sd=StatusDetailBuilder::buildStatusDetail();\r
58         assertEquals(expectedChildElementsDOM, sd);\r
59     }\r
60 \r
61 };\r