Search in sources :

Example 1 with SelectionManager

use of org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.SelectionManager in project opennms by OpenNMS.

the class UniqueAttributeNameValidatorTest method before.

@Before
public void before() {
    final Mbean mbean = TestHelper.createMbean("MBean1");
    mbean.getAttrib().add(TestHelper.createAttrib("attribute1", "attrib1"));
    mbean.getCompAttrib().add(TestHelper.createCompAttrib("compAttribute1", TestHelper.createCompMember("compMember1", "compMem1"), TestHelper.createCompMember("compMember2", "compMem2")));
    selectionManager = new SelectionManager() {

        @Override
        public Collection<Attrib> getSelectedAttributes(Mbean otherMbean) {
            return mbean.getAttrib();
        }

        @Override
        public Collection<CompMember> getSelectedCompositeMembers(CompAttrib compAttrib) {
            return mbean.getCompAttrib().get(0).getCompMember();
        }

        @Override
        public Collection<CompAttrib> getSelectedCompositeAttributes(Mbean otherMbean) {
            return mbean.getCompAttrib();
        }

        @Override
        public Collection<Mbean> getSelectedMbeans() {
            return Arrays.asList(new Mbean[] { mbean });
        }
    };
}
Also used : SelectionManager(org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.SelectionManager) Mbean(org.opennms.xmlns.xsd.config.jmx_datacollection.Mbean) Collection(java.util.Collection) CompAttrib(org.opennms.xmlns.xsd.config.jmx_datacollection.CompAttrib) Before(org.junit.Before)

Aggregations

Collection (java.util.Collection)1 Before (org.junit.Before)1 SelectionManager (org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.SelectionManager)1 CompAttrib (org.opennms.xmlns.xsd.config.jmx_datacollection.CompAttrib)1 Mbean (org.opennms.xmlns.xsd.config.jmx_datacollection.Mbean)1