src/server/plugins/postgresql/pgtest.h

changeset 385
a1f4cb076d2f
parent 374
77506ec632a4
child 415
d938228c382e
equal deleted inserted replaced
210:21274e5950af 385:a1f4cb076d2f
1 /*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7 /*
8 * File: pgtest.h
9 * Author: olaf
10 *
11 * Created on 16. April 2022, 14:37
12 */
13
14 #ifndef PGTEST_H
15 #define PGTEST_H
16
17 #include <ucx/test.h>
18 #include <ucx/map.h>
19 #include <libxml/tree.h>
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 typedef struct TestMultistatus {
26 UcxMempool *mp;
27 xmlDoc *doc;
28 UcxMap *responses;
29 } TestMultistatus;
30
31 typedef struct TestResponse {
32 char *href;
33 UcxMap *properties;
34 } TestResponse;
35
36 typedef struct TestProperty {
37 char *prefix;
38 char *namespace;
39 char *name;
40 char *lang;
41 char *value;
42 xmlNode *node;
43 int status;
44 } TestProperty;
45
46 TestMultistatus* test_parse_multistatus(const char *space, size_t size);
47 void test_multistatus_destroy(TestMultistatus *ms);
48
49 UCX_TEST(test_pg_conn);
50
51 UCX_TEST(test_pg_lookup_root);
52
53 UCX_TEST(test_pg_vfs_open);
54 UCX_TEST(test_pg_vfs_io);
55 UCX_TEST(test_pg_vfs_stat);
56 UCX_TEST(test_pg_vfs_mkdir);
57 UCX_TEST(test_pg_vfs_unlink);
58 UCX_TEST(test_pg_vfs_rmdir);
59
60 UCX_TEST(test_pg_webdav_create_from_resdata);
61 UCX_TEST(test_pg_prepare_tests);
62 UCX_TEST(test_pg_webdav_propfind);
63 UCX_TEST(test_pg_webdav_propfind_allprop);
64 UCX_TEST(test_pg_webdav_proppatch_set);
65
66
67 /* --------------------------- PROPFIND --------------------------- */
68
69 #define PG_TEST_PROPFIND1 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \
70 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \
71 <D:prop> \
72 <D:displayname/> \
73 <D:getcontentlength/> \
74 <D:getcontenttype/> \
75 <D:getlastmodified/> \
76 <D:creationdate/> \
77 <D:resourcetype/> \
78 <D:getetag/> \
79 </D:prop> \
80 </D:propfind>"
81
82 #define PG_TEST_PROPFIND2 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \
83 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \
84 <D:prop> \
85 <D:displayname/> \
86 <D:getcontentlength/> \
87 <D:getcontenttype/> \
88 <D:getlastmodified/> \
89 <D:creationdate/> \
90 <D:resourcetype/> \
91 <D:getetag/> \
92 <X:test /> \
93 <X:prop2 /> \
94 </D:prop> \
95 </D:propfind>"
96
97 #define PG_TEST_ALLPROP "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \
98 <D:propfind xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" > \
99 <D:allprop/> \
100 </D:propfind>"
101
102 #define PG_TEST_PROPPATCH1 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \
103 <D:propertyupdate xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\"> \
104 <D:set> \
105 <D:prop><X:test>test</X:test><X:author>name</X:author></D:prop> \
106 </D:set> \
107 </D:propertyupdate>"
108
109 #define PG_TEST_PROPPATCH2 "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \
110 <D:propertyupdate xmlns:D=\"DAV:\" xmlns:X=\"http://example.com/\" xmlns:XA=\"http://example.com/a/\"> \
111 <D:set> \
112 <D:prop>\
113 <XA:xtest>\
114 <XA:elm>value</XA:elm>\
115 <X:ex>example</X:ex>\
116 <Z:nstest xmlns:Z=\"http://example.com/z\">\
117 <Y:nstest2 xmlns:Y=\"http://example.com/y\"></Y:nstest2>\
118 </Z:nstest>\
119 </XA:xtest>\
120 </D:prop> \
121 </D:set> \
122 </D:propertyupdate>"
123
124 #ifdef __cplusplus
125 }
126 #endif
127
128 #endif /* PGTEST_H */
129

mercurial