Google APIs Client Library for C++
http_transport_test_fixture.h
Go to the documentation of this file.
00001 /*
00002  * \copyright Copyright 2013 Google Inc. All Rights Reserved.
00003  * \license @{
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  *
00017  * @}
00018  */
00019 
00020 // Author: ewiseblatt@google.com (Eric Wiseblatt)
00021 //
00022 // TODO(ewiseblatt): 20130117
00023 // Make this test independent of the wax json service.
00024 // Instead add some other simple PUBLIC service or mock
00025 // that can be open sourced.
00026 
00027 #ifndef APISERVING_CLIENTS_CPP_HTTP_TRANSPORT_TEST_FIXTURE_H_
00028 #define APISERVING_CLIENTS_CPP_HTTP_TRANSPORT_TEST_FIXTURE_H_
00029 
00030 #include "googleapis/client/transport/http_transport.h"
00031 #include <gtest/gtest.h>
00032 
00033 namespace google_wax_api {
00034 class WaxService;
00035 }  // namespace google_wax_api
00036 namespace googleapis {
00037 
00038 namespace client {
00039 class HttpTransportFactory;
00040 }  // namespace client
00041 
00042 /*
00043  * Test fixture for verifying basic HttpTransport implementations.
00044  * @ingroup TransportLayerTesting
00045  *
00046  * This class is compiled into a library that runs tests against the
00047  * core HttpTransport interface. To test a specific implementation
00048  * you should set up a HttpTransportLayerConfiguration that uses that
00049  * implementation then HttpTransportTestFixture::SetTestConfiguration
00050  * to inject the configuration before running the tests.
00051  */
00052 class HttpTransportTestFixture : public testing::Test {
00053  public:
00054   static google_wax_api::WaxService& GetGlobalWaxService();
00055   static const string& GetGlobalSessionId();
00056   static void ResetGlobalSessionId();
00057   static void SetUpTestCase();
00058   static void TearDownTestCase();
00059 
00060   static void SetTestConfiguration(
00061       const client::HttpTransportLayerConfig* config);
00062 
00063   HttpTransportTestFixture();
00064   virtual ~HttpTransportTestFixture();
00065 
00066  private:
00067   DISALLOW_COPY_AND_ASSIGN(HttpTransportTestFixture);
00068 };
00069 
00070 } // namespace googleapis
00071 #endif  // APISERVING_CLIENTS_CPP_HTTP_TRANSPORT_TEST_FIXTURE_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines