private void setupExternPolicy(PolicyTestFrame frame, Slobrok slobrok, String pattern, int numEntries)
            throws InterruptedException, TimeoutException
    {
        String param = "tcp/localhost:" + slobrok.port() + ";" + pattern;
        frame.setHop(new HopSpec("test", "[Extern:" + param + "]"));
        MessageBus mbus = frame.getMessageBus();
        HopBlueprint hop = mbus.getRoutingTable(DocumentProtocol.NAME).getHop("test");
        PolicyDirective dir = (PolicyDirective)hop.getDirective(0);
        ExternPolicy policy = (ExternPolicy)mbus.getRoutingPolicy(DocumentProtocol.NAME, dir.getName(), dir.getParam());
        assertMirrorReady(policy.getMirror());
        if (numEntries >= 0) {
            assertMirrorContains(policy.getMirror(), pattern, numEntries);
        }
    }
Ensures that the given number of select passes on the given frame produces an expected list of recipients.

@param frame      The frame to select on.
@param numSelects The number of selects to perform.
@param expected   The list of expected recipients.
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/test/PolicyTestCase.java