2 * Copyright (c) 2014 <copyright holder> <email>
4 * For license details, see the LICENSE file in the root of this project.
11 #include "NameCacheTest.h"
12 #include "cache/GSSNameCache.h"
13 #include "datamodel/GSSName.h"
14 #include <GSSImportName.h>
16 CPPUNIT_TEST_SUITE_REGISTRATION( NameCacheTest );
18 void NameCacheTest::setUp()
23 void NameCacheTest::tearDown()
28 void NameCacheTest::testStore()
33 GSSName source, target;
34 OM_uint32 major, minor;
38 major = gss_import_name(&minor, GSSBuffer((char *)"HTTP@localhost").toGss(), GSS_C_NT_HOSTBASED_SERVICE, &src);
41 OM_uint32 min, context;
44 std::cout << "Error in importing name." << std::endl;
45 gss_display_status(&min, major, GSS_C_GSS_CODE, GSS_C_NT_HOSTBASED_SERVICE, &context, &buf);
46 std::cout << " message: " << (char *)buf.value << std::endl;
48 CPPUNIT_ASSERT_MESSAGE(
49 "Could not generate a name to test storing into the cache.",
57 key = GSSNameCache::instance()->store(source);
59 // verify that the data can be retrieved.
60 target = GSSNameCache::instance()->retrieve(key);
62 CPPUNIT_ASSERT_EQUAL_MESSAGE(
63 "The name cache did not store and retrieve the same data",