[Cppunit-devel] distributed environment
Brought to you by:
blep
From: Michel A. <Arm...@si...> - 2002-06-06 07:41:33
|
Hi all. Motivation: I am planning to use CppUnit in a typical client/server scenario, where some of the TestCases have to be performed in Backend (BE). Since the results etc. have to be displayed in the Client/Frontend (FE) of course, I have to transfer data from BE to FE. Because I want to take advantage of the already existing CppUnit-MFC-dialog, I thought it would be pretty nice if we could add a kind of serialization support to at least some of the CppUnit classes. Approach/Solution: In fact, it would be enough if all the classes would be "serializable" that are used for notifying the TestResult. A TestResult object (living in BE) in turn would notify a special observer which would then transmit these information to FE where it can be distributed to the "ordinary" TestListener. Using this approach it should be possible to have a BE/FE separation which is completely transparent to the rest of the system (e.g. progress bar in the dialog etc.). And because of this transparence it would still be possible to use any kind of TestListener in FE, which I think is very important with respect to exensibility. Implementation: Since the exact format of "transferable" objects is quite dependent on the environment, I would suggest to use an iostream based approach. Being a Java-Programmer, the following idea comes to my mind: class Exception { Exception(istream& is); // ... public: void writeObject(ostream& os); void readObject(istream& is); }; Exception::Exception(istream& is) { readObject(is); } Exception::writeObject(ostream& os) { os << state1 << " " << state2; } Exception::readObject(istream& is) { is >> state1 >> state2; } Suggestions: What are you thinking about this topic? Do you know a more C++ like way to do the serialization? Or some completely different approach? Regards Armin (bored) Michel |