Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData.values()


       
        // listServices
       
        TabularData allServices = mbean.listServices();
        assertNotNull(allServices);
        assertEquals(bundleContext.getAllServiceReferences(null, null).length, allServices.values().size());
       
        // notifications
       
        final List<Notification> received = new ArrayList<Notification>();
     
View Full Code Here


        // test list information
       
        TabularData data = mbean.listInformation();
        assertNotNull(data);
        assertEquals(JmxConstants.PROPERTIES_TYPE, data.getTabularType());
        assertTrue(data.values().size() >= 1);
        PropertyData<byte[]> configEntry = PropertyData.from(data.get(new Object[] {PROVISIONING_AGENT_CONFIG }));
        assertNotNull(configEntry);
        assertArrayEquals(new byte[] { 10, 20, 30 }, configEntry.getValue());

       
View Full Code Here

        CompositeData compositeData = b.toCompositeData();
       
        assertEquals("test", compositeData.get(SYMBOLIC_NAME));
        assertEquals("0.0.0", (String) compositeData.get(VERSION));
        TabularData headerTable = (TabularData) compositeData.get(HEADERS);
        assertEquals(4, headerTable.values().size());
        CompositeData header = headerTable.get(new Object[]{Constants.BUNDLE_SYMBOLICNAME});
        assertNotNull(header);
        String value = (String) header.get(VALUE);
        assertEquals("test", value);
        String key = (String)header.get(KEY);
View Full Code Here

        assertNotNull(cpid);
        assertTrue(cpid.contains("jmx.test.B.factory"));
       
        TabularData fConfig = mbean.getProperties(cpid);
        assertNotNull(fConfig);
        assertEquals(0, fConfig.values().size());
       
        PropertyData<String> prop1 = PropertyData.newInstance("B1", "value1");
        fConfig.put(prop1.toCompositeData());
        PropertyData<Boolean> prop2 = PropertyData.newInstance("B2", true);
        fConfig.put(prop2.toCompositeData());
View Full Code Here

        assertTrue("Should find bundles importing org.osgi.jmx.framework", importingBundlesId.length > 0);

        TabularData table = packagaState.listPackages();
        assertNotNull("TabularData containing CompositeData with packages info shouldn't be null", table);
        assertEquals("TabularData should be a type PACKAGES", PackageStateMBean.PACKAGES_TYPE, table.getTabularType());
        Collection colData = table.values();
        assertNotNull("Collection of CompositeData shouldn't be null", colData);
        assertFalse("Collection of CompositeData should contain elements", colData.isEmpty());

        boolean isRemovalPending = packagaState.isRemovalPending("org.osgi.jmx.framework", "1.5.0", exportingBundles[0]);
        assertFalse("Should removal pending on org.osgi.jmx.framework be false", isRemovalPending);
View Full Code Here

        // test list information
       
        TabularData data = mbean.listInformation();
        assertNotNull(data);
        assertEquals(JmxConstants.PROPERTIES_TYPE, data.getTabularType());
        assertTrue(data.values().size() >= 1);
        PropertyData<byte[]> configEntry = PropertyData.from(data.get(new Object[] {PROVISIONING_AGENT_CONFIG }));
        assertNotNull(configEntry);
        assertArrayEquals(new byte[] { 10, 20, 30 }, configEntry.getValue());

       
View Full Code Here

        TabularData channelsData = getChannelsDataWithRetry(mBean);

        assertEquals("Unexpected number of rows in channel table", 1, channelsData.size());

        @SuppressWarnings("unchecked")
        final Iterator<CompositeDataSupport> rowItr = (Iterator<CompositeDataSupport>) channelsData.values().iterator();
        final CompositeDataSupport row = rowItr.next();
        return row;
    }

    private void receiveMessagesWithoutCommit(final MessageConsumer consumer, int numberOfMessages) throws Exception
View Full Code Here

        assertEquals("Unexpected queue depth", 1, _managedSourceQueue.getMessageCount().intValue());

        // Check the contents of the message
        final TabularData tab = _managedSourceQueue.viewMessages(1l, 1l);
        assertEquals("Unexpected number of rows in table", 1, tab.size());
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();

        final CompositeData row1 = rowItr.next();
        assertNotNull("Message should have AMQ message id", row1.get(ManagedQueue.MSG_AMQ_ID));
        assertEquals("Unexpected queue position", 1l, row1.get(ManagedQueue.MSG_QUEUE_POS));
        assertEquals("Unexpected redelivered flag", Boolean.FALSE, row1.get(ManagedQueue.MSG_REDELIVERED));
View Full Code Here

    private List<Long> getAMQMessageIdsOn(ManagedQueue managedQueue, long startIndex, long endIndex) throws Exception
    {
        final SortedSet<Long> messageIds = new TreeSet<Long>();

        final TabularData tab = managedQueue.viewMessages(startIndex, endIndex);
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();
        while(rowItr.hasNext())
        {
            final CompositeData row = rowItr.next();
            long amqMessageId = (Long)row.get(ManagedQueue.MSG_AMQ_ID);
            messageIds.add(amqMessageId);
View Full Code Here

    public Collection<JobFacade> getScheduledJobs() throws Exception {
        JobSchedulerViewMBean jobScheduler = getJobScheduler();
        List<JobFacade> result = new ArrayList<JobFacade>();
        TabularData table = jobScheduler.getAllJobs();
        for (Object object : table.values()) {
            CompositeData cd = (CompositeData) object;
            JobFacade jf = new JobFacade(cd);
            result.add(jf);
        }
        return result;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.