2 * Copyright 2001-2005 Internet2
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
17 #include <cxxtest/TestSuite.h>
\r
18 #include <cxxtest/GlobalFixture.h>
\r
20 #include <xmltooling/XMLToolingConfig.h>
\r
21 #include <xmltooling/util/ParserPool.h>
\r
23 using namespace xmltooling;
\r
25 ParserPool* validatingPool=NULL;
\r
26 ParserPool* nonvalidatingPool=NULL;
\r
28 class ToolingFixture : public CxxTest::GlobalFixture
\r
32 XMLToolingConfig::getConfig().log_config("DEBUG");
\r
33 if (!XMLToolingConfig::getConfig().init())
\r
35 validatingPool = new ParserPool(true,true);
\r
36 nonvalidatingPool = new ParserPool();
\r
39 bool tearDownWorld() {
\r
40 delete validatingPool;
\r
41 delete nonvalidatingPool;
\r
42 XMLToolingConfig::getConfig().term();
\r
43 #if defined(_MSC_VER ) && defined(XMLTOOLINGTEST_LEAKCHECK)
\r
44 _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
\r
45 _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
\r
46 _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
\r
47 _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
\r
48 _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
\r
49 _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
\r
50 _CrtDumpMemoryLeaks();
\r
54 //bool setUp() { printf( "</test>" ); return true; }
\r
55 //bool tearDown() { printf( "</test>" ); return true; }
\r
58 static ToolingFixture globalFixture;
\r
60 class CatalogTest : public CxxTest::TestSuite
\r
63 void testCatalog(void) {
\r
64 auto_ptr_XMLCh temp("../xmltoolingtest/data/catalog.xml");
\r
65 TS_ASSERT(validatingPool->loadCatalog(temp.get()));
\r