Fix Metaproxy stops logging after check config failed MP-590
[metaproxy-moved-to-github.git] / src / test_filter_bounce.cpp
index f2e63f8..7eaafed 100644 (file)
@@ -1,7 +1,5 @@
-/* $Id: test_filter_bounce.cpp,v 1.4 2007-11-02 17:47:41 adam Exp $
-   Copyright (c) 2005-2007, Index Data.
-
-This file is part of Metaproxy.
+/* This file is part of Metaproxy.
+   Copyright (C) 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
@@ -14,19 +12,16 @@ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
 You should have received a copy of the GNU General Public License
-along with Metaproxy; see the file LICENSE.  If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
- */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
 
 #include "config.hpp"
 #include "filter_bounce.hpp"
-#include "util.hpp"
+#include <metaproxy/util.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>
@@ -52,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;
-        
+
     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();
-    
+
     Z_GDU *z_gdu_req = gdu_req->get();
     Z_GDU *z_gdu_res = gdu_res->get();
 
@@ -94,19 +89,19 @@ void check_bounce_http(mp::RouterChain &router)
 
     // 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
-    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();
-    
+
     Z_GDU *z_gdu_req = gdu_req->get();
     Z_GDU *z_gdu_res = gdu_res->get();
 
@@ -127,7 +122,7 @@ void check_bounce_http(mp::RouterChain &router)
 
 BOOST_AUTO_TEST_CASE( test_filter_bounce_1 )
 {
-    try 
+    try
     {
         mp::filter::Bounce f_bounce;
     }
@@ -138,39 +133,39 @@ BOOST_AUTO_TEST_CASE( test_filter_bounce_1 )
 
 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);
 
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_initRequest, Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_searchRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_presentRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_deleteResultSetRequest, Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_accessControlRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_resourceControlRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_triggerResourceControlRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_resourceReportRequest, Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_scanRequest, Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_sortRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_segmentRequest, Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_extendedServicesRequest, Z_APDU_close);
-        check_bounce_z3950(router, 
+        check_bounce_z3950(router,
                            Z_APDU_close , Z_APDU_close);
-        //check_bounce_z3950(router, 
+        //check_bounce_z3950(router,
         //                   Z_APDU_duplicateDetectionRequest, Z_APDU_close);
 
 
@@ -182,9 +177,9 @@ BOOST_AUTO_TEST_CASE( test_filter_bounce_2 )
 
 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);
 
@@ -199,8 +194,9 @@ BOOST_AUTO_TEST_CASE( test_filter_bounce_3 )
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
- * c-file-style: "stroustrup"
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab
  */
+