void BundleStorageTest::testFragment(dtn::storage::BundleStorage &storage)
{
	// Add fragment of a bundle to the storage
	dtn::data::Bundle b;

	// set standard variables
	b.source = dtn::data::EID("dtn://node-one/test");
	b.lifetime = 1;
	b.destination = dtn::data::EID("dtn://node-two/test");

	// add some payload
	ibrcommon::BLOB::Reference ref = ibrcommon::BLOB::create();
	b.push_back(ref);

	(*ref.iostream()) << "Hallo Welt" << std::endl;

	// transform bundle into a fragment
	b.procflags.setBit(dtn::data::PrimaryBlock::FRAGMENT, true);
	b.fragmentoffset = 4;
	b.appdatalength = 50;

	// store the bundle
	storage.store(b);

	CPPUNIT_ASSERT_EQUAL((size_t)1, storage.count());

	// create a non-fragment meta bundle
	const dtn::data::BundleID id(b);

	const dtn::data::Bundle retrieved = storage.get(id);

	CPPUNIT_ASSERT_EQUAL(id.getPayloadLength(), retrieved.getPayloadLength());

	CPPUNIT_ASSERT_EQUAL(id, (const dtn::data::BundleID&)retrieved);
}
void BundleStorageTest::testStore(dtn::storage::BundleStorage &storage)
{
	dtn::data::Bundle b;
	b.source = dtn::data::EID("dtn://node-one/test");

	// set standard variable.sourceurce = dtn::data::EID("dtn://node-one/test");
	b.lifetime = 120;
	b.destination = dtn::data::EID("dtn://node-two/test");

	// add some payload
	ibrcommon::BLOB::Reference ref = ibrcommon::BLOB::create();
	b.push_back(ref);

	(*ref.iostream()) << "Hallo Welt" << std::endl;

	CPPUNIT_ASSERT_EQUAL((dtn::data::Size)0, storage.count());

	storage.store(b);

	CPPUNIT_ASSERT_EQUAL((dtn::data::Size)1, storage.count());

	// create a bundle id
	const dtn::data::BundleID id(b);

	CPPUNIT_ASSERT_EQUAL(id, (const dtn::data::BundleID&)b);

	const dtn::data::Bundle retrieved = storage.get(id);

	CPPUNIT_ASSERT_EQUAL(id.getPayloadLength(), retrieved.getPayloadLength());

	CPPUNIT_ASSERT_EQUAL(id, (const dtn::data::BundleID&)retrieved);
}