Package org.rhq.plugins.jmx.util

Examples of org.rhq.plugins.jmx.util.ObjectNameQueryUtility.formatMessage()


        assert onqu.getVariableProperties().get("name").equals("name");
        ObjectName testON = new ObjectName(
            "jboss.esb.quickstart.destination:service=Queue,name=quickstart_helloworld_Request_gw");
        onqu.setMatchedKeyValues(testON.getKeyPropertyList());
        String formulatedMessageTemplate = "Name of queue: {name}";
        assert onqu.formatMessage(formulatedMessageTemplate).equals("Name of queue: quickstart_helloworld_Request_gw");

        onqu = new ObjectNameQueryUtility("java.lang:type=%MyType%,name=%MyName%,app=%MyApp%,foo=%MyFoo%");
        assert onqu.getTranslatedQuery().equals("java.lang:*");
        assert onqu.getVariableProperties().size() == 4;
        testON = new ObjectName("java.lang:type=A,name=B,app=C,foo=D");
View Full Code Here


        assert onqu.getTranslatedQuery().equals("java.lang:*");
        assert onqu.getVariableProperties().size() == 4;
        testON = new ObjectName("java.lang:type=A,name=B,app=C,foo=D");
        onqu.setMatchedKeyValues(testON.getKeyPropertyList());
        formulatedMessageTemplate = "Type: {MyType}, Name: {MyName}, App: {MyApp}, Foo: {MyFoo}";
        assert onqu.formatMessage(formulatedMessageTemplate).equals("Type: A, Name: B, App: C, Foo: D");

        Configuration c = new Configuration();
        c.put(new PropertySimple("e", "foo"));
        c.put(new PropertySimple("g", "bar"));
        onqu = new ObjectNameQueryUtility("a:b=c,d={e},f={g}", c);
View Full Code Here

        assert onqu.getVariableProperties().size() == 1;
        assert onqu.getVariableProperties().get("name").equals("name");
        testON = new ObjectName("FooBarABCDEFGHIJKLMNOPQRSTUVWXYZ:type=HttpMetricInspector,name=ABCDEFGHIJKLMNOPQRSTUVWXYZ�ABCDEFGHIJKLMNOPQRSTUVWXYZ");
        onqu.setMatchedKeyValues(testON.getKeyPropertyList());
        formulatedMessageTemplate = "Http metrics for endpoint {name}";
        String res = onqu.formatMessage(formulatedMessageTemplate);
        assert res.equals("Http metrics for endpoint ABCDEFGHIJKLMNOPQRSTUVWXYZ�ABCDEFGHIJKLMNOPQRSTUVWXYZ") : res;


    }
View Full Code Here

                    String descriptionTemplate = (pluginConfiguration.getSimple(PROPERTY_DESCRIPTION_TEMPLATE) != null) ? pluginConfiguration
                        .getSimple(PROPERTY_DESCRIPTION_TEMPLATE).getStringValue() : null;

                    String name = resourceKey;
                    if (nameTemplate != null) {
                        name = queryUtility.formatMessage(nameTemplate);
                    }

                    String description = null;
                    if (descriptionTemplate != null) {
                        description = queryUtility.formatMessage(descriptionTemplate);
View Full Code Here

                        name = queryUtility.formatMessage(nameTemplate);
                    }

                    String description = null;
                    if (descriptionTemplate != null) {
                        description = queryUtility.formatMessage(descriptionTemplate);
                    }

                    DiscoveredResourceDetails service = new DiscoveredResourceDetails(resourceType, resourceKey, name,
                        "", description, null, null);
                    Configuration config = service.getPluginConfiguration();
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.