Replace custom code with CredentialResolver.
[shibboleth/cpp-opensaml.git] / samltest / samltest.h
1 /*\r
2  *  Copyright 2001-2005 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 \r
19 #include <fstream>\r
20 #include <cxxtest/GlobalFixture.h>\r
21 \r
22 //#define SAML_LEAKCHECK\r
23 \r
24 std::string data_path = "../samltest/data/";\r
25 \r
26 class SAMLFixture : public CxxTest::GlobalFixture\r
27 {\r
28 public:\r
29     bool setUpWorld() {\r
30         XMLToolingConfig::getConfig().log_config();\r
31         if (!SAMLConfig::getConfig().init())\r
32             return false;\r
33         if (getenv("SAMLTEST_DATA"))\r
34             data_path=std::string(getenv("SAMLTEST_DATA")) + "/";\r
35         //std::string catpath=data_path + "catalog.xml";\r
36         //auto_ptr_XMLCh temp(catpath.c_str());\r
37         //return XMLToolingConfig::getConfig().getValidatingParser().loadCatalog(temp.get());\r
38         return true;\r
39     }\r
40     bool tearDownWorld() {\r
41         SAMLConfig::getConfig().term();\r
42 #if defined(_MSC_VER ) && defined(SAML_LEAKCHECK)\r
43        _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );\r
44        _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );\r
45        _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );\r
46        _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );\r
47        _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );\r
48        _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );\r
49        _CrtDumpMemoryLeaks();\r
50 #endif\r
51         return true;\r
52     }\r
53     //bool setUp() { printf( "</test>" ); return true; }\r
54     //bool tearDown() { printf( "</test>" ); return true; }\r
55 };\r
56 \r
57 static SAMLFixture globalFixture;\r
58 \r
59 class GlobalTest : public CxxTest::TestSuite\r
60 {\r
61 public:\r
62     void testGlobal() {\r
63     }\r
64 };\r