00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifdef ENABLE_INTEGRATION_TESTS
00037
00038 #include "client/DMTClientConfig.h"
00039 #include "client/SyncClient.h"
00040 #include "base/messages.h"
00041 #include "base/Log.h"
00042 #include "spds/DefaultConfigFactory.h"
00043 #include "base/util/StringBuffer.h"
00044 #include "base/globalsdef.h"
00045
00046 #include "integration/TestSyncSource.h"
00047 #include "common/http/TransportAgentReplacement.h"
00048
00049 BEGIN_NAMESPACE
00050
00057 class SyncManagerTest : public CppUnit::TestFixture {
00058
00059
00060 public:
00061
00062 SyncManagerTest() {}
00063
00064 void runAllTests() {
00065 testServerError506();
00066 testLargeObject2();
00067 }
00068
00080 void testServerError506();
00081
00087 void testLargeObject2();
00088 };
00089
00090
00091
00098 class TransportAgentTestError506 : public TransportAgentReplacement {
00099
00100 protected:
00101
00106 void beforeSendingMessage(StringBuffer& msgToSend);
00107
00113 void afterReceivingResponse(StringBuffer& msgReceived);
00114
00115 public:
00116
00117 TransportAgentTestError506(URL& url,
00118 Proxy& proxy,
00119 unsigned int responseTimeout = DEFAULT_MAX_TIMEOUT,
00120 unsigned int maxmsgsize = DEFAULT_MAX_MSG_SIZE)
00121 : TransportAgentReplacement(url, proxy, responseTimeout, maxmsgsize) {}
00122
00123 };
00124
00125
00130 class TransportAgentTestLargeObject2 : public TransportAgentReplacement {
00131
00132 protected:
00133
00134
00135 void beforeSendingMessage (StringBuffer& msgToSend) { return; }
00136 void afterReceivingResponse(StringBuffer& msgReceived) { return; }
00137
00138 public:
00139
00140 TransportAgentTestLargeObject2(URL& url,
00141 Proxy& proxy,
00142 unsigned int responseTimeout = DEFAULT_MAX_TIMEOUT,
00143 unsigned int maxmsgsize = DEFAULT_MAX_MSG_SIZE)
00144 : TransportAgentReplacement(url, proxy, responseTimeout, maxmsgsize) {}
00145
00151 char* sendMessage(const char* msg);
00152 };
00153
00154
00159 class SyncSourceTestLargeObject2 : public TestSyncSource {
00160
00161 public:
00162
00163 SyncSourceTestLargeObject2(const WCHAR* name, SyncSourceConfig *sc, int numItems = 10) : TestSyncSource(name, sc, numItems) {}
00164
00166 int updateItem(SyncItem& item);
00167 };
00168
00169
00170
00171 END_NAMESPACE
00172 #endif // ENABLE_INTEGRATION_TESTS