Search in sources :

Example 1 with CategoryController

use of org.apache.qpid.server.management.plugin.controller.CategoryController in project qpid-broker-j by apache.

the class LegacyCategoryControllerFactoryTest method createController.

@Test
public void createController() {
    LegacyCategoryControllerFactory.SUPPORTED_CATEGORIES.forEach(category -> {
        final CategoryController controller = _factory.createController(category, _nextVersionManagementController);
        assertThat(controller.getCategory(), is(equalTo(category)));
    });
}
Also used : CategoryController(org.apache.qpid.server.management.plugin.controller.CategoryController) Test(org.junit.Test)

Example 2 with CategoryController

use of org.apache.qpid.server.management.plugin.controller.CategoryController in project qpid-broker-j by apache.

the class ContainerControllerTest method convertNextVersionBrokerConfiguredObject.

@Test
public void convertNextVersionBrokerConfiguredObject() {
    final CategoryController controller = _factory.createController("Broker", _nextVersionManagementController);
    assertThat(controller.getCategory(), is(equalTo("Broker")));
    final LegacyConfiguredObject object = mock(LegacyConfiguredObject.class);
    when(object.getAttribute("modelVersion")).thenReturn("foo");
    final LegacyConfiguredObject converted = controller.convertFromNextVersion(object);
    Object modelVersion = converted.getAttribute("modelVersion");
    assertThat(modelVersion, is(equalTo(MODEL_VERSION)));
}
Also used : LegacyConfiguredObject(org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject) LegacyConfiguredObject(org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject) CategoryController(org.apache.qpid.server.management.plugin.controller.CategoryController) Test(org.junit.Test)

Example 3 with CategoryController

use of org.apache.qpid.server.management.plugin.controller.CategoryController in project qpid-broker-j by apache.

the class ContainerControllerTest method convertNextVersionVirtualHostConfiguredObject.

@Test
public void convertNextVersionVirtualHostConfiguredObject() {
    final CategoryController controller = _factory.createController("VirtualHost", _nextVersionManagementController);
    assertThat(controller.getCategory(), is(equalTo("VirtualHost")));
    final LegacyConfiguredObject object = mock(LegacyConfiguredObject.class);
    when(object.getAttribute("modelVersion")).thenReturn("foo");
    final LegacyConfiguredObject converted = controller.convertFromNextVersion(object);
    Object modelVersion = converted.getAttribute("modelVersion");
    assertThat(modelVersion, is(equalTo(MODEL_VERSION)));
}
Also used : LegacyConfiguredObject(org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject) LegacyConfiguredObject(org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject) CategoryController(org.apache.qpid.server.management.plugin.controller.CategoryController) Test(org.junit.Test)

Example 4 with CategoryController

use of org.apache.qpid.server.management.plugin.controller.CategoryController in project qpid-broker-j by apache.

the class LegacyCategoryControllerFactoryTest method createController.

@Test
public void createController() {
    SUPPORTED_CATEGORIES.keySet().forEach(category -> {
        final CategoryController controller = _factory.createController(category, _nextVersionManagementController);
        assertThat(controller.getCategory(), is(equalTo(category)));
    });
}
Also used : CategoryController(org.apache.qpid.server.management.plugin.controller.CategoryController) Test(org.junit.Test)

Aggregations

CategoryController (org.apache.qpid.server.management.plugin.controller.CategoryController)4 Test (org.junit.Test)4 LegacyConfiguredObject (org.apache.qpid.server.management.plugin.controller.LegacyConfiguredObject)2