use of org.apache.pulsar.broker.admin.AdminApiTest.MockedPulsarService in project incubator-pulsar by apache.
the class IncrementPartitionsTest method setup.
@BeforeMethod
@Override
public void setup() throws Exception {
conf.setLoadBalancerEnabled(true);
super.internalSetup();
// create otherbroker to test redirect on calls that need
// namespace ownership
mockPulsarSetup = new MockedPulsarService(this.conf);
mockPulsarSetup.setup();
// Setup namespaces
admin.clusters().createCluster("use", new ClusterData("http://127.0.0.1" + ":" + BROKER_WEBSERVICE_PORT));
PropertyAdmin propertyAdmin = new PropertyAdmin(Lists.newArrayList("role1", "role2"), Sets.newHashSet("use"));
admin.properties().createProperty("prop-xyz", propertyAdmin);
admin.namespaces().createNamespace("prop-xyz/use/ns1");
}
use of org.apache.pulsar.broker.admin.AdminApiTest.MockedPulsarService in project incubator-pulsar by apache.
the class AdminApiTest2 method testLoadReportApi.
/**
* It verifies that pulsar with different load-manager generates different load-report and returned by admin-api
*
* @throws Exception
*/
@Test
public void testLoadReportApi() throws Exception {
this.conf.setLoadManagerClassName(SimpleLoadManagerImpl.class.getName());
MockedPulsarService mockPulsarSetup1 = new MockedPulsarService(this.conf);
mockPulsarSetup1.setup();
PulsarService simpleLoadManager = mockPulsarSetup1.getPulsar();
PulsarAdmin simpleLoadManagerAdmin = mockPulsarSetup1.getAdmin();
assertNotNull(simpleLoadManagerAdmin.brokerStats().getLoadReport());
this.conf.setLoadManagerClassName(ModularLoadManagerImpl.class.getName());
MockedPulsarService mockPulsarSetup2 = new MockedPulsarService(this.conf);
mockPulsarSetup2.setup();
PulsarService modularLoadManager = mockPulsarSetup2.getPulsar();
PulsarAdmin modularLoadManagerAdmin = mockPulsarSetup2.getAdmin();
assertNotNull(modularLoadManagerAdmin.brokerStats().getLoadReport());
simpleLoadManagerAdmin.close();
simpleLoadManager.close();
modularLoadManagerAdmin.close();
modularLoadManager.close();
mockPulsarSetup1.cleanup();
mockPulsarSetup2.cleanup();
}
use of org.apache.pulsar.broker.admin.AdminApiTest.MockedPulsarService in project incubator-pulsar by apache.
the class AdminApiTest2 method setup.
@BeforeMethod
@Override
public void setup() throws Exception {
conf.setLoadBalancerEnabled(true);
super.internalSetup();
// create otherbroker to test redirect on calls that need
// namespace ownership
mockPulsarSetup = new MockedPulsarService(this.conf);
mockPulsarSetup.setup();
// Setup namespaces
admin.clusters().createCluster("use", new ClusterData("http://127.0.0.1" + ":" + BROKER_WEBSERVICE_PORT));
PropertyAdmin propertyAdmin = new PropertyAdmin(Lists.newArrayList("role1", "role2"), Sets.newHashSet("use"));
admin.properties().createProperty("prop-xyz", propertyAdmin);
admin.namespaces().createNamespace("prop-xyz/use/ns1");
}
Aggregations