Update of /cvsroot/objecthandler/log4cxx-0.9.7/tests/src/defaultinit
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25784/tests/src/defaultinit
Added Files:
Makefile.am testcase1.cpp testcase2.cpp testcase3.cpp
testcase4.cpp
Log Message:
--- NEW FILE: testcase4.cpp ---
/*
* Copyright 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <log4cxx/config.h>
#ifdef HAVE_XML
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
using namespace log4cxx;
class TestCase4 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestCase4);
CPPUNIT_TEST(combinedTest);
CPPUNIT_TEST_SUITE_END();
public:
void setUp()
{
}
void tearDown()
{
LogManager::shutdown();
}
void combinedTest()
{
LoggerPtr root = Logger::getRootLogger();
bool rootIsConfigured = !root->getAllAppenders().empty();
CPPUNIT_ASSERT(rootIsConfigured);
AppenderList list = root->getAllAppenders();
AppenderPtr appender = list.front();
CPPUNIT_ASSERT(appender->getName() == _T("D1"));
CPPUNIT_ASSERT(list.size() == 1);
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestCase4);
#endif //HAVE_XML
--- NEW FILE: testcase1.cpp ---
/*
* Copyright 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
using namespace log4cxx;
class TestCase1 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestCase1);
CPPUNIT_TEST(noneTest);
CPPUNIT_TEST_SUITE_END();
public:
void setUp()
{
}
void tearDown()
{
LogManager::shutdown();
}
void noneTest()
{
LoggerPtr root = Logger::getRootLogger();
bool rootIsConfigured = !root->getAllAppenders().empty();
CPPUNIT_ASSERT(!rootIsConfigured);
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestCase1);
--- NEW FILE: testcase3.cpp ---
/*
* Copyright 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
using namespace log4cxx;
class TestCase3 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestCase3);
CPPUNIT_TEST(testProperties);
CPPUNIT_TEST_SUITE_END();
public:
void setUp()
{
}
void tearDown()
{
LogManager::shutdown();
}
void testProperties()
{
LoggerPtr root = Logger::getRootLogger();
bool rootIsConfigured = !root->getAllAppenders().empty();
CPPUNIT_ASSERT(rootIsConfigured);
AppenderList list = root->getAllAppenders();
AppenderPtr appender = list.front();
CPPUNIT_ASSERT(appender->getName() == _T("D3"));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestCase3);
--- NEW FILE: Makefile.am ---
EXTRA_DIST = *.cpp
if TESTS
noinst_LIBRARIES = libdefaultinit.a
INCLUDES = -I$(top_srcdir)/include
libdefaultinit_a_SOURCES = \
testcase1.cpp\
testcase2.cpp\
testcase3.cpp\
testcase4.cpp
check: libdefaultinit.a
endif
--- NEW FILE: testcase2.cpp ---
/*
* Copyright 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <log4cxx/config.h>
#ifdef HAVE_XML
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <log4cxx/logmanager.h>
#include <log4cxx/logger.h>
using namespace log4cxx;
class TestCase2 : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(TestCase2);
CPPUNIT_TEST(xmlTest);
CPPUNIT_TEST_SUITE_END();
public:
void setUp()
{
}
void tearDown()
{
LogManager::shutdown();
}
void xmlTest()
{
LoggerPtr root = Logger::getRootLogger();
bool rootIsConfigured = !root->getAllAppenders().empty();
CPPUNIT_ASSERT(rootIsConfigured);
AppenderList list = root->getAllAppenders();
AppenderPtr appender = list.front();
CPPUNIT_ASSERT(appender->getName() == _T("D1"));
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestCase2);
#endif //HAVE_XML
|