Пример #1
0
	void HTTPNodeTestObject::test<4>()
	{
		// automatic creation of parent nodes and not overriding existing nodes
		
		LLHTTPNode* alphaNode = new LLHTTPNode;
		LLHTTPNode* betaNode = new LLHTTPNode;
		LLHTTPNode* gammaNode = new LLHTTPNode;
		LLHTTPNode* gamma2Node = new LLHTTPNode;
		
		mRoot.addNode("greek/alpha", alphaNode);
		mRoot.addNode("greek/beta", betaNode);
		
		mRoot.addNode("greek/gamma", gammaNode);
		mRoot.addNode("greek/gamma", gamma2Node);
		
		LLHTTPNode* alephNode = new LLHTTPNode;
		
		mRoot.addNode("hebrew/aleph", alephNode);

		ensureRootTraversal("greek/alpha", alphaNode, "");
		ensureRootTraversal("greek/beta", betaNode, "");
		ensureRootTraversal("greek/delta", NULL, "delta");
		ensureRootTraversal("greek/gamma", gammaNode, "");
		ensureRootTraversal("hebrew/aleph", alephNode, "");

		ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot);
		ensure_equals("root of beta", betaNode->rootNode(), &mRoot);
		ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot);
		ensure_equals("root of aleph", alephNode->rootNode(), &mRoot);
	}
Пример #2
0
	void HTTPNodeTestObject::test<2>()
	{
		// simple traversal of a single node
		
		LLHTTPNode* helloNode = new LLHTTPNode;
		mRoot.addNode("hello", helloNode);

		ensureRootTraversal("hello", helloNode, "");
		ensureRootTraversal("/hello", helloNode, "");
		ensureRootTraversal("hello/", helloNode, "");
		ensureRootTraversal("/hello/", helloNode, "");

		ensureRootTraversal("hello/there", NULL, "there");
		
		ensure_equals("root of hello", helloNode->rootNode(), &mRoot);
	}
Пример #3
0
void LLHTTPRegistrar::buildAllServices(LLHTTPNode& root)
{
    const FactoryMap& map = factoryMap();
    
    FactoryMap::const_iterator i = map.begin();
    FactoryMap::const_iterator end = map.end();
    for (; i != end; ++i)
    {
		LL_DEBUGS("AppInit") << "LLHTTPRegistrar::buildAllServices adding node for path "
			<< i->first << LL_ENDL;
		
        root.addNode(i->first, i->second->build());
    }
}
Пример #4
0
void LLHTTPRegistrar::buildAllServices(LLHTTPNode& root)
{
    const FactoryMap& map = factoryMap();
    
    FactoryMap::const_iterator i = map.begin();
    FactoryMap::const_iterator end = map.end();
    for (; i != end; ++i)
    {
		std::cout << "LLHTTPRegistrar::buildAllServices adding node for path "
			<< i->first.c_str() << std::endl;
		
        root.addNode(i->first, i->second->build());
    }
}
Пример #5
0
	void HTTPNodeTestObject::test<3>()
	{
		// traversal of mutli-branched tree
		
		LLHTTPNode* greekNode = new LLHTTPNode;
		LLHTTPNode* alphaNode = new LLHTTPNode;
		LLHTTPNode* betaNode = new LLHTTPNode;
		LLHTTPNode* gammaNode = new LLHTTPNode;
		
		greekNode->addNode("alpha", alphaNode);
		greekNode->addNode("beta", betaNode);
		greekNode->addNode("gamma", gammaNode);
		mRoot.addNode("greek", greekNode);
		
		LLHTTPNode* hebrewNode = new LLHTTPNode;
		LLHTTPNode* alephNode = new LLHTTPNode;
		
		hebrewNode->addNode("aleph", alephNode);
		mRoot.addNode("hebrew", hebrewNode);

		ensureRootTraversal("greek/alpha", alphaNode, "");
		ensureRootTraversal("greek/beta", betaNode, "");
		ensureRootTraversal("greek/delta", NULL, "delta");
		ensureRootTraversal("greek/gamma", gammaNode, "");
		ensureRootTraversal("hebrew/aleph", alephNode, "");

		ensure_equals("root of greek", greekNode->rootNode(), &mRoot);
		ensure_equals("root of alpha", alphaNode->rootNode(), &mRoot);
		ensure_equals("root of beta", betaNode->rootNode(), &mRoot);
		ensure_equals("root of gamma", gammaNode->rootNode(), &mRoot);
		ensure_equals("root of hebrew", hebrewNode->rootNode(), &mRoot);
		ensure_equals("root of aleph", alephNode->rootNode(), &mRoot);
	}