~ubuntu-branches/ubuntu/trusty/libcmis/trusty

« back to all changes in this revision

Viewing changes to qa/mockup/mockup-config.h

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2014-02-05 14:41:34 UTC
  • mfrom: (1.1.5) (2.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140205144134-ffvov1moblfapn82
Tags: 0.4.1-3ubuntu1
* Resynchronize on Debian, remaining change:
* debian/patches/powerpc64le.diff: build on ppc64el

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* libcmis
 
2
 * Version: MPL 1.1 / GPLv2+ / LGPLv2+
 
3
 *
 
4
 * The contents of this file are subject to the Mozilla Public License Version
 
5
 * 1.1 (the "License"); you may not use this file except in compliance with
 
6
 * the License or as specified alternatively below. You may obtain a copy of
 
7
 * the License at http://www.mozilla.org/MPL/
 
8
 *
 
9
 * Software distributed under the License is distributed on an "AS IS" basis,
 
10
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
11
 * for the specific language governing rights and limitations under the
 
12
 * License.
 
13
 *
 
14
 * Major Contributor(s):
 
15
 * Copyright (C) 2011 SUSE <cbosdonnat@suse.com>
 
16
 *
 
17
 *
 
18
 * All Rights Reserved.
 
19
 *
 
20
 * For minor contributions see the git repository.
 
21
 *
 
22
 * Alternatively, the contents of this file may be used under the terms of
 
23
 * either the GNU General Public License Version 2 or later (the "GPLv2+"), or
 
24
 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
 
25
 * in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
 
26
 * instead of those above.
 
27
 */
 
28
 
 
29
#include <curl/curl.h>
 
30
 
 
31
#ifdef  __cplusplus
 
32
extern "C" {
 
33
#endif
 
34
 
 
35
/* Mockup behavior configuration functions */
 
36
void curl_mockup_reset( );
 
37
 
 
38
/** Add a new HTTP response the server should send.
 
39
 
 
40
    \param baseURL
 
41
        the base URL of the request without parameters
 
42
    \param matchParam
 
43
        a string to find in the parameters part of the URL to match
 
44
    \param response 
 
45
        a string corresponding either to the file path of the request
 
46
        body to send or directly the content to send. This value has
 
47
        a different meaning depending on isFilePath parameter.
 
48
    \param method
 
49
        HTTP method to match like PUT, GET, POST or DELETE. An empty
 
50
        string matches any method.
 
51
    \param status
 
52
        the HTTP status to return. 0 means HTTP OK (200).
 
53
    \param isFilePath
 
54
        if this value is true the response value is used as a file path,
 
55
        otherwise, the response value is used as the body of the HTTP
 
56
        response to send.
 
57
    \param headers
 
58
        the HTTP headers block to send with the response. By default
 
59
        no header is sent.
 
60
  */
 
61
void curl_mockup_addResponse( const char* baseUrl, const char* matchParam, const char* method,
 
62
                              const char* response, unsigned int status = 0, bool isFilePath = true,
 
63
                              const char* headers = 0 );
 
64
 
 
65
/** Set the HTTP response the server is supposed to send.
 
66
    This will reset all already defined responses.
 
67
 */
 
68
void curl_mockup_setResponse( const char* filepath );
 
69
void curl_mockup_setCredentials( const char* username, const char* password );
 
70
 
 
71
struct HttpRequest
 
72
{
 
73
    const char* url;
 
74
    const char* body;
 
75
};
 
76
 
 
77
const struct HttpRequest* curl_mockup_getRequest( const char* baseUrl, const char* matchParam, const char* method );
 
78
const char* curl_mockup_getRequestBody( const char* baseUrl, const char* matchParam, const char* method );
 
79
 
 
80
const char* curl_mockup_getProxy( CURL* handle );
 
81
const char* curl_mockup_getNoProxy( CURL* handle );
 
82
const char* curl_mockup_getProxyUser( CURL* handle );
 
83
const char* curl_mockup_getProxyPass( CURL* handle );
 
84
 
 
85
/** Set a fake invalid certificate to raise CURLE_SSL_CACERT. Setting it
 
86
    to an empty string will reset to no certificate.
 
87
  */
 
88
void curl_mockup_setSSLBadCertificate( const char* certificate );
 
89
 
 
90
#ifdef __cplusplus
 
91
}
 
92
#endif