--- /dev/null
+## *********************************************************************
+## *
+## * Copyright (c) 2002 CERN and INFN on behalf of the EU DataGrid.
+## * For license conditions see LICENSE file or
+## * http://www.edg.org/license.html
+## *
+## *********************************************************************
+
+EXCEPTION_LIBS = $(top_builddir)/src/libglite_wmsutils_exception.la
+
+TESTS = glite-wmsutils-exception
+
+check_PROGRAMS = $(TESTS)
+
+glite_wmsutils_exception_SOURCES = exception_cu_suite.cpp \
+ exception_cu_suite.h \
+ exception_cu_main.cpp
+
+glite_wmsutils_exception_LDADD = \
+ $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
+ $(GLOBUS_GSS_THR_LIBS) \
+ $(EXCEPTION_LIBS) \
+ $(CPPUNIT_LIBS)
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/test \
+ $(GLITE_CFLAGS) \
+ $(GLOBUS_THR_CFLAGS) \
+ $(CPPUNIT_CFLAGS)
+
+MAINTAINERCLEANFILES = Makefile.in *~
+
--- /dev/null
+#include <iostream>
+#include <fstream>
+
+#include "exception_cu_suite.h"
+
+#include <cppunit/TestResult.h>
+#include <cppunit/TestRunner.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/TextOutputter.h>
+#include <cppunit/XmlOutputter.h>
+
+using namespace CppUnit;
+using namespace std;
+
+int main (int argc , char** argv)
+{
+ std::ofstream xml("./cppUnit_output.xml",ios::app);
+
+ CppUnit::TestResult controller;
+ CppUnit::TestResultCollector result;
+ controller.addListener( &result );
+
+ TestRunner runner;
+ runner.addTest(Exception_test::suite());
+ runner.run(controller);
+
+ CppUnit::XmlOutputter outputter( &result, xml );
+ CppUnit::TextOutputter outputter2( &result, std::cerr );
+ outputter.write();
+ outputter2.write();
+
+ return result.wasSuccessful() ? 0 : 1 ;
+}
--- /dev/null
+#include "exception_cu_suite.h"
+#include "glite/wmsutils/exception/Exception.h"
+#include <string>
+#include <vector>
+
+using namespace CppUnit;
+using namespace std;
+using namespace glite::wmsutils::exception;
+
+void Exception_test::setUp()
+{}
+
+void Exception_test::tearDown()
+{}
+
+
+void Exception_test::constructor_case()
+{
+
+ //constructor class name, line number, method name, code, exception name
+ glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
+
+ //constructor class name, method name, code, exception name
+ glite::wmsutils::exception::Exception exc_4("TEST_Class", "test_method", 1, "exception_test");
+
+ CPPUNIT_ASSERT(exc_5.getExceptionName() == "exception_test");
+ CPPUNIT_ASSERT(exc_5.getCode() == 1);
+}
+
+void Exception_test::tostring_case()
+{
+ cout<<"TEST TO STRING METHODS"<<endl;
+ glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
+ cout << exc_5.dbgMessage() << endl;
+ cout << exc_5.printStackTrace() << endl;
+ exc_5.log("exception_file");
+
+ cout<<"END TEST TO STRING"<<endl;
+}
+
+void Exception_test::stackTrace_case()
+{
+ glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
+
+ exc_5.push_back("Second_Class", 5, "second_method");
+
+ vector<string> msgvec = exc_5.getStackTrace();
+
+ for (int i=0; i<msgvec.size(); i++)
+ {
+ cout << msgvec[i] << endl;
+ }
+
+}
+
+
--- /dev/null
+#include<iostream>
+#include<string>
+#include<pthread.h>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+
+class Exception_test : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE(Exception_test);
+ CPPUNIT_TEST(constructor_case);
+ CPPUNIT_TEST(tostring_case);
+ CPPUNIT_TEST(stackTrace_case);
+ CPPUNIT_TEST_SUITE_END();
+
+
+public:
+
+ void setUp();
+ void tearDown();
+
+ void constructor_case();
+ void tostring_case();
+ void stackTrace_case();
+
+};
+
+
+
--- /dev/null
+## *********************************************************************
+## *
+## * Copyright (c) 2002 CERN and INFN on behalf of the EU DataGrid.
+## * For license conditions see LICENSE file or
+## * http://www.edg.org/license.html
+## *
+## *********************************************************************
+
+JOBID_LIBS = $(top_builddir)/src/jobid/libglite_wmsutils_jobid.la
+CJOBID_LIBS = $(top_builddir)/src/jobid/libglite_wmsutils_cjobid.la
+
+TESTS = glite-wmsutils-jobid \
+ glite-wmsutils-manipulation
+
+check_PROGRAMS = $(TESTS)
+
+glite_wmsutils_jobid_SOURCES = jobid_cu_suite.cpp \
+ jobid_cu_suite.h \
+ jobid_cu_main.cpp
+
+glite_wmsutils_jobid_LDADD = \
+ $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
+ $(GLOBUS_GSS_THR_LIBS) \
+ $(CPPUNIT_LIBS) \
+ $(JOBID_LIBS) \
+ $(CJOBID_LIBS)
+
+glite_wmsutils_manipulation_SOURCES = manipulation_cu_suite.cpp \
+ manipulation_cu_suite.h \
+ manipulation_cu_main.cpp
+
+glite_wmsutils_manipulation_LDADD = \
+ $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
+ $(GLOBUS_GSS_THR_LIBS) \
+ $(CPPUNIT_LIBS) \
+ $(JOBID_LIBS) \
+ $(CJOBID_LIBS)
+
+
+AM_CPPFLAGS = -I$(top_srcdir)/interface \
+ -I$(top_srcdir)/src \
+ -I$(top_srcdir)/test \
+ $(GLITE_CFLAGS) \
+ $(GLOBUS_THR_CFLAGS) \
+ $(CPPUNIT_CFLAGS)
+
+MAINTAINERCLEANFILES = Makefile.in *~
+
--- /dev/null
+#include <iostream>
+#include <fstream>
+
+#include "jobid_cu_suite.h"
+
+#include <cppunit/TestResult.h>
+#include <cppunit/TestRunner.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/TextOutputter.h>
+#include <cppunit/XmlOutputter.h>
+
+using namespace CppUnit;
+using namespace std;
+
+int main (int argc , char** argv)
+{
+ std::ofstream xml("./cppUnit_output.xml",ios::app);
+
+ CppUnit::TestResult controller;
+ CppUnit::TestResultCollector result;
+ controller.addListener( &result );
+
+ TestRunner runner;
+ runner.addTest(Jobid_test::suite());
+ runner.run(controller);
+
+ CppUnit::XmlOutputter outputter( &result, xml );
+ CppUnit::TextOutputter outputter2( &result, std::cerr );
+ outputter.write();
+ outputter2.write();
+
+ return result.wasSuccessful() ? 0 : 1 ;
+}
--- /dev/null
+#include "jobid_cu_suite.h"
+
+
+using namespace CppUnit;
+using namespace std;
+using namespace glite::wmsutils::jobid;
+
+
+void Jobid_test::setUp()
+{}
+
+void Jobid_test::tearDown()
+{}
+
+void Jobid_test::Constructor_case()
+{
+ //EMPTY CONSTRUCTOR
+ JobId empty;
+
+ CPPUNIT_ASSERT(empty.isSet()==false);
+
+ //create a string with cjobid
+ string bkserver="grid012g.cnaf.infn.it";
+ edg_wlc_JobId jobid;
+ int bkport=6000;
+ int ok=edg_wlc_JobIdCreate(bkserver.c_str(), bkport, &jobid);
+ CPPUNIT_ASSERT(ok == 0);
+ if (ok==0)
+ {
+ string jobstring=edg_wlc_JobIdUnparse(jobid);
+
+ //STRING CONSTRUCTOR
+ JobId stringCons(jobstring);
+
+ //EDG_WLC CONSTRUCTOR
+ JobId edg_wlc_Cons(jobid);
+
+ //test copy constructor
+ JobId copycon(stringCons);
+
+ CPPUNIT_ASSERT(stringCons.isSet());
+ CPPUNIT_ASSERT(edg_wlc_Cons.isSet());
+ CPPUNIT_ASSERT(copycon.isSet());
+
+ //test =
+ JobId testequal;
+ testequal=stringCons;
+ CPPUNIT_ASSERT(testequal.isSet());
+
+ JobId testoperator;
+ testoperator=jobid;
+ CPPUNIT_ASSERT(testoperator.isSet());
+
+ edg_wlc_JobId testget = edg_wlc_Cons.getId();
+ char *server;
+ unsigned int port;
+ edg_wlc_JobIdGetServerParts(testget, &server, &port);
+ string serverstring = server;
+ CPPUNIT_ASSERT(port==bkport);
+ CPPUNIT_ASSERT(serverstring==bkserver);
+ }
+
+ CPPUNIT_ASSERT_THROW( JobId stringwrong("grid012"), WrongIdException);
+}
+
+void Jobid_test::Clear_case()
+{
+ JobId *element;
+ string jobstring="https://grid012g.cnaf.infn.it:6000/qaKyEoV3G144rmoyXeW6QA";
+ CPPUNIT_ASSERT_NO_THROW(element= new JobId(jobstring));
+
+ CPPUNIT_ASSERT(element->isSet());
+ element->clear();
+ CPPUNIT_ASSERT(element->isSet()==false);
+ delete element;
+}
+
+void Jobid_test::SetandGet_case()
+{
+ JobId element;
+ string lbserver="grid012g.cnaf.infn.it";
+ int port=6000;
+ string unique ="qaKyEoV3G144rmoyXeW6QA";
+ element.setJobId(lbserver, port, unique);
+
+ string server=element.getServer();
+ lbserver=lbserver+":6000";
+
+ CPPUNIT_ASSERT(server==lbserver);
+ string lonely=element.getUnique();
+ CPPUNIT_ASSERT(lonely==unique);
+
+ string descr=element.toString();
+ cout << "!!! BEGIN TEST toString() METHOD!!!"<< endl;
+ cout << descr <<endl;
+ cout << "!!! END TEST toString() METHOD!!!"<< endl;
+
+ JobId wrongelement;
+ CPPUNIT_ASSERT_THROW(string server=wrongelement.getServer(), EmptyIdException);
+ CPPUNIT_ASSERT_THROW(string server=wrongelement.getUnique(), EmptyIdException);
+
+}
--- /dev/null
+#include<iostream>
+#include<string>
+#include<pthread.h>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "glite/wmsutils/jobid/JobId.h"
+#include "glite/wmsutils/jobid/cjobid.h"
+#include "glite/wmsutils/jobid/JobIdExceptions.h"
+
+class Jobid_test : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE(Jobid_test);
+
+ CPPUNIT_TEST(Constructor_case);
+ CPPUNIT_TEST(Clear_case);
+ CPPUNIT_TEST(SetandGet_case);
+
+ CPPUNIT_TEST_SUITE_END();
+
+
+public:
+
+ void setUp();
+ void tearDown();
+
+ void Constructor_case();
+ void Clear_case();
+ void SetandGet_case();
+
+};
+
+
+
--- /dev/null
+#include <iostream>
+#include <fstream>
+
+#include "manipulation_cu_suite.h"
+
+#include <cppunit/TestResult.h>
+#include <cppunit/TestRunner.h>
+#include <cppunit/TestResultCollector.h>
+#include <cppunit/TextOutputter.h>
+#include <cppunit/XmlOutputter.h>
+
+using namespace CppUnit;
+using namespace std;
+
+int main (int argc , char** argv)
+{
+ std::ofstream xml("./cppUnit_output.xml",ios::app);
+
+ CppUnit::TestResult controller;
+ CppUnit::TestResultCollector result;
+ controller.addListener( &result );
+
+ TestRunner runner;
+ runner.addTest(Manipulation_test::suite());
+ runner.run(controller);
+
+ CppUnit::XmlOutputter outputter( &result, xml );
+ CppUnit::TextOutputter outputter2( &result, std::cerr );
+ outputter.write();
+ outputter2.write();
+
+ return result.wasSuccessful() ? 0 : 1 ;
+}
--- /dev/null
+#include "manipulation_cu_suite.h"
+
+
+using namespace CppUnit;
+using namespace std;
+using namespace glite::wmsutils::jobid;
+
+
+void Manipulation_test::setUp()
+{}
+
+void Manipulation_test::tearDown()
+{}
+
+void Manipulation_test::to_fromfile_case()
+{
+ JobId element;
+
+ string lbserver="grid012g.cnaf.infn.it";
+ int port=6000;
+ string unique ="qaKyEoV3G144rmoyXeW6QA";
+ element.setJobId(lbserver, port, unique);
+
+ string filename=to_filename(element);
+
+ JobId newelement = from_filename(filename);
+
+ string reduced = get_reduced_part(element, 7);
+
+ string newreduced = get_reduced_part(newelement, 7);
+
+ CPPUNIT_ASSERT(reduced==newreduced);
+}
+
--- /dev/null
+#include<iostream>
+#include<string>
+#include<pthread.h>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "glite/wmsutils/jobid/JobId.h"
+#include "glite/wmsutils/jobid/manipulation.h"
+
+class Manipulation_test : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE(Manipulation_test);
+
+ CPPUNIT_TEST(to_fromfile_case);
+
+ CPPUNIT_TEST_SUITE_END();
+
+
+public:
+
+ void setUp();
+ void tearDown();
+
+ void to_fromfile_case();
+
+};
+
+
+