added previously undeclared throw clause in the setUp() of these tests,

plus caught previously uncaught exception
This commit is contained in:
fgerlits 2006-02-01 13:12:36 +00:00
parent 9d501e111e
commit bbcc7bf2ca
4 changed files with 24 additions and 9 deletions

View file

@ -74,7 +74,7 @@ static const std::string configFileName = "etc/testStorage.xml";
* Set up the test environment
*----------------------------------------------------------------------------*/
void
TestStorageClientTest :: setUp(void) throw ()
TestStorageClientTest :: setUp(void) throw (CPPUNIT_NS::Exception)
{
try {
Ptr<xmlpp::DomParser>::Ref parser(

View file

@ -167,7 +167,7 @@ class TestStorageClientTest : public CPPUNIT_NS::TestFixture
* Set up the environment for the test case.
*/
void
setUp(void) throw ();
setUp(void) throw (CPPUNIT_NS::Exception);
/**
* Clean up the environment after the test case.

View file

@ -89,7 +89,7 @@ static const std::string authenticationFactoryConfigFileName
* Set up the test environment
*----------------------------------------------------------------------------*/
void
WebStorageClientTest :: setUp(void) throw ()
WebStorageClientTest :: setUp(void) throw (CPPUNIT_NS::Exception)
{
Ptr<AuthenticationClientFactory>::Ref acf;
acf = AuthenticationClientFactory::getInstance();
@ -101,9 +101,15 @@ WebStorageClientTest :: setUp(void) throw ()
acf->configure(*root);
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in authentication configuration file");
std::string eMsg = "semantic error in "
"authentication configuration file:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
} catch (xmlpp::exception &e) {
CPPUNIT_FAIL("error parsing authentication configuration file");
std::string eMsg = "error parsing "
"authentication configuration file:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
}
authentication = acf->getAuthenticationClient();
@ -116,12 +122,21 @@ WebStorageClientTest :: setUp(void) throw ()
wsc.reset(new WebStorageClient());
wsc->configure(*root);
wsc->reset();
} catch (std::invalid_argument &e) {
CPPUNIT_FAIL("semantic error in storage configuration file");
std::string eMsg = "semantic error in "
"authentication configuration file:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
} catch (xmlpp::exception &e) {
CPPUNIT_FAIL("error parsing storage configuration file");
std::string eMsg = "error parsing "
"authentication configuration file:\n";
eMsg += e.what();
CPPUNIT_FAIL(eMsg);
}
CPPUNIT_ASSERT_NO_THROW(
wsc->reset()
);
}

View file

@ -173,7 +173,7 @@ class WebStorageClientTest : public BaseTestMethod
* Set up the environment for the test case.
*/
void
setUp(void) throw ();
setUp(void) throw (CPPUNIT_NS::Exception);
/**
* Clean up the environment after the test case.