diff --git a/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.cpp b/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.cpp index c4e308ca04..12308ea537 100644 --- a/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.cpp +++ b/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.cpp @@ -1,131 +1,120 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ //Poco headers #include "Poco/Zip/Decompress.h" #include "Poco/Path.h" #include "Poco/File.h" #include "mitkNavigationToolStorageDeserializer.h" #include #include #include "mitkNavigationToolReader.h" //POCO #include #include "mitkIGTException.h" #include "mitkIGTIOException.h" mitk::NavigationToolStorageDeserializer::NavigationToolStorageDeserializer(mitk::DataStorage::Pointer dataStorage) { m_DataStorage = dataStorage; //create temp directory for this reader m_tempDirectory = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory() + Poco::Path::separator() + "tempNavigationToolDeserializer"; Poco::File myFile(m_tempDirectory); myFile.createDirectory(); } mitk::NavigationToolStorageDeserializer::~NavigationToolStorageDeserializer() { //remove temp directory Poco::File myFile(m_tempDirectory); try { if (myFile.exists()) myFile.remove(); } catch(...) { MITK_ERROR << "Can't remove temp directory " << m_tempDirectory << "!"; } } mitk::NavigationToolStorage::Pointer mitk::NavigationToolStorageDeserializer::Deserialize(std::string filename) { bool success = false; //decomress zip file into temporary directory - success = decomressFiles(filename,m_tempDirectory); - - //currently returns an empty storage in case of an error. TODO when exception handling is availiable in MITK: Throw an exception? - if (!success) - { - //Exception if file cannot be decompressed - mitkThrowException(mitk::IGTException)<<"File has not been decopreseed"; - return mitk::NavigationToolStorage::New(); - } + decomressFiles(filename,m_tempDirectory); //now read all files and convert them to navigation tools mitk::NavigationToolStorage::Pointer returnValue = mitk::NavigationToolStorage::New(m_DataStorage); bool cont = true; int i; for (i=0; cont==true; i++) { std::string fileName = m_tempDirectory + Poco::Path::separator() + "NavigationTool" + convertIntToString(i) + ".tool"; mitk::NavigationToolReader::Pointer myReader = mitk::NavigationToolReader::New(); mitk::NavigationTool::Pointer readTool = myReader->DoRead(fileName); if (readTool.IsNull()) cont = false; else returnValue->AddTool(readTool); - //delete file + //delete file std::remove(fileName.c_str()); } if(i==1) - { - //throw an exception here in case of not finding the tool - mitkThrowException(mitk::IGTException)<<"Error: did not find any tool. \n Is this a tool storage file?"; + { + //throw an exception here in case of not finding any tool m_ErrorMessage = "Error: did not find any tool. \n Is this a tool storage file?"; + mitkThrowException(mitk::IGTException)<<"Error: did not find any tool. \n Is this a tool storage file?"; } return returnValue; } std::string mitk::NavigationToolStorageDeserializer::convertIntToString(int i) { std::string s; std::stringstream out; out << i; s = out.str(); return s; } -bool mitk::NavigationToolStorageDeserializer::decomressFiles(std::string filename,std::string path) +void mitk::NavigationToolStorageDeserializer::decomressFiles(std::string filename,std::string path) { std::ifstream file( filename.c_str(), std::ios::binary ); if (!file.good()) - { - //throw an exception - mitkThrowException(mitk::IGTException)<<"Cannot open"+filename+" for reading"; + { m_ErrorMessage = "Cannot open '" + filename + "' for reading"; - return false; + mitkThrowException(mitk::IGTException)<<"Cannot open"+filename+" for reading"; } + try - { - Poco::Zip::Decompress unzipper( file, Poco::Path( path ) ); + { + Poco::Zip::Decompress unzipper( file, Poco::Path( path ) ); unzipper.decompressAllFiles(); file.close(); } catch(Poco::IllegalStateException e) //temporary solution: replace this by defined exception handling later! - { - //std::String message<<"Error: wrong file format! (please only load tool storage files)"; - m_ErrorMessage = "Error: wrong file format! \n (please only load tool storage files)"; - MITK_ERROR << "Error: wrong file format! (please only load tool storage files)"; - return false; + { + m_ErrorMessage = "Error: wrong file format! \n (please only load tool storage files)"; + MITK_ERROR << m_ErrorMessage; + mitkThrowException(mitk::IGTException) << m_ErrorMessage; } - return true; } diff --git a/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.h b/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.h index f768d8d8f3..e7411c60ed 100644 --- a/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.h +++ b/Modules/IGT/IGTToolManagement/mitkNavigationToolStorageDeserializer.h @@ -1,71 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef NAVIGATIONTOOLSTORAGEDESERIALIZER_H_INCLUDED #define NAVIGATIONTOOLSTORAGEDESERIALIZER_H_INCLUDED //itk headers #include //mitk headers #include #include #include "mitkNavigationToolStorage.h" #include namespace mitk { /**Documentation * \brief This class offers methods to load an object of the class NavigationToolStorage * from the harddisc. * * \ingroup IGT */ class MitkIGT_EXPORT NavigationToolStorageDeserializer : public itk::Object { public: mitkClassMacro(NavigationToolStorageDeserializer,itk::Object); mitkNewMacro1Param(Self,mitk::DataStorage::Pointer); /** * @brief Loads a collection of navigation tools represented by a mitk::NavigationToolStorage * from a file. * @return Returns the storage which was loaded or an empty storage if there was an error in the loading process. - * @throws Throws an Exception if File has not been decopreseed - * @throws Throws an Exception if no tool is found + * @throw mitk::IGTException Throws an Exception if the file cannot be decopressed. + * @throw mitk::IGTException Throws an Exception if no tool was found inside the storage. */ mitk::NavigationToolStorage::Pointer Deserialize(std::string filename); itkGetMacro(ErrorMessage,std::string); protected: NavigationToolStorageDeserializer(mitk::DataStorage::Pointer dataStorage); ~NavigationToolStorageDeserializer(); std::string m_ErrorMessage; mitk::DataStorage::Pointer m_DataStorage; std::string m_tempDirectory; std::string convertIntToString(int i); - //@throws Throws an Exception if particular file cannot be opened for reading - - bool decomressFiles(std::string file,std::string path); + /** + * @throws Throws an Exception if particular file cannot be opened for reading + */ + void decomressFiles(std::string file,std::string path); }; } // namespace mitk #endif //NAVIGATIONTOOLSTORAGEDESERIALIZER diff --git a/Modules/IGT/Testing/mitkNavigationToolStorageSerializerAndDeserializerTest.cpp b/Modules/IGT/Testing/mitkNavigationToolStorageSerializerAndDeserializerTest.cpp index 251e57d3a9..10b0b7c985 100644 --- a/Modules/IGT/Testing/mitkNavigationToolStorageSerializerAndDeserializerTest.cpp +++ b/Modules/IGT/Testing/mitkNavigationToolStorageSerializerAndDeserializerTest.cpp @@ -1,359 +1,349 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ //Poco headers #include "Poco/Path.h" #include #include #include #include #include #include #include #include "mitkNavigationToolStorage.h" #include "mitkIGTException.h" #include "mitkIGTIOException.h" class NavigationToolStorageSerializerAndDeserializerTestClass { public: static void TestInstantiationSerializer() { // let's create objects of our classes mitk::NavigationToolStorageSerializer::Pointer testSerializer = mitk::NavigationToolStorageSerializer::New(); MITK_TEST_CONDITION_REQUIRED(testSerializer.IsNotNull(),"Testing instantiation of NavigationToolStorageSerializer"); } static void TestInstantiationDeserializer() { mitk::DataStorage::Pointer tempStorage = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); //needed for deserializer! mitk::NavigationToolStorageDeserializer::Pointer testDeserializer = mitk::NavigationToolStorageDeserializer::New(tempStorage); MITK_TEST_CONDITION_REQUIRED(testDeserializer.IsNotNull(),"Testing instantiation of NavigationToolStorageDeserializer") } static void TestWriteSimpleToolStorage() { //create Tool Storage mitk::NavigationToolStorage::Pointer myStorage = mitk::NavigationToolStorage::New(); //first tool mitk::NavigationTool::Pointer myTool1 = mitk::NavigationTool::New(); myTool1->SetIdentifier("001"); myStorage->AddTool(myTool1); //second tool mitk::NavigationTool::Pointer myTool2 = mitk::NavigationTool::New(); myTool2->SetIdentifier("002"); myStorage->AddTool(myTool2); //third tool mitk::NavigationTool::Pointer myTool3 = mitk::NavigationTool::New(); myTool3->SetIdentifier("003"); myStorage->AddTool(myTool3); //create Serializer mitk::NavigationToolStorageSerializer::Pointer mySerializer = mitk::NavigationToolStorageSerializer::New(); //create filename std::string filename = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage.storage"; //test serialization bool success = mySerializer->Serialize(filename,myStorage); MITK_TEST_CONDITION_REQUIRED(success,"Testing serialization of simple tool storage"); } static void TestReadSimpleToolStorage() { mitk::DataStorage::Pointer tempStorage = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); //needed for deserializer! mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(tempStorage); mitk::NavigationToolStorage::Pointer readStorage = myDeserializer->Deserialize(mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage.storage"); MITK_TEST_CONDITION_REQUIRED(readStorage.IsNotNull(),"Testing deserialization of simple tool storage"); MITK_TEST_CONDITION_REQUIRED(readStorage->GetToolCount()==3," ..Testing number of tools in storage"); //TODO: why is the order of tools changed is save/load process?? bool foundtool1 = false; bool foundtool2 = false; bool foundtool3 = false; for(int i=0; i<3; i++) { if ((readStorage->GetTool(i)->GetIdentifier()=="001")) foundtool1 = true; else if ((readStorage->GetTool(i)->GetIdentifier()=="002")) foundtool2 = true; else if ((readStorage->GetTool(i)->GetIdentifier()=="003")) foundtool3 = true; } MITK_TEST_CONDITION_REQUIRED(foundtool1&&foundtool2&&foundtool3," ..Testing if identifiers of tools where saved / loaded successfully"); } static void CleanUp() { try { std::remove((mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage.storage").c_str()); std::remove((mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage2.storage").c_str()); } catch(...) { MITK_INFO << "Warning: Error occured when deleting test file!"; } } static void TestWriteComplexToolStorage() { //create first tool mitk::Surface::Pointer testSurface; std::string toolFileName = mitk::StandardFileLocations::GetInstance()->FindFile("ClaronTool", "Modules/IGT/Testing/Data"); MITK_TEST_CONDITION(toolFileName.empty() == false, "Check if tool calibration of claron tool file exists"); mitk::NavigationTool::Pointer myNavigationTool = mitk::NavigationTool::New(); myNavigationTool->SetCalibrationFile(toolFileName); mitk::DataNode::Pointer myNode = mitk::DataNode::New(); myNode->SetName("ClaronTool"); //load an stl File mitk::STLFileReader::Pointer stlReader = mitk::STLFileReader::New(); try { stlReader->SetFileName( mitk::StandardFileLocations::GetInstance()->FindFile("ClaronTool.stl", "Testing/Data/").c_str() ); stlReader->Update(); } catch (...) { MITK_TEST_FAILED_MSG(<<"Cannot read stl file."); } if ( stlReader->GetOutput() == NULL ) { MITK_TEST_FAILED_MSG(<<"Cannot read stl file."); } else { testSurface = stlReader->GetOutput(); myNode->SetData(testSurface); } myNavigationTool->SetDataNode(myNode); myNavigationTool->SetIdentifier("ClaronTool#1"); myNavigationTool->SetSerialNumber("0815"); myNavigationTool->SetTrackingDeviceType(mitk::ClaronMicron); myNavigationTool->SetType(mitk::NavigationTool::Fiducial); //create second tool mitk::NavigationTool::Pointer myNavigationTool2 = mitk::NavigationTool::New(); mitk::Surface::Pointer testSurface2; mitk::DataNode::Pointer myNode2 = mitk::DataNode::New(); myNode2->SetName("AuroraTool"); //load an stl File try { stlReader->SetFileName( mitk::StandardFileLocations::GetInstance()->FindFile("EMTool.stl", "Testing/Data/").c_str() ); stlReader->Update(); } catch (...) { MITK_TEST_FAILED_MSG(<<"Cannot read stl file."); } if ( stlReader->GetOutput() == NULL ) { MITK_TEST_FAILED_MSG(<<"Cannot read stl file."); } else { testSurface2 = stlReader->GetOutput(); myNode2->SetData(testSurface2); } myNavigationTool2->SetDataNode(myNode2); myNavigationTool2->SetIdentifier("AuroraTool#1"); myNavigationTool2->SetSerialNumber("0816"); myNavigationTool2->SetTrackingDeviceType(mitk::NDIAurora); myNavigationTool2->SetType(mitk::NavigationTool::Instrument); //create navigation tool storage mitk::NavigationToolStorage::Pointer myStorage = mitk::NavigationToolStorage::New(); myStorage->AddTool(myNavigationTool); myStorage->AddTool(myNavigationTool2); //create Serializer mitk::NavigationToolStorageSerializer::Pointer mySerializer = mitk::NavigationToolStorageSerializer::New(); //create filename std::string filename = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage2.storage"; //test serialization bool success = mySerializer->Serialize(filename,myStorage); MITK_TEST_CONDITION_REQUIRED(success,"Testing serialization of complex tool storage"); } static void TestReadComplexToolStorage() { mitk::DataStorage::Pointer tempStorage = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); //needed for deserializer! mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(tempStorage); mitk::NavigationToolStorage::Pointer readStorage = myDeserializer->Deserialize(mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage2.storage"); MITK_TEST_CONDITION_REQUIRED(readStorage.IsNotNull(),"Testing deserialization of complex tool storage"); MITK_TEST_CONDITION_REQUIRED(readStorage->GetToolCount()==2," ..Testing number of tools in storage"); } static void TestReadInvalidStorage() { mitk::DataStorage::Pointer tempStorage = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); //needed for deserializer! mitk::NavigationToolStorageDeserializer::Pointer myDeserializer = mitk::NavigationToolStorageDeserializer::New(tempStorage); mitk::NavigationToolStorage::Pointer readStorage = myDeserializer->Deserialize("noStorage.tfl"); MITK_TEST_CONDITION_REQUIRED(readStorage->isEmpty(),"Testing deserialization of invalid data storage."); MITK_TEST_CONDITION_REQUIRED(myDeserializer->GetErrorMessage() == "Cannot open 'noStorage.tfl' for reading", "Checking Error Message"); } static void TestWriteStorageToInvalidFile() { //create Tool Storage mitk::NavigationToolStorage::Pointer myStorage = mitk::NavigationToolStorage::New(); //first tool mitk::NavigationTool::Pointer myTool1 = mitk::NavigationTool::New(); myTool1->SetIdentifier("001"); myStorage->AddTool(myTool1); //second tool mitk::NavigationTool::Pointer myTool2 = mitk::NavigationTool::New(); myTool2->SetIdentifier("002"); myStorage->AddTool(myTool2); //third tool mitk::NavigationTool::Pointer myTool3 = mitk::NavigationTool::New(); myTool3->SetIdentifier("003"); myStorage->AddTool(myTool3); //create Serializer mitk::NavigationToolStorageSerializer::Pointer mySerializer = mitk::NavigationToolStorageSerializer::New(); //create filename #ifdef WIN32 std::string filename = "C:\342INVALIDFILE<>.storage"; //invalid filename for windows #else std::string filename = "/dsfdsf:$§$342INVALIDFILE.storage"; //invalid filename for linux #endif - //test serialization - bool success = true; - success = mySerializer->Serialize(filename,myStorage); - - MITK_TEST_CONDITION_REQUIRED(!success,"Testing serialization into invalid file."); + bool exceptionThrown = false; + try + { + mySerializer->Serialize(filename,myStorage); + } + catch(mitk::IGTException e) + { + exceptionThrown = true; + } + MITK_TEST_CONDITION_REQUIRED(exceptionThrown,"Testing if an exception is thrown if an invalid file is used."); } - - - //new Test for Serializer could not open a zip file for writing in Serializer - //we input no file inside the filename, + //new tests for exception throwing of NavigationToolStorageSerializer static void TestSerializerForExceptions() { mitk::NavigationToolStorageSerializer::Pointer testSerializer = mitk::NavigationToolStorageSerializer::New(); mitk::NavigationToolStorage::Pointer myStorage = mitk::NavigationToolStorage::New(); - //no file name has been set, so making file to be not good + + //create an invalid filename std::string filename = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+""; + + //now try to serialize an check if an exception is thrown bool ExceptionThrown = false; try - { - testSerializer->Serialize(filename,myStorage); - } + { + testSerializer->Serialize(filename,myStorage); + } catch(mitk::IGTException) - { - ExceptionThrown = true; - MITK_TEST_OUTPUT(<<" Tested exception if cannot open a zip file for writing in Serializer. Application should not crash."); - } - MITK_TEST_CONDITION_REQUIRED(ExceptionThrown, "Testing Serializer method if exception (could not open a zip file for writing) was thrown."); + { + ExceptionThrown = true; + } + MITK_TEST_CONDITION_REQUIRED(ExceptionThrown, "Testing serializer with invalid filename."); } - - - - //new Test for Deserializer if File has not been decompreseed - static void TestDiserializerForExceptions() + //new tests for exception throwing of NavigationToolStorageDeserializer + static void TestDeserializerForExceptions() { - //no file has been inputed, so there is no file to decompress + + + // Desearializing file with invalid name mitk::DataStorage::Pointer tempStorage = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); mitk::NavigationToolStorageDeserializer::Pointer testDeseralizer= mitk::NavigationToolStorageDeserializer::New(tempStorage); - //mitk::NavigationToolStorage::Pointer myStorage = mitk::NavigationToolStorage::New(); - // std::string filename = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage.storage"; bool ExceptionThrown1 = false; try - { - // Desearialiying file with invalid name - mitk::NavigationToolStorage::Pointer readStorage = testDeseralizer->Deserialize("InvalidName"); - } + { + mitk::NavigationToolStorage::Pointer readStorage = testDeseralizer->Deserialize("InvalidName"); + } catch(mitk::IGTException) - { - ExceptionThrown1 = true; - MITK_TEST_OUTPUT(<<" Tested exception if File has not been decopreseed in Deserializer. Application should not crash."); - } - MITK_TEST_CONDITION_REQUIRED(ExceptionThrown1, "Testing Serializer method if exception (File has not been decopreseed) was thrown."); - - + { + ExceptionThrown1 = true; + } + MITK_TEST_CONDITION_REQUIRED(ExceptionThrown1, "Testing deserializer with invalid filename."); - //Testing exception if no tool is found in tool storage file - mitk::DataStorage::Pointer tempStorage2 = dynamic_cast(mitk::StandaloneDataStorage::New().GetPointer()); - mitk::NavigationToolStorageDeserializer::Pointer testDeseralizer2= mitk::NavigationToolStorageDeserializer::New(tempStorage); - mitk::NavigationToolStorage::Pointer myStorage2 = mitk::NavigationToolStorage::New(); - // std::string filename2 = mitk::StandardFileLocations::GetInstance()->GetOptionDirectory()+Poco::Path::separator()+".."+Poco::Path::separator()+"TestStorage.storage"; bool ExceptionThrown2 = false; - // need to create a file with no tools inside + + // Deserializing of empty zip file + mitk::NavigationToolStorageDeserializer::Pointer testDeseralizer2= mitk::NavigationToolStorageDeserializer::New(tempStorage); try - { - std::string filename = mitk::StandardFileLocations::GetInstance()->FindFile("EmptyZipFile.zip", "Modules/IGT/Testing/Data"); - mitk::NavigationToolStorage::Pointer readStorage = testDeseralizer2->Deserialize(filename); - } + { + std::string filename = mitk::StandardFileLocations::GetInstance()->FindFile("EmptyZipFile.zip", "Modules/IGT/Testing/Data"); + mitk::NavigationToolStorage::Pointer readStorage = testDeseralizer2->Deserialize(filename); + } catch(mitk::IGTException) - { - ExceptionThrown2 = true; - MITK_TEST_OUTPUT(<<" Tested exception if no tool os found in Deserializer. Application should not crash."); - } - MITK_TEST_CONDITION_REQUIRED(ExceptionThrown2, "Testing Serializer method if exception (no tool is found) was thrown."); + { + ExceptionThrown2 = true; + } + MITK_TEST_CONDITION_REQUIRED(ExceptionThrown2, "Testing deserializer method with empty zip file."); } }; /** This function is testing the TrackingVolume class. */ int mitkNavigationToolStorageSerializerAndDeserializerTest(int /* argc */, char* /*argv*/[]) { MITK_TEST_BEGIN("NavigationToolStorageSerializerAndDeserializer"); - - - //new tests for exceptions - NavigationToolStorageSerializerAndDeserializerTestClass::TestSerializerForExceptions(); - NavigationToolStorageSerializerAndDeserializerTestClass::TestDiserializerForExceptions(); - - ///** TESTS DEACTIVATED BECAUSE OF DART-CLIENT PROBLEMS + NavigationToolStorageSerializerAndDeserializerTestClass::TestInstantiationSerializer(); NavigationToolStorageSerializerAndDeserializerTestClass::TestInstantiationDeserializer(); NavigationToolStorageSerializerAndDeserializerTestClass::TestWriteSimpleToolStorage(); NavigationToolStorageSerializerAndDeserializerTestClass::TestReadSimpleToolStorage(); NavigationToolStorageSerializerAndDeserializerTestClass::TestWriteComplexToolStorage(); NavigationToolStorageSerializerAndDeserializerTestClass::TestReadComplexToolStorage(); - //TestReadInvalidStorage() fails - // NavigationToolStorageSerializerAndDeserializerTestClass::TestReadInvalidStorage(); NavigationToolStorageSerializerAndDeserializerTestClass::TestWriteStorageToInvalidFile(); - - + + //TestReadInvalidStorage() fails + // NavigationToolStorageSerializerAndDeserializerTestClass::TestReadInvalidStorage(); + + NavigationToolStorageSerializerAndDeserializerTestClass::TestSerializerForExceptions(); + NavigationToolStorageSerializerAndDeserializerTestClass::TestDeserializerForExceptions(); + NavigationToolStorageSerializerAndDeserializerTestClass::CleanUp(); MITK_TEST_END(); }