modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java | 6 ++--- modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java | 5 ++-- modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java | 11 +++++++--- modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java | 2 - 4 files changed, 15 insertions(+), 9 deletions(-)
New commits: commit 56f845bec82369f3032b565a8caeed751d1a4093 Author: Heiko W. Rupp hwr@redhat.com Date: Tue Jul 16 10:13:13 2013 +0200
Fix test fallout that got introduced by my changes.
diff --git a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java index 97b9a05..ecc995d 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java +++ b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpInfoTest.java @@ -116,11 +116,11 @@ public class SnmpInfoTest { // String representation is constrained (even not strongly). Configuration configuration = new Configuration(); assertEquals(SnmpInfo.load(configuration).toString(), "UnknownHost:" + DEFAULT_PORT - + " (UnknownOID) (DefaultTrapOID)"); + + " (Unknown Binding Prefix) (DefaultTrapOID)"); configuration.setSimpleValue(PARAM_HOST, "pipo"); - assertEquals(SnmpInfo.load(configuration).toString(), "pipo:" + DEFAULT_PORT + " (UnknownOID) (DefaultTrapOID)"); + assertEquals(SnmpInfo.load(configuration).toString(), "pipo:" + DEFAULT_PORT + " (Unknown Binding Prefix) (DefaultTrapOID)"); configuration.setSimpleValue(PARAM_PORT, "35162"); - assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (UnknownOID) (DefaultTrapOID)"); + assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (Unknown Binding Prefix) (DefaultTrapOID)"); configuration.setSimpleValue(PARAM_VARIABLE_BINDING_PREFIX, "molo"); assertEquals(SnmpInfo.load(configuration).toString(), "pipo:35162 (molo) (DefaultTrapOID)"); configuration.setSimpleValue(PARAM_TRAP_OID, "logo"); diff --git a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java index 38b36d7..9583a07 100644 --- a/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java +++ b/modules/enterprise/server/plugins/alert-snmp/src/test/java/org/rhq/enterprise/server/plugins/alertSnmp/SnmpSenderTest.java @@ -95,6 +95,7 @@ public class SnmpSenderTest { private AlertManagerLocal alertManager;
private TestSnmpSender snmpSender; + private Configuration pluginConfiguration;
@BeforeMethod public void setUp() throws Exception { @@ -114,7 +115,7 @@ public class SnmpSenderTest {
MockitoAnnotations.initMocks(this);
- Configuration pluginConfiguration = new Configuration(); + pluginConfiguration = new Configuration(); pluginConfiguration.setSimpleValue("snmpVersion", "2c"); pluginConfiguration.setSimpleValue("trapOid", TEST_TRAP_OID_PLUGIN_CONFIG); pluginConfiguration.setSimpleValue("community", "public"); @@ -153,7 +154,7 @@ public class SnmpSenderTest { assertNotNull(result); assertEquals(result.getState(), FAILURE); assertEquals(result.getFailureMessages().size(), 1); - String expectedError = SnmpInfo.load(alertParameters).error; + String expectedError = SnmpInfo.load(alertParameters,pluginConfiguration).error; assertNotNull(expectedError); assertEquals(result.getFailureMessages().get(0), expectedError); }
commit 609c93f0d219afd19db976d55c565c95bb96d1ab Author: Heiko W. Rupp hwr@redhat.com Date: Mon Jul 15 11:03:05 2013 +0200
Display tool tips, for pick button and choice boxes
diff --git a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java index 06f3fec..e7da952 100644 --- a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java +++ b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Generator.java @@ -210,11 +210,13 @@ public class Generator extends Application{ choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observableValue, String s, String newValue) { - setPropsValue(prop.getVariableName(),newValue.equals("Yes"),propType); + setPropsValue(prop.getVariableName(), newValue.equals("Yes"), propType); } }); + Tooltip tooltip = new Tooltip(prop.getDescription()); // TODO make this a hover listener + choiceBox.setTooltip(tooltip);
- root.add(choiceBox,1,row); + root.add(choiceBox, 1, row); } else if (propType.equals(ResourceCategory.class)) { final ChoiceBox choiceBox = new ChoiceBox(); for (ResourceCategory cat : ResourceCategory.values()) { @@ -228,14 +230,17 @@ public class Generator extends Application{ setPropsValue(prop.getVariableName(),newCategory,propType); } }); - + Tooltip tooltip = new Tooltip(prop.getDescription()); // TODO make this a hover listener + choiceBox.setTooltip(tooltip); root.add(choiceBox,1,row); } else if (propType.equals(File.class)) { // Can not add this directly, so add a button to trigger it final Text text = new Text(); text.setText("Pick a directory"); root.add(text,1,row); + Tooltip tooltip = new Tooltip("Pick the (parent) directory where the plugin will be put in."); Button pickButton = new Button("Pick"); + pickButton.setTooltip(tooltip); pickButton.setOnAction(new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent actionEvent) { diff --git a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java index 73c4cd9..4ed019a 100644 --- a/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java +++ b/modules/helpers/pluginGen/src/main/java/org/rhq/helpers/pluginGen/Prop.java @@ -38,7 +38,7 @@ public enum Prop { DESCRIPTION("description", String.class, "Description of the type", ".*"), DISCOVERY_CLASS("discoveryClass", String.class, "Discovery class", "[A-Z][a-zA-Z0-9]*"), COMPONENT_CLASS("componentClass", String.class, "Discovery class", "[A-Z][a-zA-Z0-9]*"), - IS_SINGLETON("singleton",Boolean.class,"Is this type a singleton, which means that" + + IS_SINGLETON("singleton",boolean.class,"Is this type a singleton, which means that" + " there can only be one resource of that type for the given parent?",null), HAS_METRICS("hasMetrics",boolean.class,"Does this type support taking metrics?",null), HAS_OPERATIONS("hasOperations",boolean.class,"Does this type support operations?",null),
rhq-commits@lists.fedorahosted.org