added previously undeclared throw clause in the setUp() of these tests,
plus caught previously uncaught exception
This commit is contained in:
parent
9d501e111e
commit
bbcc7bf2ca
4 changed files with 24 additions and 9 deletions
|
@ -74,7 +74,7 @@ static const std::string configFileName = "etc/testStorage.xml";
|
||||||
* Set up the test environment
|
* Set up the test environment
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
TestStorageClientTest :: setUp(void) throw ()
|
TestStorageClientTest :: setUp(void) throw (CPPUNIT_NS::Exception)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Ptr<xmlpp::DomParser>::Ref parser(
|
Ptr<xmlpp::DomParser>::Ref parser(
|
||||||
|
|
|
@ -167,7 +167,7 @@ class TestStorageClientTest : public CPPUNIT_NS::TestFixture
|
||||||
* Set up the environment for the test case.
|
* Set up the environment for the test case.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setUp(void) throw ();
|
setUp(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up the environment after the test case.
|
* Clean up the environment after the test case.
|
||||||
|
|
|
@ -89,7 +89,7 @@ static const std::string authenticationFactoryConfigFileName
|
||||||
* Set up the test environment
|
* Set up the test environment
|
||||||
*----------------------------------------------------------------------------*/
|
*----------------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
WebStorageClientTest :: setUp(void) throw ()
|
WebStorageClientTest :: setUp(void) throw (CPPUNIT_NS::Exception)
|
||||||
{
|
{
|
||||||
Ptr<AuthenticationClientFactory>::Ref acf;
|
Ptr<AuthenticationClientFactory>::Ref acf;
|
||||||
acf = AuthenticationClientFactory::getInstance();
|
acf = AuthenticationClientFactory::getInstance();
|
||||||
|
@ -101,9 +101,15 @@ WebStorageClientTest :: setUp(void) throw ()
|
||||||
|
|
||||||
acf->configure(*root);
|
acf->configure(*root);
|
||||||
} catch (std::invalid_argument &e) {
|
} 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) {
|
} 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();
|
authentication = acf->getAuthenticationClient();
|
||||||
|
@ -116,12 +122,21 @@ WebStorageClientTest :: setUp(void) throw ()
|
||||||
|
|
||||||
wsc.reset(new WebStorageClient());
|
wsc.reset(new WebStorageClient());
|
||||||
wsc->configure(*root);
|
wsc->configure(*root);
|
||||||
wsc->reset();
|
|
||||||
} catch (std::invalid_argument &e) {
|
} 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) {
|
} 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()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ class WebStorageClientTest : public BaseTestMethod
|
||||||
* Set up the environment for the test case.
|
* Set up the environment for the test case.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
setUp(void) throw ();
|
setUp(void) throw (CPPUNIT_NS::Exception);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up the environment after the test case.
|
* Clean up the environment after the test case.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue