--- /dev/null
+/*\r
+ * Copyright 2001-2005 Internet2\r
+ * \r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+#include "internal.h"\r
+#include <saml/saml1/core/SAMLArtifactType0002.h>\r
+\r
+using namespace opensaml::saml1p;\r
+using namespace opensaml;\r
+using namespace std;\r
+\r
+class SAMLArtifactType0002Test : public CxxTest::TestSuite\r
+{\r
+public:\r
+ string providerIdStr;\r
+\r
+ void setUp() {\r
+ providerIdStr = "https://idp.org/SAML";\r
+ }\r
+ \r
+ void testSAMLArtifactType0002(void) {\r
+ auto_ptr<SAMLArtifactType0002> artifact(new SAMLArtifactType0002(providerIdStr));\r
+ auto_ptr<SAMLArtifact> tempArtifact(SAMLArtifact::parse(artifact->encode().c_str()));\r
+ \r
+ TS_ASSERT_SAME_DATA(artifact->getSource().c_str(),tempArtifact->getSource().c_str(),artifact->getSource().length());\r
+ TS_ASSERT_EQUALS(artifact->getMessageHandle(),tempArtifact->getMessageHandle());\r
+\r
+ TS_ASSERT_THROWS(auto_ptr<SAMLArtifact> bogus1(new SAMLArtifactType0002(providerIdStr, artifact->getMessageHandle() + artifact->getMessageHandle())), ArtifactException);\r
+ }\r
+};\r