Search in sources :

Example 1 with PolicyTestFrame

use of com.yahoo.documentapi.messagebus.protocol.test.PolicyTestFrame in project vespa by vespa-engine.

the class StoragePolicyTestEnvironment method setUp.

@Override
public void setUp() throws Exception {
    DocumentTypeManager manager = new DocumentTypeManager();
    DocumentTypeManagerConfigurer.configure(manager, "file:./test/cfg/testdoc.cfg");
    frame = new PolicyTestFrame(manager);
    nodes = new TreeSet<>();
    DocumentProtocol protocol = (DocumentProtocol) frame.getMessageBus().getProtocol((Utf8Array) DocumentProtocol.NAME);
    policyFactory = new StoragePolicyTestFactory(nodes);
    protocol.putRoutingPolicyFactory("storage", policyFactory);
    frame.setMessage(createMessage("userdoc:ns:1:foo"));
    frame.setHop(new HopSpec("test", "[storage:cluster=foo]"));
}
Also used : DocumentTypeManager(com.yahoo.document.DocumentTypeManager) HopSpec(com.yahoo.messagebus.routing.HopSpec) PolicyTestFrame(com.yahoo.documentapi.messagebus.protocol.test.PolicyTestFrame) Utf8Array(com.yahoo.text.Utf8Array)

Aggregations

DocumentTypeManager (com.yahoo.document.DocumentTypeManager)1 PolicyTestFrame (com.yahoo.documentapi.messagebus.protocol.test.PolicyTestFrame)1 HopSpec (com.yahoo.messagebus.routing.HopSpec)1 Utf8Array (com.yahoo.text.Utf8Array)1