assertThat(valueCaptor.getValue().getSensorTypeIdent(), is(equalTo(sensorType))); assertThat(valueCaptor.getValue().getJmxSensorDefinitionDataIdentId(), is(equalTo(definitionDataIdentId))); assertThat(valueCaptor.getValue().getValue(), is("[1, 2, 3]"));
assertThat(valueCaptor.getValue().getSensorTypeIdent(), is(equalTo(sensorType))); assertThat(valueCaptor.getValue().getJmxSensorDefinitionDataIdentId(), is(equalTo(definitionDataIdentId))); assertThat(valueCaptor.getValue().getValue(), is(equalTo(value)));
assertThat(valueCaptor.getValue().getSensorTypeIdent(), is(equalTo(sensorType))); assertThat(valueCaptor.getValue().getJmxSensorDefinitionDataIdentId(), is(equalTo(definitionDataIdentId))); assertThat(valueCaptor.getValue().getValue(), is("null"));
assertThat(valueCaptor.getValue().getSensorTypeIdent(), is(equalTo(sensorType))); assertThat(valueCaptor.getValue().getJmxSensorDefinitionDataIdentId(), is(equalTo(definitionDataIdentId))); assertThat(valueCaptor.getValue().getValue(), is("[1, 2, 3]"));
assertThat(valueCaptor.getValue().getSensorTypeIdent(), is(equalTo(sensorType))); assertThat(valueCaptor.getValue().getJmxSensorDefinitionDataIdentId(), is(equalTo(definitionDataIdentId))); assertThat(valueCaptor.getValue().getValue(), is(value));
/** * Returns the styled text for a specific column. * * @param jmxDefinitionDataIdent * The object to extract the information from. * @param data * The object to extract the value information from. * @param enumId * The enumeration ID. * @return The styled string containing the information from the data object. */ private StyledString getStyledTextForColumn(JmxDefinitionDataIdent jmxDefinitionDataIdent, JmxSensorValueData data, Column enumId) { switch (enumId) { case DOMAINNAME: return new StyledString(jmxDefinitionDataIdent.getDerivedDomainName()); case TYPENAME: return new StyledString(jmxDefinitionDataIdent.getDerivedTypeName()); case ATTRIBUTE: return new StyledString(jmxDefinitionDataIdent.getmBeanAttributeName()); case TIMESTAMP: return new StyledString(NumberFormatter.formatTime(data.getTimeStamp())); case VALUE: return new StyledString(data.getValue()); case CHARTING: return emptyStyledString; default: return new StyledString("error"); } }
/** * {@inheritDoc} */ @Override public DetailsTable generate(DefaultData defaultData, RepositoryDefinition repositoryDefinition, Composite parent, FormToolkit toolkit) { JmxSensorValueData jmxSensorData = (JmxSensorValueData) defaultData; JmxDefinitionDataIdent jmxData = repositoryDefinition.getCachedDataService().getJmxDefinitionDataIdentForId(jmxSensorData.getJmxSensorDefinitionDataIdentId()); DetailsTable table = new DetailsTable(parent, toolkit, "MBean Details", 1); table.addContentRow("Domain:", InspectIT.getDefault().getImage(InspectITImages.IMG_PACKAGE), new DetailsCellContent[] { new DetailsCellContent(jmxData.getDerivedDomainName()) }); table.addContentRow("Type:", InspectIT.getDefault().getImage(InspectITImages.IMG_BOOK), new DetailsCellContent[] { new DetailsCellContent(jmxData.getDerivedTypeName()) }); table.addContentRow("Attribute:", InspectIT.getDefault().getImage(InspectITImages.IMG_BLUE_DOCUMENT_TABLE), new DetailsCellContent[] { new DetailsCellContent(jmxData.getmBeanAttributeName()) }); table.addContentRow("Description:", InspectIT.getDefault().getImage(InspectITImages.IMG_INFORMATION), new DetailsCellContent[] { new DetailsCellContent(jmxData.getmBeanAttributeDescription()) }); table.addContentRow("Type:", null, new DetailsCellContent[] { new DetailsCellContent(jmxData.getmBeanAttributeType()) }); table.addContentRow("Value:", null, new DetailsCellContent[] { new DetailsCellContent(jmxSensorData.getValue()) }); table.addContentRow("Readable:", null, new DetailsCellContent[] { new YesNoDetailsCellContent(jmxData.getmBeanAttributeIsReadable()) }); table.addContentRow("Writeable:", null, new DetailsCellContent[] { new YesNoDetailsCellContent(jmxData.getmBeanAttributeIsWritable()) }); table.addContentRow("Is-Getter:", null, new DetailsCellContent[] { new YesNoDetailsCellContent(jmxData.getmBeanAttributeIsIs()) }); return table; } }