projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http_rewrite using HTML parser
[metaproxy-moved-to-github.git]
/
src
/
test_filter_bounce.cpp
diff --git
a/src/test_filter_bounce.cpp
b/src/test_filter_bounce.cpp
index
5a1754a
..
0748a55
100644
(file)
--- a/
src/test_filter_bounce.cpp
+++ b/
src/test_filter_bounce.cpp
@@
-1,5
+1,5
@@
/* This file is part of Metaproxy.
/* This file is part of Metaproxy.
- Copyright (C) 2005-2010 Index Data
+ Copyright (C) 2005-2013 Index Data
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Metaproxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-18,12
+18,10
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "config.hpp"
#include "filter_bounce.hpp"
#include "config.hpp"
#include "filter_bounce.hpp"
-#include "util.hpp"
+#include <metaproxy/util.hpp>
#include "gduutil.hpp"
#include "gduutil.hpp"
-//#include "sru_util.hpp"
-#include "router_chain.hpp"
-#include "session.hpp"
-#include "package.hpp"
+#include <metaproxy/router_chain.hpp>
+#include <metaproxy/package.hpp>
#include <iostream>
#include <stdexcept>
#include <iostream>
#include <stdexcept>
@@
-49,19
+47,19
@@
void check_bounce_z3950(mp::RouterChain &router, int request, int response)
// Create package with Z39.50 init request in it
mp::Package pack;
// Create package with Z39.50 init request in it
mp::Package pack;
-
+
mp::odr odr;
Z_APDU *apdu = zget_APDU(odr, request);
pack.request() = apdu;
// Put it in router
mp::odr odr;
Z_APDU *apdu = zget_APDU(odr, request);
pack.request() = apdu;
// Put it in router
- pack.router(router).move();
-
+ pack.router(router).move();
+
// Inspect bounced back request
yazpp_1::GDU *gdu_req = &pack.request();
yazpp_1::GDU *gdu_res = &pack.response();
// Inspect bounced back request
yazpp_1::GDU *gdu_req = &pack.request();
yazpp_1::GDU *gdu_res = &pack.response();
-
+
Z_GDU *z_gdu_req = gdu_req->get();
Z_GDU *z_gdu_res = gdu_res->get();
Z_GDU *z_gdu_req = gdu_req->get();
Z_GDU *z_gdu_res = gdu_res->get();
@@
-91,19
+89,19
@@
void check_bounce_http(mp::RouterChain &router)
// Create package with Z39.50 init request in it
mp::Package pack;
// Create package with Z39.50 init request in it
mp::Package pack;
-
+
mp::odr odr;
Z_GDU *gdu = z_get_HTTP_Request(odr);
//z_get_HTTP_Request_host_path(odr, host, path);
pack.request() = gdu;
// Put it in router
mp::odr odr;
Z_GDU *gdu = z_get_HTTP_Request(odr);
//z_get_HTTP_Request_host_path(odr, host, path);
pack.request() = gdu;
// Put it in router
- pack.router(router).move();
-
+ pack.router(router).move();
+
// Inspect bounced back request
yazpp_1::GDU *gdu_req = &pack.request();
yazpp_1::GDU *gdu_res = &pack.response();
// Inspect bounced back request
yazpp_1::GDU *gdu_req = &pack.request();
yazpp_1::GDU *gdu_res = &pack.response();
-
+
Z_GDU *z_gdu_req = gdu_req->get();
Z_GDU *z_gdu_res = gdu_res->get();
Z_GDU *z_gdu_req = gdu_req->get();
Z_GDU *z_gdu_res = gdu_res->get();
@@
-124,7
+122,7
@@
void check_bounce_http(mp::RouterChain &router)
BOOST_AUTO_TEST_CASE( test_filter_bounce_1 )
{
BOOST_AUTO_TEST_CASE( test_filter_bounce_1 )
{
- try
+ try
{
mp::filter::Bounce f_bounce;
}
{
mp::filter::Bounce f_bounce;
}
@@
-135,39
+133,39
@@
BOOST_AUTO_TEST_CASE( test_filter_bounce_1 )
BOOST_AUTO_TEST_CASE( test_filter_bounce_2 )
{
BOOST_AUTO_TEST_CASE( test_filter_bounce_2 )
{
- try
+ try
{
{
- mp::RouterChain router;
+ mp::RouterChain router;
mp::filter::Bounce f_bounce;
router.append(f_bounce);
mp::filter::Bounce f_bounce;
router.append(f_bounce);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_initRequest, Z_APDU_close);
Z_APDU_initRequest, Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_searchRequest, Z_APDU_close);
// Z_APDU_searchRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_presentRequest, Z_APDU_close);
Z_APDU_presentRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_deleteResultSetRequest, Z_APDU_close);
Z_APDU_deleteResultSetRequest, Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_accessControlRequest, Z_APDU_close);
// Z_APDU_accessControlRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_resourceControlRequest, Z_APDU_close);
Z_APDU_resourceControlRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_triggerResourceControlRequest, Z_APDU_close);
Z_APDU_triggerResourceControlRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_resourceReportRequest, Z_APDU_close);
Z_APDU_resourceReportRequest, Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_scanRequest, Z_APDU_close);
// Z_APDU_scanRequest, Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_sortRequest, Z_APDU_close);
// Z_APDU_sortRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_segmentRequest, Z_APDU_close);
Z_APDU_segmentRequest, Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_extendedServicesRequest, Z_APDU_close);
// Z_APDU_extendedServicesRequest, Z_APDU_close);
- check_bounce_z3950(router,
+ check_bounce_z3950(router,
Z_APDU_close , Z_APDU_close);
Z_APDU_close , Z_APDU_close);
- //check_bounce_z3950(router,
+ //check_bounce_z3950(router,
// Z_APDU_duplicateDetectionRequest, Z_APDU_close);
// Z_APDU_duplicateDetectionRequest, Z_APDU_close);
@@
-179,9
+177,9
@@
BOOST_AUTO_TEST_CASE( test_filter_bounce_2 )
BOOST_AUTO_TEST_CASE( test_filter_bounce_3 )
{
BOOST_AUTO_TEST_CASE( test_filter_bounce_3 )
{
- try
+ try
{
{
- mp::RouterChain router;
+ mp::RouterChain router;
mp::filter::Bounce f_bounce;
router.append(f_bounce);
mp::filter::Bounce f_bounce;
router.append(f_bounce);