modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java | 3 modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java | 14 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java | 12 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java | 34 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java | 57 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_de.properties | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_fr.properties | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java | 52 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java | 35 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java | 114 --- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestPluralizationView.java | 62 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java | 43 - modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 4 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties | 13 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 4 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 12 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 4 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties | 4 modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 4 modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml | 8 modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/shared/ServerProperties.java | 4 modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp | 307 +-------- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 6 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessBean.java | 233 ------- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessLocal.java | 48 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestBean.java | 69 -- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestLocal.java | 30 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestBean.java | 109 --- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestLocal.java | 37 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java | 325 ---------- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestLocal.java | 43 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java | 270 -------- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java | 37 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java | 89 -- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java | 28 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java | 50 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java | 32 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestBean.java | 151 ++++ modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestLocal.java | 35 + modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java | 51 - 41 files changed, 299 insertions(+), 2142 deletions(-)
New commits: commit 1252ba67b26dd87dd62bc9367725f6e210d45077 Author: John Mazzitelli mazz@redhat.com Date: Tue Sep 25 16:38:58 2012 -0400
use the new property names
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/shared/ServerProperties.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/shared/ServerProperties.java index 1236024..9dcd5d5 100644 --- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/shared/ServerProperties.java +++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/client/shared/ServerProperties.java @@ -40,8 +40,8 @@ public class ServerProperties { public static final String PROP_QUARTZ_SELECT_WITH_LOCK_SQL = "rhq.server.quartz.selectWithLockSQL"; public static final String PROP_QUARTZ_LOCK_HANDLER_CLASS = "rhq.server.quartz.lockHandlerClass";
- public static final String PROP_WEB_HTTP_PORT = "rhq.server.startup.web.http.port"; - public static final String PROP_WEB_HTTPS_PORT = "rhq.server.startup.web.https.port"; + public static final String PROP_WEB_HTTP_PORT = "rhq.server.socket.binding.port.http"; + public static final String PROP_WEB_HTTPS_PORT = "rhq.server.socket.binding.port.https";
public static final String PROP_EMBEDDED_AGENT_ENABLED = "rhq.server.embedded-agent.enabled"; public static final String PROP_EMBEDDED_AGENT_NAME = "rhq.server.embedded-agent.name";
commit ac196c5dd91b91c3abfbd63b048f385689f3c2e3 Author: John Mazzitelli mazz@redhat.com Date: Tue Sep 25 16:38:46 2012 -0400
clean up test pages and put server name in system settings this commit is broken - i'll be committing fixes shortly
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java index ea518e4..4e11982 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java @@ -48,7 +48,8 @@ public class ServerDetails implements Serializable { SERVER_INSTALL_DIR, // where RHQ is installed, the top directory where everything else is SERVER_HOME_DIR, // where the RHQ server's JBossAS deployment is; this is under the install dir CURRENT_MEASUREMENT_TABLE, // - NEXT_MEASUREMENT_TABLE_ROTATION; + NEXT_MEASUREMENT_TABLE_ROTATION, // + SERVER_IDENTITY; };
private HashMap<Detail, String> details = new HashMap<Detail, String>(Detail.values().length); diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java b/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java index f412549..fa08d88 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/server/PersistenceUtility.java @@ -369,6 +369,18 @@ public class PersistenceUtility { * first one in the list returned by MBeanServerFactory.findMBeanServer(null) is used */ public static void enableHibernateStatistics(EntityManager entityManager, MBeanServer server) { + enableHibernateStatistics(entityManager, server, true); + } + + /** + * Enables the hibernate statistics mbean to provide access to information on the ejb3 persistence tier. + * + * @param entityManager an inject entity manager whose session factory will be tracked with these statistics + * @param server the MBeanServer where the statistics MBean should be registered; if <code>null</code>, the + * first one in the list returned by MBeanServerFactory.findMBeanServer(null) is used + * @param flag true if the stats are to be enabled; false to disable the stats + */ + public static void enableHibernateStatistics(EntityManager entityManager, MBeanServer server, boolean flag) { try { SessionFactory sessionFactory = PersistenceUtility.getHibernateSession(entityManager).getSessionFactory();
@@ -381,7 +393,7 @@ public class PersistenceUtility { StatisticsService mBean = new StatisticsService(); mBean.setSessionFactory(sessionFactory); server.registerMBean(mBean, objectName); - sessionFactory.getStatistics().setStatisticsEnabled(true); + sessionFactory.getStatistics().setStatisticsEnabled(flag); } catch (InstanceAlreadyExistsException iaee) { LOG.info("Duplicate mbean registration ignored: " + HIBERNATE_STATISTICS_MBEAN_OBJECTNAME); } catch (Exception e) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java index 4879297..0cd25b7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/SystemSettingsView.java @@ -568,11 +568,14 @@ public class SystemSettingsView extends LocatableVLayout implements PropertyValu form.setIsGroup(true); form.setGroupTitle(MSG.view_admin_systemSettings_serverDetails());
- final StaticTextItem productName = new StaticTextItem("productname", MSG.common_title_name()); + final StaticTextItem productName = new StaticTextItem("productname", + MSG.view_admin_systemSettings_serverDetails_productName()); final StaticTextItem productVersion = new StaticTextItem("productversion", MSG.common_title_version()); final StaticTextItem productBuildNumber = new StaticTextItem("productbuild", MSG.view_admin_systemSettings_serverDetails_buildNumber());
+ final StaticTextItem serverName = new StaticTextItem("servername", + MSG.view_admin_systemSettings_serverDetails_serverName()); final StaticTextItem serverTimezone = new StaticTextItem("timezone", MSG.view_admin_systemSettings_serverDetails_tz()); final StaticTextItem serverTime = new StaticTextItem("localtime", @@ -596,6 +599,7 @@ public class SystemSettingsView extends LocatableVLayout implements PropertyValu productName.setWrapTitle(false); productVersion.setWrapTitle(false); productBuildNumber.setWrapTitle(false); + serverName.setWrapTitle(false); serverTimezone.setWrapTitle(false); serverTime.setWrapTitle(false); serverInstallDir.setWrapTitle(false); @@ -607,9 +611,9 @@ public class SystemSettingsView extends LocatableVLayout implements PropertyValu currentMeasRawTable.setWrapTitle(false); nextMeasTableRotation.setWrapTitle(false);
- form.setItems(productName, productVersion, productBuildNumber, serverTimezone, serverTime, serverInstallDir, - dbUrl, dbProductName, dbProductVersion, dbDriverName, dbDriverVersion, currentMeasRawTable, - nextMeasTableRotation); + form.setItems(productName, productVersion, productBuildNumber, serverName, serverTimezone, serverTime, + serverInstallDir, dbUrl, dbProductName, dbProductVersion, dbDriverName, dbDriverVersion, + currentMeasRawTable, nextMeasTableRotation);
GWTServiceLookup.getSystemService().getServerDetails(new AsyncCallback<ServerDetails>() {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java index b1289e4..3f18ae8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/GWTServiceLookup.java @@ -198,10 +198,6 @@ public class GWTServiceLookup { return secure(AgentGWTServiceAsync.Util.getInstance()); }
- public static TestGWTServiceAsync getTestService() { - return secure(TestGWTServiceAsync.Util.getInstance()); - } - public static PlatformUtilizationGWTServiceAsync getPlatformUtilizationService() { return secure(PlatformUtilizationGWTServiceAsync.Util.getInstance()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java deleted file mode 100644 index 168edfa..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/gwt/TestGWTService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2011 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.gui.coregui.client.gwt; - -import com.google.gwt.user.client.rpc.RemoteService; - -/** - * @author Ian Springer - */ -public interface TestGWTService extends RemoteService { - - void sleep(int seconds) throws RuntimeException; - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java deleted file mode 100644 index 9bf4676..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.i18n; - -import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale; -import com.google.gwt.i18n.client.Messages; - -/* - * @PluralText takes an array of strings. The even indexes represent plural form names, while the odd indexes - * correspond to the text for the associated plural form. Example: - * - * @PluralText( { "one", "There is a single item in your cart.", - * "two", "There are two items in your cart.", - * "few", "There are a few items in your cart.", - * "many", "There are many items in your cart." } ) - * - * As of GWT 2.0.4, the following plural forms exist: - * - * none one two eighteleven - * few paucal many other - * - * However, not all of them are applicable to each locale. When implementing a new localization, refer to the - * appropriate subclass of "com.google.gwt.i18n.client.impl.plurals.DefaultRule" to obtain the necessary plural - * form subset which must be implemented to correctly support that locale. - * - * The rules implemented in these various subclasses are taken from: - * - * http://translate.sourceforge.net/wiki/l10n/pluralforms - */ -@DefaultLocale("en") -public interface TestMessages extends Messages { - - /** - * @param subject the name of the user - * @param cartItems the number of cart items - * @return a message specifying the number of items in the user's cart - */ - @DefaultMessage("{0}, there are {1,number} items in your cart") - @AlternateMessage({ "one", "{0}, there is {1,number} item in your cart" }) - String cartLabel(String subject, @PluralCount int cartItems); -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_de.properties b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_de.properties deleted file mode 100644 index 2a8b4b8..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_de.properties +++ /dev/null @@ -1,2 +0,0 @@ -cartLabel = {0}, there are {1} items in your German cart -cartLabel[one] = {0}, there is {1} item in your German cart \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_fr.properties b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_fr.properties deleted file mode 100644 index 1ff16a6..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/i18n/TestMessages_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -cartLabel = {0}, there are {1} items in your French cart -cartLabel[one] = {0}, there is {1} item in your French cart \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java deleted file mode 100644 index b3c333f..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestRpcView.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.rhq.enterprise.gui.coregui.client.test; - -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.ButtonItem; -import com.smartgwt.client.widgets.form.fields.FormItem; -import com.smartgwt.client.widgets.form.fields.events.ClickEvent; -import com.smartgwt.client.widgets.form.fields.events.ClickHandler; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; -import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTServiceAsync; -import org.rhq.enterprise.gui.coregui.client.util.message.Message; -import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout; - -/** - * @author Ian Springer - */ -public class TestRpcView extends LocatableVLayout { - - public TestRpcView(String locatorId) { - super(locatorId); - setMargin(10); - - DynamicForm form = new DynamicForm(); - form.setWidth(400); - - final FormItem item = new FormItem("seconds"); - item.setTitle("Seconds to sleep"); - item.setRequired(true); - - ButtonItem button = new ButtonItem("execute", "Execute"); - button.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - TestGWTServiceAsync testService = GWTServiceLookup.getTestService(); - final int seconds = Integer.valueOf((String)item.getValue()); - testService.sleep(seconds, new AsyncCallback<Void>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("sleep(" + seconds + ") RPC call failed.", caught); - } - - public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("sleep(" + seconds + ") RPC completed.")); - } - }); - } - }); - form.setItems(item, button); - - addMember(form); - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java index 27ee554..ae1f0f7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/TestTopView.java @@ -33,12 +33,10 @@ import org.rhq.enterprise.gui.coregui.client.components.view.ViewFactory; import org.rhq.enterprise.gui.coregui.client.components.view.ViewName; import org.rhq.enterprise.gui.coregui.client.inventory.resource.selection.ResourceSelector; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeTreeView; -import org.rhq.enterprise.gui.coregui.client.test.async.TestAsyncView; import org.rhq.enterprise.gui.coregui.client.test.configuration.TestConfigurationView; import org.rhq.enterprise.gui.coregui.client.test.configuration.TestGroupConfigurationView; import org.rhq.enterprise.gui.coregui.client.test.configuration.TestReadOnlyConfigurationView; import org.rhq.enterprise.gui.coregui.client.test.configuration.TestReadOnlyGroupConfigurationView; -import org.rhq.enterprise.gui.coregui.client.test.i18n.TestPluralizationView; import org.rhq.enterprise.gui.coregui.client.test.inventory.TestSearchBarView; import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
@@ -71,6 +69,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView { private static final ViewName PAGE_SQL = new ViewName("SQL"); private static final ViewName PAGE_HIBERNATE = new ViewName("Hibernate"); private static final ViewName PAGE_ENTITY_BROWSER = new ViewName("EntityBrowser"); + private static final ViewName PAGE_ADMIN_CONTROL = new ViewName("AdminControl"); private static final ViewName PAGE_EMAIL = new ViewName("EmailTest"); private static final ViewName PAGE_AGENT = new ViewName("AgentConnectivityTest"); private static final ViewName PAGE_USER_PREFERENCES = new ViewName("UserPreferences"); @@ -78,10 +77,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView { // view IDs for Misc section private static final ViewName MISC_SECTION_VIEW_ID = new ViewName("Misc"); private static final ViewName PAGE_MESSAGE_CENTER_TEST = new ViewName("MessageCenterTest"); - private static final ViewName PAGE_PLURALIZATION_TEST = new ViewName("PluralizationTest"); private static final ViewName PAGE_NUMBER_FORMAT_TEST = new ViewName("NumberFormatTest"); - private static final ViewName PAGE_ASYNC = new ViewName("Async"); - private static final ViewName PAGE_RPC = new ViewName("Rpc");
public TestTopView() { // This is a top level view, so our locator id can simply be our view id. @@ -209,6 +205,12 @@ public class TestTopView extends AbstractSectionedLeftNavigationView { } });
+ NavigationItem adminControlItem = new NavigationItem(PAGE_ADMIN_CONTROL, null, new ViewFactory() { + public Canvas createView() { + return new FullHTMLPane(extendLocatorId(PAGE_ADMIN_CONTROL.getName()), "/admin/test/control.jsp"); + } + }); + NavigationItem emailItem = new NavigationItem(PAGE_EMAIL, null, new ViewFactory() { public Canvas createView() { return new FullHTMLPane(extendLocatorId(PAGE_EMAIL.getName()), "/admin/test/email.jsp"); @@ -222,7 +224,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView { });
return new NavigationSection(SERVERACCESS_SECTION_VIEW_ID, remoteServiceStatisticsItem, sqlItem, hibernateItem, - entityBrowserItem, emailItem, agentItem, userPrefsItem); + entityBrowserItem, adminControlItem, emailItem, agentItem, userPrefsItem); }
private NavigationSection buildMiscSection() { @@ -238,26 +240,7 @@ public class TestTopView extends AbstractSectionedLeftNavigationView { } });
- NavigationItem pluralizationItem = new NavigationItem(PAGE_PLURALIZATION_TEST, null, new ViewFactory() { - public Canvas createView() { - return new TestPluralizationView(extendLocatorId(PAGE_PLURALIZATION_TEST.getName())); - } - }); - - NavigationItem asyncItem = new NavigationItem(PAGE_ASYNC, null, new ViewFactory() { - public Canvas createView() { - return new TestAsyncView(extendLocatorId(PAGE_ASYNC.getName())); - } - }); - - NavigationItem rpcItem = new NavigationItem(PAGE_RPC, null, new ViewFactory() { - public Canvas createView() { - return new TestRpcView(extendLocatorId(PAGE_RPC.getName())); - } - }); - - return new NavigationSection(MISC_SECTION_VIEW_ID, messageCenterItem, numberFormatItem, pluralizationItem, - asyncItem, rpcItem); + return new NavigationSection(MISC_SECTION_VIEW_ID, messageCenterItem, numberFormatItem); }
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java deleted file mode 100644 index b914680..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/async/TestAsyncView.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.rhq.enterprise.gui.coregui.client.test.async; - -import com.google.gwt.user.client.Timer; -import com.smartgwt.client.widgets.IButton; -import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.layout.HLayout; -import org.rhq.core.domain.authz.Permission; -import org.rhq.enterprise.gui.coregui.client.CoreGUI; -import org.rhq.enterprise.gui.coregui.client.PermissionsLoadedListener; -import org.rhq.enterprise.gui.coregui.client.PermissionsLoader; -import org.rhq.enterprise.gui.coregui.client.util.async.AsyncOperation; -import org.rhq.enterprise.gui.coregui.client.util.async.AsyncOperationCallback; -import org.rhq.enterprise.gui.coregui.client.util.async.ParallelCompoundAsyncOperation; -import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout; - -import java.util.Map; -import java.util.Set; - -/** - * @author Ian Springer - */ -public class TestAsyncView extends LocatableVLayout implements AsyncOperationCallback<Map<AsyncOperation, Object>> { - - private AsyncOperation globalPermsAsyncOperation; - private AsyncOperation resourcePermsAsyncOperation; - private Set<Permission> globalPerms; - private Set<Permission> resourcePerms; - private Label label; - private HLayout buttonBar; - private IButton button1; - private IButton button2; - - public TestAsyncView(String locatorId) { - super(locatorId); - setMargin(10); - - final ParallelCompoundAsyncOperation compoundAsyncOperation = new ParallelCompoundAsyncOperation(); - - this.globalPermsAsyncOperation = new AsyncOperation() { - public void execute(final AsyncOperationCallback callback, Object... params) { - new PermissionsLoader().loadExplicitGlobalPermissions(new PermissionsLoadedListener() { - public void onPermissionsLoaded(Set<Permission> permissions) { - globalPerms = permissions; - Timer timer = new Timer() { - public void run() { - callback.onSuccess(globalPermsAsyncOperation, globalPerms); - } - }; - timer.schedule(1000); - } - }); - } - }; - compoundAsyncOperation.addOperation(this.globalPermsAsyncOperation); - - this.resourcePermsAsyncOperation = new AsyncOperation() { - public void execute(final AsyncOperationCallback callback, Object... params) { - new PermissionsLoader().loadResourcePermissions(10001, new PermissionsLoadedListener() { - public void onPermissionsLoaded(Set<Permission> permissions) { - resourcePerms = permissions; - Timer timer = new Timer() { - public void run() { - callback.onSuccess(resourcePermsAsyncOperation, resourcePerms); - } - }; - timer.schedule(2000); - } - }); - } - }; - compoundAsyncOperation.addOperation(this.resourcePermsAsyncOperation); - - compoundAsyncOperation.execute(this); - - this.label = new Label("Loading..."); - addMember(this.label); - - this.buttonBar = new HLayout(); - this.buttonBar.setMargin(15); - this.buttonBar.setMembersMargin(5); - this.buttonBar.setVisible(false); - - this.button1 = new IButton("Do Action requiring MANAGE_SECURITY"); - this.button1.setWidth(220); - this.button1.setDisabled(true); - this.buttonBar.addMember(this.button1); - - this.button2 = new IButton("Do Action requiring CONFIGURE_WRITE on platform Resource"); - this.button2.setWidth(320); - this.button2.setDisabled(true); - this.buttonBar.addMember(this.button2); - - addMember(this.buttonBar); - } - - public void onSuccess(AsyncOperation operation, Map<AsyncOperation, Object> result) { - this.label.hide(); - - if (this.globalPerms.contains(Permission.MANAGE_SECURITY)) { - this.button1.enable(); - } - - if (this.resourcePerms.contains(Permission.CONFIGURE_WRITE)) { - this.button2.enable(); - } - - this.buttonBar.show(); - } - - public void onFailure(AsyncOperation operation, Throwable caught) { - CoreGUI.getErrorHandler().handleError("Async init failed.", caught); - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestPluralizationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestPluralizationView.java deleted file mode 100644 index fa237ef..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/test/i18n/TestPluralizationView.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2010 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.gui.coregui.client.test.i18n; - -import com.google.gwt.core.client.GWT; -import com.smartgwt.client.widgets.Label; - -import org.rhq.enterprise.gui.coregui.client.i18n.TestMessages; -import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout; - -/** - * A test class to show how GWT-based i18n can support pluralization - * - * @author Joseph Marques - */ -public class TestPluralizationView extends LocatableVLayout { - - public TestPluralizationView(String locatorId) { - super(locatorId); - } - - @Override - protected void onDraw() { - super.onDraw(); - build(); - } - - public void build() { - TestMessages testMessages = GWT.create(TestMessages.class); - - StringBuilder text = new StringBuilder(); - String subject = "rhqadmin"; - for (int cartItems = 0; cartItems < 5; cartItems++) { - if (cartItems != 0) { - text.append("<br/>"); - } - String nextText = "Count " + cartItems + " --> " + testMessages.cartLabel(subject, cartItems); - text.append(nextText); - } - - Label label = new Label(text.toString()); - label.setWrap(false); - addMember(label); - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java deleted file mode 100644 index 8f9a518..0000000 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/TestGWTServiceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2011 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.gui.coregui.server.gwt; - -import org.rhq.enterprise.gui.coregui.client.gwt.TestGWTService; - -/** - * @author Ian Springer - */ -public class TestGWTServiceImpl extends AbstractGWTServiceImpl implements TestGWTService { - - private static final long serialVersionUID = 1L; - - public void sleep(int seconds) throws RuntimeException { - try { - Thread.sleep(seconds * 1000); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw getExceptionToThrowToClient(e); - } - } - -} diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties index 4002fc7..ea414e3 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties @@ -568,8 +568,8 @@ view_admin_downloads_connectors_loadError = Cannot get connectors info view_admin_downloads_connectors_none = No connectors are available for download view_admin_downloads_scriptModulesDownload = Script Modules Download view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -view_admin_downloads_scriptModules_none = No script modules are available for download view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +view_admin_downloads_scriptModules_none = No script modules are available for download view_admin_landing = From this section, the {0} global settings can be administered. This includes configuring security, setting up plugins, and managing {0} Servers and Agents. view_admin_measTemplates_updateExisting_title = Update Existing Schedules view_admin_measTemplates_updateExisting_tooltip = Check this box to update the collection schedules for the selected metrics on all existing resources of this type. If this is not checked, the template schedules will only be applied to new resources of this type that are added to inventory in the future. @@ -699,6 +699,8 @@ view_admin_systemSettings_serverDetails_dbUrl = Database Connection URL view_admin_systemSettings_serverDetails_dbVersion = Database Product Version view_admin_systemSettings_serverDetails_installDir = Server Installation Directory view_admin_systemSettings_serverDetails_nextRotation = Next Measurement Table Rotation +view_admin_systemSettings_serverDetails_productName = Product Name +view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = Server Local Time view_admin_systemSettings_serverDetails_tz = Server Time Zone view_admin_topology = Topology diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties index ac127b4..7355db0 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties @@ -432,10 +432,10 @@ filter_from_date = Od filter_to_date = Do group_tree_groupOfResourceType = Skupina: [{0}] group_tree_partialClusterTooltip = {0} z {1} členů skupiny má "{2}" zdroj -##search_invalid_search_expression = Invalid search expression. -##search_failed_to_save_search = Failed to Save Search: {0} ##search_failed_to_retrieve_saved_search = Failed to retrieve saved search ##search_failed_to_retrieve_search_suggestion = Failed to retrieve search suggestion +##search_failed_to_save_search = Failed to Save Search: {0} +##search_invalid_search_expression = Invalid search expression. ##search_name_your_search = name you search ##search_successfully_saved_search = Successfully Saved Search: {0} util_ancestry_parentAncestry = Původ rodiče pro: @@ -587,8 +587,8 @@ view_admin_downloads_connectors_loadError = Nelze získat informace o konektorec view_admin_downloads_connectors_none = Žádné konektory nejsou dostupné pro stažení ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_landing = From this section, the {0} global settings can be administered. This includes configuring security, setting up plugins, and managing {0} Servers and Agents. view_admin_measTemplates_updateExisting_title = Změnit existující rozvrhy ##view_admin_measTemplates_updateExisting_tooltip = Check this box to update the collection schedules for the selected metrics on all existing resources of this type. If this is not checked, the template schedules will only be applied to new resources of this type that are added to inventory in the future. @@ -718,6 +718,8 @@ view_admin_systemSettings_serverDetails_dbUrl = URL pro připojení do databáze view_admin_systemSettings_serverDetails_dbVersion = Verze databáze view_admin_systemSettings_serverDetails_installDir = Instalační adresář serveru view_admin_systemSettings_serverDetails_nextRotation = Příští rotace tabulky měření +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = Lokální čas serveru view_admin_systemSettings_serverDetails_tz = Časová zóna serveru view_admin_topology = Topologie @@ -1149,7 +1151,6 @@ view_bundle_list_deletesSuccessful = Úspěšně jste smazali balíky view_bundle_list_destinationsCount = Počet cílů view_bundle_list_error1 = Nepodařilo se načíst balík k nasazení [{0}] view_bundle_list_error2 = Nepodařilo se získat 1 balík k nasazení [{0}] -view_bundle_list_error3 = Nepodařilo se získat balík view_bundle_list_error3 = V tomto repozitáři nejsou žádné balíky view_bundle_list_loadFailure = Nepodařilo se získat balík k nasazení [{0}] view_bundle_list_loadWithLatestFailure = Nepodařilo se získat balík s poslední verzí @@ -1206,7 +1207,7 @@ view_configEdit_error_3 = Nelze přidat vlastnost nazvanou [{0}]. Jméno té vla view_configEdit_files = Soubory view_configEdit_hideAll = Skrýt vše view_configEdit_jumpToSection = Přejít na sekci -##view_configEdit_maxBoundsExceeded = Cannot add another entry because the maximum size bounds has been met: {0} +##view_configEdit_maxBoundsExceeded = Cannot add another entry because the maximum size bounds has been met: {0} ##view_configEdit_minBoundsExceeded = Cannot delete this entry as the minimum has been set to: {0} view_configEdit_msg_1 = Přidána vlastnost [{0}] view_configEdit_msg_2 = Vlastnost odebrána z množiny. @@ -1446,9 +1447,9 @@ view_groupCreateWizard_createSuccessful_full = Vytvořili jste novou [{0}] skupi view_groupCreateWizard_membersStepName = Vybrat členy view_groupCreateWizard_title = Vytvořit skupinu view_groupCreateWizard_windowTitle = Vytvořit skupinu -view_group_common_emptyGroup = Prázndá skupina je vždy považována jako smíšená. view_groupInventoryMembers_button_updateMembership = Upravit členství... view_groupInventoryMembers_title_updateMembership = Upravit členství +view_group_common_emptyGroup = Prázndá skupina je vždy považována jako smíšená. view_group_detail_failLoad = Nepodařilo se načíst skupinu s ID [{0}] view_group_detail_failLoadComp = Skupina s id [{0}] neexistuje nebo není přístupná view_group_detail_failRecursiveChange = Nepodařilo se změnit rekurzivní nastavení pro skupinu [{0}] diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties index 7f3fafa..bb21e54 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties @@ -535,8 +535,8 @@ view_admin_downloads_cli_version = Version des CLI ##view_admin_downloads_connectors_none = No connectors are available for download ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download view_admin_landing = In dieser Sektion können die globalen Einstellungen für {0} verwaltet werden. Dies schließt Sicherheitseinstellungen und Plugins ein, sowie die Verwaltung der {0} Server- und Agentplugins. view_admin_measTemplates_updateExisting_title = Existierende Zeitpläne aktualisieren ##view_admin_measTemplates_updateExisting_tooltip = Check this box to update the collection schedules for the selected metrics on all existing resources of this type. If this is not checked, the template schedules will only be applied to new resources of this type that are added to inventory in the future. @@ -611,6 +611,8 @@ view_admin_systemSettings_serverDetails_dbUrl = URL der Datenbankverbindung view_admin_systemSettings_serverDetails_dbVersion = Produktversion der Datenbank view_admin_systemSettings_serverDetails_installDir = Installationsverzeichnis des Servers view_admin_systemSettings_serverDetails_nextRotation = Nächste Rotation der Metrik-Tabellen +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = Lokale Zeit des Servers view_admin_systemSettings_serverDetails_tz = Zeitzone des Servers view_admin_topology = Topologie diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties index ad760f9..f6c77fc 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties @@ -410,10 +410,10 @@ filter_from_date = 開始 filter_to_date = 終了 ##group_tree_groupOfResourceType = Group of [{0}] group_tree_partialClusterTooltip = {1} の中の {0} グループメンバーが ''{2}'' リソースを持っています -##search_invalid_search_expression = Invalid search expression. -##search_failed_to_save_search = Failed to Save Search: {0} ##search_failed_to_retrieve_saved_search = Failed to retrieve saved search ##search_failed_to_retrieve_search_suggestion = Failed to retrieve search suggestion +##search_failed_to_save_search = Failed to Save Search: {0} +##search_invalid_search_expression = Invalid search expression. ##search_name_your_search = name you search ##search_successfully_saved_search = Successfully Saved Search: {0} util_ancestry_parentAncestry = 親の先祖 : @@ -566,8 +566,8 @@ view_admin_downloads_connectors_loadError = コネクター情報を取得でき view_admin_downloads_connectors_none = ダウンロードのためのコネクターが見つかりません ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download view_admin_landing = このセクションにおいて、{0}グローバル設定が管理されます。これはセキュリティ構成、プラグイン設定、RHQサーバーとエージェントの管理を含みます。 view_admin_measTemplates_updateExisting_title = 既存スケジュールの更新 view_admin_measTemplates_updateExisting_tooltip = このボックスをチェックすると、このタイプのすべてのリソースを対象に選択したメトリックスの収集スケジュールを更新します。もしこれがチェックされていなければ、テンプレートスケジュールが将来的にインベントリに追加されるこのタイプの新規リソースに適用されるだけです。 @@ -693,6 +693,8 @@ view_admin_systemSettings_serverDetails_dbUrl = データベースコネクシ view_admin_systemSettings_serverDetails_dbVersion = データベースプロダクトバージョン view_admin_systemSettings_serverDetails_installDir = サーバーインストールディレクトリ view_admin_systemSettings_serverDetails_nextRotation = 次の測定テーブルの交代 +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = サーバーローカル時刻 view_admin_systemSettings_serverDetails_tz = サーバータイムゾーン view_admin_topology = トポロジー @@ -1183,7 +1185,7 @@ view_configEdit_error_3 = [{0}] という名前のプロパティを追加でき view_configEdit_files = ファイル view_configEdit_hideAll = すべて隠す view_configEdit_jumpToSection = セクションへのジャンプ -##view_configEdit_maxBoundsExceeded = Cannot add another entry because the maximum size bounds has been met: {0} +##view_configEdit_maxBoundsExceeded = Cannot add another entry because the maximum size bounds has been met: {0} ##view_configEdit_minBoundsExceeded = Cannot delete this entry as the minimum has been set to: {0} view_configEdit_msg_1 = プロパティ [{0}] をセットに追加しました view_configEdit_msg_2 = セットからプロパティを取り除きました @@ -1416,9 +1418,9 @@ view_groupCreateWizard_createSuccessful_full = [{2}] メンバーリソースを view_groupCreateWizard_membersStepName = メンバーの選択 view_groupCreateWizard_title = グループ作成 view_groupCreateWizard_windowTitle = グループ作成 -##view_group_common_emptyGroup = An empty group is always considered as mixed. view_groupInventoryMembers_button_updateMembership = メンバーシップの更新... view_groupInventoryMembers_title_updateMembership = メンバーシップの更新 +##view_group_common_emptyGroup = An empty group is always considered as mixed. view_group_detail_failLoad = ID [{0}] の付いたグループのロードに失敗しました view_group_detail_failLoadComp = Group with id [{0}] does not exist or is not accessible view_group_detail_failRecursiveChange = グループ [{0}] の再帰設定の更新に失敗しました diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties index 4241b3f..9fa08be 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties @@ -571,8 +571,8 @@ view_admin_downloads_connectors_loadError = Imposs\u00EDvel recuperar informa\u0 view_admin_downloads_connectors_none = Nenhum conector est\u00E1 dispon\u00EDvel para download ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_landing = Nesta se\u00E7\u00E3o \u00E9 poss\u00EDvel administrar propriedades globais do RHQ. Isso inclui configura\u00E7\u00F5es de Seguran\u00E7a, Plugins, e gerenciamento de servidores RHQ e agentes. view_admin_measTemplates_updateExisting_title = Atualizar agendamentos existentes view_admin_measTemplates_updateExisting_tooltip = Marque esta op\u00E7\u00E3o para atualizar os agendamentos de coleta para as m\u00E9tricas selecionadas, em todos os recursos existentes para para este tipo. Caso contr\u00E1rio, o template dos agendamentos ser\u00E1 apenas aplicado para os novos recursos deste tipo, que ser\u00E1o adicionados ao invent\u00E1rio no futuro. @@ -699,6 +699,8 @@ view_admin_systemSettings_serverDetails_dbUrl = URL de Conex\u00E3o com o Banco view_admin_systemSettings_serverDetails_dbVersion = Vers\u00E3o do Banco de Dados view_admin_systemSettings_serverDetails_installDir = Diret\u00F3rio de Instala\u00E7\u00E3o do Servidor view_admin_systemSettings_serverDetails_nextRotation = Next Measurement Table Rotation +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = Server Local Time view_admin_systemSettings_serverDetails_tz = Server Time Zone view_admin_topology = Topologia diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties index d74907e..f064b2e 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties @@ -2464,8 +2464,10 @@ view_admin_downloads_cli_version = Версия CLI ##view_admin_downloads_connectors_none = No connectors are available for download ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name ##view_alert_details_field_resource_ancestry = Resource Ancestry ##view_alert_details_field_watched_resource = Watched Resource ##view_bundle_list_error4 = No bundles found in this repository diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties index 56e6d59..9b03f35 100644 --- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties +++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties @@ -558,8 +558,8 @@ view_admin_downloads_connectors_loadError = \u65e0\u6cd5\u83b7\u5f97\u8fde\u63a5 view_admin_downloads_connectors_none = \u6ca1\u6709\u53ef\u7528\u8fde\u63a5\u5668\u4e0b\u8f7d ##view_admin_downloads_scriptModulesDownload = Script Modules Download ##view_admin_downloads_scriptModules_help = <p> Script modules are reusable components provided by RHQ to be used in your scripts (either alert scripts or CLI scripts). You can access them by using the "rhq://downloads/<module-name-without-file-extension>" URI in your scripting language of choice (i.e. in javascript, you would use the "require" function).</p> -##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_downloads_scriptModules_loadError = Cannot load the list of available script modules +##view_admin_downloads_scriptModules_none = No script modules are available for download ##view_admin_landing = \u8fd9\u91cc\u4f60\u53ef\u4ee5\u7ba1\u7406RHQ\u5168\u5c40\u914d\u7f6e.\u5305\u62ec\u914d\u7f6e\u5b89\u5168,\u5b89\u88c5\u63d2\u4ef6,\u7ba1\u7406RHQ\u670d\u52a1\u5668\u548c\u4ee3\u7406. view_admin_measTemplates_updateExisting_title = \u66f4\u65b0\u5b58\u5728\u7684\u8ba1\u5212\u4efb\u52a1 view_admin_measTemplates_updateExisting_tooltip = Check this box to update the collection schedules for the selected metrics on all existing resources of this type. If this is not checked, the template schedules will only be applied to new resources of this type that are added to inventory in the future. @@ -687,6 +687,8 @@ view_admin_systemSettings_serverDetails_dbUrl = \u6570\u636e\u5e93\u8fde\u63a5UR view_admin_systemSettings_serverDetails_dbVersion = \u6570\u636e\u5e93\u7248\u672c\u4fe1\u606f view_admin_systemSettings_serverDetails_installDir = \u670d\u52a1\u5668\u5b89\u88c5\u76ee\u5f55 view_admin_systemSettings_serverDetails_nextRotation = Next Measurement Table Rotation +##view_admin_systemSettings_serverDetails_productName = Product Name +##view_admin_systemSettings_serverDetails_serverName = Server Name view_admin_systemSettings_serverDetails_time = \u670d\u52a1\u5668\u672c\u5730\u65f6\u95f4 view_admin_systemSettings_serverDetails_tz = \u670d\u52a1\u5668\u65f6\u533a view_admin_topology = \u62d3\u6251 diff --git a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml index 794a88a..a434622 100644 --- a/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml +++ b/modules/enterprise/gui/coregui/src/main/webapp/WEB-INF/web.xml @@ -186,10 +186,6 @@ <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.DriftGWTServiceImpl</servlet-class> </servlet> <servlet> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name> - <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.TestGWTServiceImpl</servlet-class> - </servlet> - <servlet> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PlatformUtilizationGWTService</servlet-name> <servlet-class>org.rhq.enterprise.gui.coregui.server.gwt.PlatformUtilizationGWTServiceImpl</servlet-class> </servlet> @@ -362,10 +358,6 @@ <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/DriftGWTService</url-pattern> </servlet-mapping> <servlet-mapping> - <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI TestGWTService</servlet-name> - <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/TestGWTService</url-pattern> - </servlet-mapping> - <servlet-mapping> <servlet-name>org.rhq.enterprise.gui.coregui.CoreGUI PlatformUtilizationGWTService</servlet-name> <url-pattern>/org.rhq.enterprise.gui.coregui.CoreGUI/PlatformUtilizationGWTService</url-pattern> </servlet-mapping> diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp index f9bb541..163571c 100644 --- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp +++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp @@ -8,32 +8,16 @@ <%@ page import="org.rhq.enterprise.gui.legacy.util.SessionUtils"%> <%@ page import="org.rhq.enterprise.gui.util.WebUtility"%>
-<%@ page import="org.rhq.enterprise.server.measurement.MeasurementPreferences" %> -<%@ page import="org.rhq.enterprise.server.measurement.MeasurementPreferences.MetricRangePreferences" %> - -<%@ page import="org.rhq.enterprise.server.test.CoreTestLocal" %> -<%@ page import="org.rhq.enterprise.server.test.DiscoveryTestLocal" %> -<%@ page import="org.rhq.enterprise.server.test.MeasurementTestLocal" %> -<%@ page import="org.rhq.enterprise.server.test.ResourceGroupTestLocal" %> -<%@ page import="org.rhq.enterprise.server.test.SubjectRoleTestLocal" %> -<%@ page import="org.rhq.enterprise.server.test.AlertTemplateTestLocal" %> -<%@ page import="org.rhq.enterprise.server.cloud.instance.ServerManagerLocal" %> +<%@ page import="org.rhq.enterprise.server.test.TestLocal" %> <%@ page import="org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal" %> <%@ page import="org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal" %> <%@ page import="org.rhq.enterprise.server.core.AgentManagerLocal" %> <%@ page import="org.rhq.enterprise.server.system.SystemManagerLocal" %> <%@ page import="org.rhq.enterprise.server.auth.SubjectManagerLocal" %> <%@ page import="org.rhq.enterprise.server.support.SupportManagerLocal" %> -<%@ page import="org.rhq.enterprise.server.plugin.ServerPluginsLocal"%> -<%@ page import="org.rhq.core.domain.plugin.PluginKey"%> -<%@ page import="org.rhq.core.domain.plugin.PluginDeploymentType"%><html> <%@ page import="org.rhq.enterprise.server.util.LookupUtil" %> <%@ page import="org.rhq.enterprise.server.scheduler.jobs.DataPurgeJob"%>
-<%@ page import="org.rhq.enterprise.server.resource.ResourceTypeManagerRemote"%> -<%@ page import="org.rhq.core.domain.criteria.ResourceTypeCriteria"%> -<%@ page import="org.rhq.core.domain.resource.ResourceType"%> - <%@ page import="javax.naming.NamingException" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> @@ -47,37 +31,21 @@ <jsp:include page="/admin/include/adminTestLinks.html" flush="true" />
<% - CoreTestLocal coreTestBean; - DiscoveryTestLocal discoveryTestBean; - MeasurementTestLocal measurementTestBean; - ResourceGroupTestLocal resourceGroupTestBean; - SubjectRoleTestLocal subjectRoleTestBean; - ServerManagerLocal serverManager; - AlertTemplateTestLocal alertTemplateTestBean; + TestLocal coreTestBean; MeasurementBaselineManagerLocal measurementBaselineManager; MeasurementScheduleManagerLocal measurementScheduleManager; AgentManagerLocal agentManager; SystemManagerLocal systemManager; SubjectManagerLocal subjectManager; SupportManagerLocal supportManager; - ResourceTypeManagerRemote typeManager; - ServerPluginsLocal serverPlugins;
- coreTestBean = LookupUtil.getCoreTest(); - discoveryTestBean = LookupUtil.getDiscoveryTest(); - measurementTestBean = LookupUtil.getMeasurementTest(); - resourceGroupTestBean = LookupUtil.getResourceGroupTestBean(); - subjectRoleTestBean = LookupUtil.getSubjectRoleTestBean(); - serverManager = LookupUtil.getServerManager(); - alertTemplateTestBean = LookupUtil.getAlertTemplateTestBean(); + coreTestBean = LookupUtil.getTest(); measurementBaselineManager = LookupUtil.getMeasurementBaselineManager(); measurementScheduleManager = LookupUtil.getMeasurementScheduleManager(); agentManager = LookupUtil.getAgentManager(); systemManager = LookupUtil.getSystemManager(); subjectManager = LookupUtil.getSubjectManager(); supportManager = LookupUtil.getSupportManager(); - typeManager = LookupUtil.getResourceTypeManagerRemote(); - serverPlugins = LookupUtil.getServerPlugins();
String result = null; String resultNoEscape = null; @@ -85,110 +53,40 @@ String failure = null; try { - if ("registerTestAgent".equals(mode)) - { - coreTestBean.registerTestAgent(); - } - else if ("registerTestPluginAndTypeInfo".equals(mode)) - { - discoveryTestBean.registerTestPluginAndTypeInfo(); - } - else if ("removeTestPluginAndTypeInfo".equals(mode)) - { - discoveryTestBean.removeTestPluginAndTypeInfo(); - } - else if ("sendTestFullInventoryReport".equals(mode)) - { - discoveryTestBean.sendTestFullInventoryReport(); - } - else if ("sendTestRuntimeInventoryReport".equals(mode)) - { - discoveryTestBean.sendTestRuntimeInventoryReport(); - } - else if ("sendTestMeasurementReport".equals(mode)) - { - measurementTestBean.sendTestMeasurementReport(); - } - else if ("sendNewPlatform".equals(mode)) - { - String address = request.getParameter("address"); - int servers = Integer.parseInt(request.getParameter("servers")); - int servicesPerServer = Integer.parseInt(request.getParameter("servicesPerServer")); - discoveryTestBean.sendNewPlatform(address, servers, servicesPerServer); - } - else if ("setupCompatibleGroups".equals(mode)) - { - resourceGroupTestBean.setupCompatibleGroups(); - } - else if ("setupUberMixedGroup".equals(mode)) - { - resourceGroupTestBean.setupUberMixedGroup(); - } - else if ("startStats".equals(mode)) - { - coreTestBean.enableHibernateStatistics(); - } - else if ("addProblemResource".equals(mode)) - { - measurementTestBean.addProblemResource(); - } - else if ("setAgentCurrentlyScheduledMetrics".equals(mode)) - { - String value = pageContext.getRequest().getParameter("v"); - measurementTestBean.setAgentCurrentlyScheduledMetrics(Double.valueOf(value)); - } - else if ("addSubjectsAndRoles".equals(mode)) - { - String roleCount = pageContext.getRequest().getParameter("roleCount"); - String usersInRoleCount = pageContext.getRequest().getParameter("usersInRoleCount"); - subjectRoleTestBean.createRolesAndUsers(Integer.parseInt(roleCount), Integer.parseInt(usersInRoleCount)); - } - else if ("clusterGetIdentity".equals(mode)) - { - String serverName = serverManager.getIdentity(); - pageContext.setAttribute("serverName", "(serverName = " + serverName + ")"); - } - else if ("cloneAlertTemplate".equals(mode)) - { - String alertTemplateId = pageContext.getRequest().getParameter("alertTemplateId"); - String numberOfClones = pageContext.getRequest().getParameter("numberOfClones"); - alertTemplateTestBean.cloneAlertTemplate(Integer.parseInt(alertTemplateId), Integer.parseInt(numberOfClones)); - } - else if ("calculateAutoBaselines".equals(mode)) + if ("calculateAutoBaselines".equals(mode)) { measurementBaselineManager.calculateAutoBaselines(); + result = "Calculate auto-baselines done"; } else if ("calculateOOBs".equals(mode)) { DataPurgeJob dpj = new DataPurgeJob(); dpj.calculateOOBs(); + result = "Calculate OOBs done"; } else if ("checkForSuspectAgents".equals(mode)) { agentManager.checkForSuspectAgents(); + result = "Check for suspect agents done"; } else if ("dataPurgeJob".equals(mode)) { DataPurgeJob.purgeNow(); + result = "Data purge done"; } else if ("dbMaintenance".equals(mode)) { systemManager.vacuum(subjectManager.getOverlord()); + result = "DB vacuum done... "; systemManager.reindex(subjectManager.getOverlord()); + result += "DB reindex done... "; systemManager.analyze(subjectManager.getOverlord()); - } - else if ("metricDisplayRange".equals(mode)) - { - int lastHours = Integer.parseInt(pageContext.getRequest().getParameter("lastHours")); - Subject subject = WebUtility.getSubject(request); - MeasurementPreferences prefs = new MeasurementPreferences(subject); - MetricRangePreferences rangePrefs = prefs.getMetricRangePreferences(); - rangePrefs.lastN = lastHours; - prefs.setMetricRangePreferences(rangePrefs); + result += "DB analyze done"; } else if ("errorCorrectSchedules".equals("mode")) { measurementScheduleManager.errorCorrectSchedules(); + result = "Measurement schedules checked for invalid (too low) intervals and corrected if need be"; } else if ("generateSnapshotReport".equals(mode)) { @@ -198,18 +96,10 @@ java.net.URL url = supportManager.getSnapshotReport(subjectManager.getOverlord(), resourceId, name, description); result = "Snapshot Report is located here: " + url.toString(); } - else if ("purgeServerPlugin".equals(mode)) - { - String serverPluginName = request.getParameter("serverPluginName"); - PluginKey key = new PluginKey(PluginDeploymentType.SERVER, "not-needed", serverPluginName); - serverPlugins.purgeServerPlugin(subjectManager.getOverlord(), key); - result = "OK - you can now try to re-register a plugin with the name [" + serverPluginName + "]"; - } - - else if ("snapshotMeasurementTables".equals(mode)) + else if ("getMeasurementTableStats".equals(mode)) { resultNoEscape = "<table>"; - Map<String, Long> tableCounts = measurementTestBean.snapshotMeasurementTables(); + Map<String, Long> tableCounts = coreTestBean.getMeasurementTableStats()(); for (Map.Entry<String, Long> nextCount : tableCounts.entrySet()) { String tableAlias = nextCount.getKey(); Long tableCount = nextCount.getValue(); @@ -217,17 +107,15 @@ } resultNoEscape += "</table>"; } - else if ("typeManagerRemote".equals(mode)) + else if ("enableHibernateStats".equals(mode)) { - int typeId = Integer.parseInt(request.getParameter("typeId")); - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.addFilterId(typeId); - criteria.fetchMetricDefinitions(true); - java.util.List<ResourceType> types = typeManager.findResourceTypesByCriteria(subjectManager.getOverlord(), criteria); - result = ""; - for (ResourceType type : types) { - result += type.getName() + " has " + (type.getMetricDefinitions() != null ? type.getMetricDefinitions().size() : "empty") + " metric definitions"; - } + coreTestBean.enableHibernateStatistics(); + result = "Started Hibernate statistics collection"; + } + else if ("disableHibernateStats".equals(mode)) + { + coreTestBean.disableHibernateStatistics(); + result = "Stopped Hibernate statistics collection"; } } catch (Exception e) @@ -241,147 +129,47 @@ pageContext.setAttribute("result", result); pageContext.setAttribute("resultNoEscape", resultNoEscape); pageContext.setAttribute("failure", failure); - pageContext.setAttribute("testAgentReported", Boolean.valueOf(coreTestBean.isTestAgentReported())); - %>
<c:if test="${executed != null}"> - <b>Executed <c:out value="${executed}"/> + <b>Executed <c:out value="${executed}"/></b>
<c:if test="${result != null}"> - : </b> <c:out value="${result}"/><br> + : <c:out value="${result}"/><br/> </c:if>
<c:if test="${resultNoEscape != null}"> - : </b> ${resultNoEscape} <br> + : ${resultNoEscape} <br/> </c:if> - + <br/> <c:if test="${failure != null}"> <pre style="background-color: yellow;"><c:out value="${failure}"/></pre> </c:if> </c:if>
-<h2>Administration</h2> - -<c:url var="url" value="/admin/test/control.jsp?mode=addSubjectsAndRoles"/> -Add Lots of Users and Roles -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="addSubjectsAndRoles"/> - Number of Roles: <input type="text" name="roleCount" size="5"/><br/> - Number of Users in each Role: <input type="text" name="usersInRoleCount" size="5"/><br/> - <input type="submit" value="Send" name="Send"/> -</form> - - -<ul> - <li><c:url var="url" value="/admin/test/control.jsp?mode=addSubjectsAndRoles"/> - <a href="<c:out value="${url}"/>">Report Test Agent</a> (done = <c:out value="${testAgentReported}"/>)</li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=registerTestPluginAndTypeInfo"/> - <a href="<c:out value="${url}"/>">Register test plugin metadata</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=removeTestPluginAndTypeInfo"/> - <a href="<c:out value="${url}"/>">Remove test plugin metadata</a></li> -</ul> - -<h2>Core</h2> +<h2>Administration Controls</h2>
<ul> - <li><c:url var="url" value="/admin/test/control.jsp?mode=registerTestAgent"/> - <a href="<c:out value="${url}"/>">Report Test Agent</a> (done = <c:out value="${testAgentReported}"/>)</li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=registerTestPluginAndTypeInfo"/> - <a href="<c:out value="${url}"/>">Register test plugin metadata</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=removeTestPluginAndTypeInfo"/> - <a href="<c:out value="${url}"/>">Remove test plugin metadata</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=dbMaintenance"/> - <a href="<c:out value="${url}"/>">Perform All Database Maintenance Now</a></li> -</ul> - -<h2>Cluster</h2> - -<ul> - <li><c:url var="url" value="/admin/test/control.jsp?mode=clusterGetIdentity"/> - <a href="<c:out value="${url}"/>">Get Identity</a> <c:out value="${serverName}"/></li> -</ul> - -<h2>Inventory</h2> - -<ul> - <li><c:url var="url" value="/admin/test/control.jsp?mode=sendTestFullInventoryReport"/> - <a href="<c:out value="${url}"/>">Send Full Inventory Report</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=sendTestRuntimeInventoryReport"/> - <a href="<c:out value="${url}"/>">Send Runtime Inventory Report</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=setupCompatibleGroups"/> - <a href="<c:out value="${url}"/>">Setup Compatible Groups</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=setupUberMixedGroup"/> - <a href="<c:out value="${url}"/>">Setup Uber Mixed Group</a></li> -</ul> - -<c:url var="url" value="/admin/test/control.jsp?mode=sendNewPlatform"/> -Send New Platform Inventory Report -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="sendNewPlatform"/> - Address: <input type="text" name="address" size="30"/><br/> - Servers: <input type="text" name="servers" size="5"/><br/> - Services Per Server: <input type="text" name="servicesPerServer" size="5"/><br/> - <input type="submit" value="Send" name="Send"/> -</form> - - -<h2>Measurement</h2> - -<ul> + <a href="<c:out value="${url}"/>">Perform Database Maintenance (vacuum/reindex/analyze)</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=calculateAutoBaselines"/> <a href="<c:out value="${url}"/>">Calculate Auto Baselines</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=sendTestMeasurementReport"/> - <a href="<c:out value="${url}"/>">Send Measurement Report</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=addProblemResource"/> - <a href="<c:out value="${url}"/>">Add problem Resource</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=setAgentCurrentlyScheduledMetrics&v=100"/> - <a href="<c:out value="${url}"/>">Set RHQ Agent 'CurrentlyScheduleMetrics' to 100</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=setAgentCurrentlyScheduledMetrics&v=50"/> - <a href="<c:out value="${url}"/>">Set RHQ Agent 'CurrentlyScheduleMetrics' to 50</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=checkForSuspectAgents"/> <a href="<c:out value="${url}"/>">Check For Suspect Agents</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=dataPurgeJob"/> - <a href="<c:out value="${url}"/>">Force Data Purge Now</a></li> + <a href="<c:out value="${url}"/>">Perform Data Purge</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=calculateOOBs"/> - <a href="<c:out value="${url}"/>">Force calculation of OOBs</a></li> + <a href="<c:out value="${url}"/>">Calculate OOBs</a></li> <li><c:url var="url" value="/admin/test/control.jsp?mode=errorCorrectSchedules"/> - <a href="<c:out value="${url}"/>">Error-Correct Measurement Schedules</a></li> - <li><c:url var="url" value="/admin/test/control.jsp?mode=snapshotMeasurementTables"/> - <a href="<c:out value="${url}"/>">Snapshot Measurement Tables</a></li> + <a href="<c:out value="${url}"/>">Correct Schedule Collection Intervals</a></li> + <li><c:url var="url" value="/admin/test/control.jsp?mode=getMeasurementTableStats"/> + <a href="<c:out value="${url}"/>">Get Measurement Tables Stats</a></li> + <li><c:url var="url" value="/admin/test/control.jsp?mode=enableHibernateStats"/> + <a href="<c:out value="${url}"/>">Start Hibernate Statistics Collection</a></li> + <li><c:url var="url" value="/admin/test/control.jsp?mode=disableHibernateStats"/> + <a href="<c:out value="${url}"/>">Stop Hibernate Statistics Collection</a></li> </ul>
-<h2>Alerts</h2> - -<c:url var="url" value="/admin/test/control.jsp?mode=cloneAlertTemplate"/> -Template Cloning -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="cloneAlertTemplate"/> - Alert Template ID: <input type="text" name="alertTemplateId" size="5"/><br/> - Number of Clones: <input type="text" name="numberOfClones" size="5"/><br/> - <input type="submit" value="Send" name="Send"/> -</form> - -<h2>Utilities</h2> -<ul> - <li><c:url var="url" value="/admin/test/control.jsp?mode=startStats"/> - <a href="<c:out value="${url}"/>">Start Hibernate Statistics Collection</a></li> -</ul> - - -<h2>User Preferences</h2> -<% - Subject subject = WebUtility.getSubject(request); - MeasurementPreferences prefs = new MeasurementPreferences(subject); - MetricRangePreferences rangePrefs = prefs.getMetricRangePreferences(); - pageContext.setAttribute("lastHours", String.valueOf(rangePrefs.lastN)); -%> -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="metricDisplayRange"/> - Last X hours: <input type="text" name="lastHours" size="5" value="<c:out value="${lastHours}"/>"/><br/> - <input type="submit" value="Send" name="Send"/> -</form> - <h2>Snapshot Report</h2>
<c:url var="url" value="/admin/test/control.jsp?mode=generateSnapshotReport"/> @@ -394,26 +182,5 @@ Generate Snapshot Report <input type="submit" value="Generate Snapshot" name="Generate Snapshot"/> </form>
-<h2>Server Plugins</h2> - -<c:url var="url" value="/admin/test/control.jsp?mode=purgeServerPlugin"/> -Purge Server Plugin (allowing you to re-register it again later) -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="purgeServerPlugin"/> - ServerPluginName: <input type="text" name="serverPluginName" size="30"/><br/> - <input type="submit" value="Purge Server Plugin" name="Purge Server Plugin"/> -</form> - -<h2>Resource Type Criteria</h2> - -<c:url var="url" value="/admin/test/control.jsp?mode=typeManagerRemote"/> -Query ResourceTypes by Criteria -<form action="<c:out value="${url}"/>" method="get"> - <input type="hidden" name="mode" value="typeManagerRemote"/> - ResourceType ID: <input type="text" name="typeId" size="10"/><br/> - <input type="submit" value="Query by Criteria" name="Query by Criteria"/> -</form> - - </body> </html> diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java index 117d90d..b5e1d5e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java @@ -63,6 +63,7 @@ import org.rhq.core.util.StopWatch; import org.rhq.enterprise.server.RHQConstants; import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.authz.RequiredPermission; +import org.rhq.enterprise.server.cloud.instance.ServerManagerLocal; import org.rhq.enterprise.server.core.CoreServerMBean; import org.rhq.enterprise.server.core.CustomJaasDeploymentServiceMBean; import org.rhq.enterprise.server.plugin.pc.MasterServerPluginContainer; @@ -106,6 +107,9 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot private SystemManagerLocal systemManager;
@EJB + private ServerManagerLocal serverManager; + + @EJB //@IgnoreDependency private SubjectManagerLocal subjectManager;
@@ -697,6 +701,8 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot details.put(ServerDetails.Detail.CURRENT_MEASUREMENT_TABLE, dbInfo.getCurrentMeasurementTable()); details.put(ServerDetails.Detail.NEXT_MEASUREMENT_TABLE_ROTATION, dbInfo.getNextMeasurementTableRotation());
+ details.put(ServerDetails.Detail.SERVER_IDENTITY, serverManager.getServer().getName()); + return serverDetails; }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessBean.java deleted file mode 100644 index 4a52478..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessBean.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * AccessBean.java - * - * Created on August 24, 2006, 11:30 PM - * - * To change this template, choose Tools | Template Manager and open the template in the editor. - */ - -package org.rhq.enterprise.server.test; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.beans.PropertyEditor; -import java.beans.PropertyEditorManager; -import java.beans.PropertyEditorSupport; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.Id; -import javax.persistence.PersistenceContext; -import org.rhq.enterprise.server.RHQConstants; - -import org.hibernate.Hibernate; - -/** - * @author Greg Hinkle - */ -@Stateless -public class AccessBean implements AccessLocal { - public static final int MAX_RESULTS = 2000; - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager manager; - - /** - * Creates a new instance of AccessBean - */ - public AccessBean() { - } - - static List<String> types; - - static { - types = new ArrayList<String>(); - types.add("Resource"); - types.add("Agent"); - types.add("Role"); - } - - public List<String> getKnownTypes() { - return types; - } - - public List getAll(String type) { - return manager.createQuery("from " + type + " d").setMaxResults(MAX_RESULTS).getResultList(); - } - - public EntityManager getManager() { - return manager; - } - - public List getAllDeep(String type) throws IntrospectionException, IllegalAccessException, - InvocationTargetException { - List l = getAll(type); - if (l.size() == 0) { - return l; - } - - BeanInfo info = Introspector.getBeanInfo(l.get(0).getClass()); - PropertyDescriptor[] pds = info.getPropertyDescriptors(); - for (Object o : l) { - for (PropertyDescriptor pd : pds) { - if (Collection.class.isAssignableFrom(pd.getPropertyType())) { - Object v = pd.getReadMethod().invoke(o); - System.out.println(pd.getName() + ": " + v); - } - } - } - - return l; - } - - public List getAllFetching(String type, String... properties) throws IntrospectionException, - IllegalAccessException, InvocationTargetException { - List l = getAll(type); - if (l.size() == 0) { - return l; - } - - BeanInfo info = Introspector.getBeanInfo(l.get(0).getClass()); - PropertyDescriptor[] pds = info.getPropertyDescriptors(); - Set<String> propsToLoad = new HashSet<String>(Arrays.asList(properties)); - for (Object o : l) { - for (PropertyDescriptor pd : pds) { - if (propsToLoad.contains(pd.getName())) { - Object v = pd.getReadMethod().invoke(o); - System.out.println(pd.getName() + ": " + v); - } - } - } - - return l; - } - - public Object findDeep(String typeName, Object key) throws IllegalAccessException, IntrospectionException, - InvocationTargetException, ClassNotFoundException { - Class type = Class.forName(typeName); - BeanInfo info = Introspector.getBeanInfo(type); - - Object convertedKey = getConvertedKey(type, key); - - Object o = find(type, convertedKey); - if (o == null) { - return null; - } - - PropertyDescriptor[] pds = info.getPropertyDescriptors(); - for (PropertyDescriptor pd : pds) { - if (pd.getName().equals("id")) { - pd.getReadMethod().invoke(o); - } - - if (Collection.class.isAssignableFrom(pd.getPropertyType())) { - Method m = pd.getReadMethod(); - if (m != null) { - Object v = pd.getReadMethod().invoke(o); - } - } - - Method m = pd.getReadMethod(); - if (m != null) { - Object v = pd.getReadMethod().invoke(o); - if (!Hibernate.isInitialized(v)) { - Hibernate.initialize(v); - } - } - } - - return o; - } - - @SuppressWarnings("unchecked") - public void delete(String entityName, String key) { - try { - Class type = Class.forName(entityName); - Object objectKey = getConvertedKey(type, key); - manager.remove(manager.find(type, objectKey)); - } catch (ClassNotFoundException e) { - e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. - } - } - - public Object getConvertedKey(Class type, Object key) { - Class keyType = getKeyType(type); - System.out.println("Key type is: " + keyType); - PropertyEditor ed = PropertyEditorManager.findEditor(keyType); - if (ed != null) { - ed.setAsText(String.valueOf(key)); - return ed.getValue(); - } else { - return key; - } - } - - public Class getKeyType(Class type) { - Field[] fields = type.getDeclaredFields(); - for (Field f : fields) { - Id id = f.getAnnotation(javax.persistence.Id.class); - if (id != null) { - return f.getType(); - } - } - - return Integer.class; - } - - @SuppressWarnings("unchecked") - public Object find(Class type, Object key) { - return manager.find(type, key); - } - - static { - PropertyEditorManager.registerEditor(BigInteger.class, AccessBean.BigIntegerEditor.class); - } - - public static class BigIntegerEditor extends PropertyEditorSupport { - BigInteger val; - - public void setValue(Object value) { - val = (BigInteger) value; - } - - public Object getValue() { - return val; - } - - public String getAsText() { - return val.toString(); - } - - public void setAsText(String text) throws IllegalArgumentException { - val = new BigInteger(text); - } - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessLocal.java deleted file mode 100644 index 89fbee6..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AccessLocal.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.beans.IntrospectionException; -import java.lang.reflect.InvocationTargetException; -import javax.ejb.Local; - -/** - * This is the business interface for Access enterprise bean. - * - * @author Greg Hinkle - */ -@Local -public interface AccessLocal { - java.util.List<java.lang.String> getKnownTypes(); - - java.util.List getAll(String type); - - java.lang.Object find(Class type, Object key); - - java.util.List getAllFetching(String type, String... properties) throws IntrospectionException, - IllegalAccessException, InvocationTargetException; - - java.util.List getAllDeep(String type) throws IntrospectionException, IllegalAccessException, - InvocationTargetException; - - java.lang.Object findDeep(String typeName, Object key) throws IllegalAccessException, IntrospectionException, - InvocationTargetException, ClassNotFoundException; - - void delete(String entityName, String key); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestBean.java deleted file mode 100644 index fd9d1e5..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestBean.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; - -import org.rhq.core.domain.alert.AlertDefinition; -import org.rhq.core.domain.auth.Subject; -import org.rhq.enterprise.server.RHQConstants; -import org.rhq.enterprise.server.alert.AlertTemplateManagerLocal; -import org.rhq.enterprise.server.alert.InvalidAlertDefinitionException; -import org.rhq.enterprise.server.auth.SubjectManagerLocal; -import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; - -@Stateless -public class AlertTemplateTestBean implements AlertTemplateTestLocal { - - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager entityManager; - - @EJB - private AlertTemplateManagerLocal alertTemplateManager; - - @EJB - private SubjectManagerLocal subjectManager; - - public void cloneAlertTemplate(int alertTemplateId, int numberOfClones) throws ResourceTypeNotFoundException, - InvalidAlertDefinitionException { - - Subject overlord = subjectManager.getOverlord(); - long currentMillis = System.currentTimeMillis(); - - for (int i = 1; i <= numberOfClones; i++) { - AlertDefinition template = entityManager.find(AlertDefinition.class, alertTemplateId); - AlertDefinition newTemplate = new AlertDefinition(template); - String oldName = template.getName(); - int resourceTypeId = template.getResourceType().getId(); - - String newName = oldName + " (clone " + i + " at " + currentMillis + ")"; - newTemplate.setName(newName); - - alertTemplateManager.createAlertTemplate(overlord, newTemplate, resourceTypeId); - - entityManager.flush(); - entityManager.clear(); - } - - } - -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestLocal.java deleted file mode 100644 index b341704..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/AlertTemplateTestLocal.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; - -import org.rhq.enterprise.server.alert.InvalidAlertDefinitionException; -import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; - -@Local -public interface AlertTemplateTestLocal { - void cloneAlertTemplate(int alertTemplateId, int numberOfClones) throws ResourceTypeNotFoundException, - InvalidAlertDefinitionException; -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestBean.java deleted file mode 100644 index be872ae..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestBean.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.lang.management.ManagementFactory; -import java.util.List; -import java.util.Properties; - -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; - -import org.rhq.core.clientapi.server.core.AgentNotSupportedException; -import org.rhq.core.clientapi.server.core.AgentRegistrationException; -import org.rhq.core.clientapi.server.core.AgentRegistrationRequest; -import org.rhq.core.clientapi.server.core.AgentRegistrationResults; -import org.rhq.core.clientapi.server.core.CoreServerService; -import org.rhq.core.domain.plugin.Plugin; -import org.rhq.core.domain.resource.Agent; -import org.rhq.core.domain.server.PersistenceUtility; -import org.rhq.enterprise.server.RHQConstants; -import org.rhq.enterprise.server.core.CoreServerServiceImpl; - -/** - * An EJB for testing the core subsystem - used by TestControl.jsp. - */ -@Stateless -public class CoreTestBean implements CoreTestLocal { - static final String TEST_AGENT_ADDRESS = "127.0.0.2"; - static final int TEST_AGENT_PORT = 2145; - static final String TEST_AGENT_REMOTE_ENDPOINT = "socket://" + TEST_AGENT_ADDRESS + ":" + TEST_AGENT_PORT - + "/?rhqtype=agent"; - - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager entityManager; - - private CoreServerService coreServerService = new CoreServerServiceImpl(); - - public boolean isTestAgentReported() { - try { - getTestAgent(); - return true; - } catch (NoResultException nre) { - return false; - } - } - - public void enableHibernateStatistics() { - PersistenceUtility.enableHibernateStatistics(entityManager, ManagementFactory.getPlatformMBeanServer()); - } - - /** - * Build a fake agent and register it - */ - public AgentRegistrationResults registerTestAgent() { - AgentRegistrationRequest registrationRequest = new AgentRegistrationRequest(TEST_AGENT_ADDRESS, - TEST_AGENT_ADDRESS, TEST_AGENT_PORT, TEST_AGENT_REMOTE_ENDPOINT, true, null, null); - try { - return this.coreServerService.registerAgent(registrationRequest); - } catch (AgentRegistrationException e) { - throw new RuntimeException(e); - } catch (AgentNotSupportedException e2) { - throw new RuntimeException(e2); - } - } - - public Properties getLatestConfiguration() { - return new Properties(); // TODO: Implement this method. - } - - public List<Plugin> getLatestPlugins() { - // TODO Auto-generated method stub - return null; - } - - public InputStream getPluginArchive(String pluginName) { - // TODO Auto-generated method stub - return null; - } - - public InputStream getFileContents(String file) { - // TODO: Implement me - return new ByteArrayInputStream(("Test contents of " + file).getBytes()); - } - - public Agent getTestAgent() { - return (Agent) entityManager.createNamedQuery(Agent.QUERY_FIND_BY_ADDRESS_AND_PORT).setParameter("address", - TEST_AGENT_ADDRESS).setParameter("port", TEST_AGENT_PORT).getSingleResult(); - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestLocal.java deleted file mode 100644 index 7901455..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/CoreTestLocal.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; -import org.rhq.core.clientapi.server.core.AgentRegistrationResults; -import org.rhq.core.domain.resource.Agent; - -/** - * An EJB for testing the core subsystem - used by TestControl.jsp. - */ -@Local -public interface CoreTestLocal { - AgentRegistrationResults registerTestAgent(); - - Agent getTestAgent(); - - boolean isTestAgentReported(); - - void enableHibernateStatistics(); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java deleted file mode 100644 index 9fb1661..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestBean.java +++ /dev/null @@ -1,325 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.util.List; - -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hibernate.criterion.MatchMode; -import org.hibernate.criterion.Restrictions; - -import org.rhq.core.clientapi.server.core.AgentNotSupportedException; -import org.rhq.core.clientapi.server.core.AgentRegistrationException; -import org.rhq.core.clientapi.server.core.AgentRegistrationRequest; -import org.rhq.core.clientapi.server.core.AgentRegistrationResults; -import org.rhq.core.clientapi.server.core.CoreServerService; -import org.rhq.core.clientapi.server.discovery.DiscoveryServerService; -import org.rhq.core.clientapi.server.discovery.InvalidInventoryReportException; -import org.rhq.core.clientapi.server.discovery.InventoryReport; -import org.rhq.core.clientapi.server.discovery.StaleTypeException; -import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.authz.Role; -import org.rhq.core.domain.criteria.ResourceTypeCriteria; -import org.rhq.core.domain.plugin.Plugin; -import org.rhq.core.domain.resource.Agent; -import org.rhq.core.domain.resource.InventoryStatus; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceCategory; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.server.PersistenceUtility; -import org.rhq.enterprise.server.RHQConstants; -import org.rhq.enterprise.server.auth.SubjectManagerLocal; -import org.rhq.enterprise.server.core.CoreServerServiceImpl; -import org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl; -import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; - -/** - * An EJB for testing the discovery subsystem - used by TestControl.jsp. - * - * @author Ian Springer - */ -@Stateless -public class DiscoveryTestBean implements DiscoveryTestLocal { - private final Log log = LogFactory.getLog(DiscoveryTestBean.class); - - private static final String TEST_PLUGIN_NAME = "BogusPlugin"; - private static final String TEST_PLUGIN_PATH = "on-bogus-plugin.jar"; - private static final String TEST_PLATFORM_TYPE_NAME = "BogusOS"; - private static final String TEST_PLATFORM_NAME = "BogusPlatform"; - private static final String TEST_SERVER_TYPE_NAME = "BogusApp"; - private static final String TEST_SERVER1_NAME = "BogusServer1"; - private static final String TEST_SERVER2_NAME = "BogusServer2"; - private static final String TEST_SERVICE_TYPE_NAME = "BogusServiceType"; - private static final String TEST_SERVICE1_NAME = "BogusService1"; - private static final String TEST_SERVICE2_NAME = "BogusService2"; - - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager entityManager; - - private DiscoveryServerService discoveryServerService = new DiscoveryServerServiceImpl(); - - private CoreServerService coreServerService = new CoreServerServiceImpl(); - - @EJB - private CoreTestLocal coreTest; - - @EJB - private SubjectManagerLocal subjectManager; - - @EJB - private ResourceTypeManagerLocal resourceTypeManager; - - public void registerTestPluginAndTypeInfo() { - //System.out.println("CALLER: " + ctx.getCallerPrincipal() + " (" + ctx.getCallerPrincipal().getName() + ")"); - try { - getTestPlugin(); - } catch (NoResultException e) { - Plugin testPlugin = createTestPlugin(); - entityManager.persist(testPlugin); - log.info("Test plugin [" + testPlugin + "] persisted..."); - } - - try { - // This will also create a server and a service under the platform. - getTestPlatformType(); - } catch (NoResultException e) { - ResourceType testResourceType = createTestPlatformType(); - entityManager.persist(testResourceType); - log.info("Test platform type [" + testResourceType + "] persisted..."); - } - } - - public void removeTestPluginAndTypeInfo() { - try { - Plugin testPlugin = getTestPlugin(); - entityManager.remove(testPlugin); - log.info("Test plugin [" + testPlugin + "] removed..."); - } catch (NoResultException e) { - // ignore - } - - try { - ResourceType testPlatformType = getTestPlatformType(); - - // NOTE: In addition to child server/service types, cascading will also remove all platform instances. - entityManager.remove(testPlatformType); - log.info("Test platform type [" + testPlatformType + "] recursively removed..."); - } catch (NoResultException e) { - // ignore - } - } - - public void registerFakePlugin() { - //ProductPluginManager ppm; - } - - /** - */ - public void sendTestFullInventoryReport() { - log.info("Sending fake full inventory report to server..."); - Resource platform = createTestPlatform("127.0.0.2", 5, 10); - try { - InventoryReport report = new InventoryReport(this.coreTest.getTestAgent()); - report.addAddedRoot(platform); - this.discoveryServerService.mergeInventoryReport(report); - } catch (InvalidInventoryReportException e) { - throw new RuntimeException(e); - } - } - - public void sendNewPlatform(String platformAddress, int servers, int servicesPerServer) { - AgentRegistrationRequest registrationRequest = new AgentRegistrationRequest("TestAgent", platformAddress, 2144, - "socket://" + platformAddress + ":" + 2144, true, null, null); - try { - @SuppressWarnings("unused") - AgentRegistrationResults results = this.coreServerService.registerAgent(registrationRequest); - } catch (AgentRegistrationException e1) { - throw new RuntimeException(e1); - } catch (AgentNotSupportedException e2) { - throw new RuntimeException(e2); - } - - Resource platform = createTestPlatform(platformAddress, servers, servicesPerServer); - try { - InventoryReport report = new InventoryReport(new Agent("TestAgent", platformAddress, 2144, "endpoint", - "token")); - report.addAddedRoot(platform); - this.discoveryServerService.mergeInventoryReport(report); - } catch (InvalidInventoryReportException e) { - throw new RuntimeException(e); - } - } - - public String clearAutoinventoryQueue() { - return null; - } - - public void sendTestRuntimeInventoryReport() { - log.info("Sending fake runtime inventory report to server..."); - Resource platform = createTestPlatform(TEST_PLATFORM_NAME, 2, 10); - addTestServicesToPlatform(platform); - try { - InventoryReport report = new InventoryReport(this.coreTest.getTestAgent()); - report.addAddedRoot(platform); - this.discoveryServerService.mergeInventoryReport(report); - } catch (InvalidInventoryReportException e) { - throw new RuntimeException(e); - } - } - - public void removeTestPlatform() { - try { - Resource platform = getTestPlatform(); - entityManager.remove(platform); // cascading will also remove test IPs and servers/services - } catch (NoResultException e) { - // ignore - } - } - - public void createTestMixedGroup(String groupName) { - List<Resource> resources = PersistenceUtility - .findByCriteria(entityManager, Resource.class, Restrictions.like("name", "BogusServer 0", - MatchMode.ANYWHERE), Restrictions.eq("inventoryStatus", InventoryStatus.COMMITTED)); - - System.out.println("FOUND " + resources.size() + " resources"); - - ResourceGroup group = new ResourceGroup(groupName); - for (Resource resource : resources) { - group.addExplicitResource(resource); - } - - entityManager.persist(group); - - Subject s = new Subject(groupName + "User", true, false); - entityManager.persist(s); - - Role r = new Role(groupName = "Role"); - r.addSubject(s); - r.addResourceGroup(group); - entityManager.persist(r); - } - - private Resource getTestPlatform() { - return (Resource) entityManager.createQuery("SELECT res FROM Resource res WHERE res.name = :name") - .setParameter("name", TEST_PLATFORM_NAME).getSingleResult(); - } - - private Plugin getTestPlugin() { - return (Plugin) entityManager.createNamedQuery(Plugin.QUERY_FIND_BY_NAME) - .setParameter("name", TEST_PLUGIN_NAME).getSingleResult(); - } - - private ResourceType getTestPlatformType() { - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.addFilterName(TEST_PLATFORM_TYPE_NAME); - return resourceTypeManager.findResourceTypesByCriteria(subjectManager.getOverlord(), criteria).get(0); - } - - private ResourceType getTestServerType() { - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.addFilterName(TEST_SERVER_TYPE_NAME); - return resourceTypeManager.findResourceTypesByCriteria(subjectManager.getOverlord(), criteria).get(0); - } - - private ResourceType getTestServiceType() { - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.addFilterName(TEST_SERVICE_TYPE_NAME); - return resourceTypeManager.findResourceTypesByCriteria(subjectManager.getOverlord(), criteria).get(0); - } - - private Resource createTestPlatform(String address, int servers, int servicesPerServer) { - Resource platform = new Resource(address, address + " platform", getTestPlatformType()); - platform.setAgent(this.coreTest.getTestAgent()); - platform.setDescription("test platform created by " + this.getClass().getName()); - platform.setLocation("San Pedro Sula, Honduras"); - platform.setModifiedBy(subjectManager.getOverlord().getName()); - - //platform.addIP(createTestIp()); - String serverName = "BogusServer "; - for (int i = 0; i < servers; i++) { - platform.addChildResource(createTestServer(platform, serverName + i, servicesPerServer)); - } - - return platform; - } - - private Resource createTestServer(Resource platform, String name, int servicesPerServer) { - String installPath = "c:\Program Files\" + name; - Resource server = new Resource(installPath, name, getTestServerType()); - server.setParentResource(platform); - server.setDescription("test server created by " + this.getClass().getName()); - server.setModifiedBy(subjectManager.getOverlord().getName()); - - for (int i = 0; i < servicesPerServer; i++) { - String childName = name + " child service " + i; - server.addChildResource(createTestService(server, childName)); - } - - return server; - } - - private Resource createTestService(Resource parent, String name) { - Resource service = new Resource(name, name, getTestServiceType()); - service.setDescription("test service created by " + this.getClass().getName()); - service.setModifiedBy(subjectManager.getOverlord().getName()); - return service; - } - - private void addTestServicesToPlatform(Resource platform) { - Resource testServer1 = platform.getChildResources().iterator().next(); - testServer1.addChildResource(createTestService(testServer1, TEST_SERVICE1_NAME)); - testServer1.addChildResource(createTestService(testServer1, TEST_SERVICE2_NAME)); - } - - private Plugin createTestPlugin() { - return new Plugin(TEST_PLUGIN_NAME, TEST_PLUGIN_PATH, "abc123ddd76a2361be08b2b4c7f2b19b"); - } - - private ResourceType createTestPlatformType() { - ResourceType platformType = new ResourceType(TEST_PLATFORM_TYPE_NAME, "", ResourceCategory.PLATFORM, - ResourceType.ANY_PLATFORM_TYPE); - platformType.setPlugin(TEST_PLUGIN_NAME); - platformType.setDescription("test platform type"); - platformType.addChildResourceType(createTestServerType(platformType)); - return platformType; - } - - private ResourceType createTestServerType(ResourceType parentType) { - ResourceType serverType = new ResourceType(TEST_SERVER_TYPE_NAME, "", ResourceCategory.SERVER, parentType); - serverType.setPlugin(TEST_PLUGIN_NAME); - serverType.setDescription("test server type"); - serverType.addChildResourceType(createTestServiceType(serverType)); - return serverType; - } - - private ResourceType createTestServiceType(ResourceType parentType) { - ResourceType serviceType = new ResourceType(TEST_SERVICE_TYPE_NAME, "", ResourceCategory.SERVICE, parentType); - serviceType.setPlugin(TEST_PLUGIN_NAME); - serviceType.setDescription("test service type"); - return serviceType; - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestLocal.java deleted file mode 100644 index d76a2cb..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/DiscoveryTestLocal.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; - -/** - * An EJB for testing the discovery subsystem - used by TestControl.jsp. - */ -@Local -public interface DiscoveryTestLocal { - void registerTestPluginAndTypeInfo(); - - void removeTestPluginAndTypeInfo(); - - void sendTestFullInventoryReport(); - - String clearAutoinventoryQueue(); - - void sendTestRuntimeInventoryReport(); - - void removeTestPlatform(); - - void sendNewPlatform(String platformAddress, int servers, int servicesPerServer); - - void createTestMixedGroup(String groupName); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java deleted file mode 100644 index b9c59fa..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestBean.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.util.Calendar; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import javax.annotation.PostConstruct; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import javax.sql.DataSource; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.rhq.core.clientapi.server.measurement.MeasurementServerService; -import org.rhq.core.db.DatabaseType; -import org.rhq.core.db.DatabaseTypeFactory; -import org.rhq.core.domain.measurement.Availability; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.domain.measurement.MeasurementDataNumeric; -import org.rhq.core.domain.measurement.MeasurementDataPK; -import org.rhq.core.domain.measurement.MeasurementDefinition; -import org.rhq.core.domain.measurement.MeasurementReport; -import org.rhq.core.domain.measurement.MeasurementSchedule; -import org.rhq.core.domain.measurement.MeasurementScheduleRequest; -import org.rhq.core.domain.measurement.MeasurementUnits; -import org.rhq.core.domain.measurement.ResourceMeasurementScheduleRequest; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceCategory; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.util.jdbc.JDBCUtil; -import org.rhq.enterprise.server.RHQConstants; -import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementServerServiceImpl; -import org.rhq.enterprise.server.util.LookupUtil; - -/** - * An EJB for testing the measurement subsystem - used by TestControl.jsp. - */ -@Stateless -@javax.annotation.Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME) -public class MeasurementTestBean implements MeasurementTestLocal { - private final Log log = LogFactory.getLog(MeasurementTestBean.class); - - private static final String FAKE_PLATFORM_NAME = "Fake Platform"; - - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - EntityManager entityManager; - - @javax.annotation.Resource(name = "RHQ_DS") - private DataSource rhqDs; - private DatabaseType databaseType; - - private MeasurementServerService measurementServerService = new MeasurementServerServiceImpl(); - - @EJB - private MeasurementScheduleManagerLocal measurementScheduleManager; - - @PostConstruct - public void init() { - Connection conn = null; - try { - conn = rhqDs.getConnection(); - databaseType = DatabaseTypeFactory.getDatabaseType(conn); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - JDBCUtil.safeClose(conn); - } - } - - /** - * Send a test measurement report, full of lots of fake metrics, to the server. - */ - @SuppressWarnings("deprecation") - public void sendTestMeasurementReport() { - Resource res = setupFakePlatformIfNeeded(); - Set<ResourceMeasurementScheduleRequest> scheds; - int[] resourceIds = new int[] { res.getId() }; - scheds = measurementScheduleManager.findSchedulesForResourceAndItsDescendants(resourceIds, false); - - Date now = new Date(); - MeasurementReport report = new MeasurementReport(); - for (ResourceMeasurementScheduleRequest sched : scheds) { - for (MeasurementScheduleRequest s : sched.getMeasurementSchedules()) { - Calendar cal = Calendar.getInstance(); - cal.setTime(now); - - // send 10 data points per schedule - for (int i = 0; i < 10; i++) { - long dat = cal.getTimeInMillis(); - MeasurementDataNumeric mdn = new MeasurementDataNumeric(new MeasurementDataPK(dat, - s.getScheduleId()), (double) i); - report.addData(mdn); - cal.add(Calendar.SECOND, -1); - } - } - } - - measurementServerService.mergeMeasurementReport(report); - } - - public void addProblemResource() { - Resource res = setupFakePlatformIfNeeded(); - Availability ava = new Availability(res, AvailabilityType.UP); - entityManager.persist(ava); - - if ((res.getSchedules().size() == 0) && (res.getResourceType().getMetricDefinitions().size() > 0)) { - MeasurementDefinition def = res.getResourceType().getMetricDefinitions().iterator().next(); - MeasurementSchedule schedule = new MeasurementSchedule(def, res); - entityManager.persist(schedule); - res.addSchedule(schedule); - } - - entityManager.flush(); - } - - /** - * Set up a fake platform and a MeasurementDefinition for it for several usages. This method will check if the fake - * platform already exists first. - * - * @return - */ - private Resource setupFakePlatformIfNeeded() { - Resource res; - try { - Query q = entityManager.createQuery("SELECT res FROM Resource res WHERE res.name = :name"); - q.setParameter("name", FAKE_PLATFORM_NAME); - res = (Resource) q.getSingleResult(); - } catch (NoResultException nre) { - ResourceType resourceType = new ResourceType("fake platform", "", ResourceCategory.PLATFORM, null); - resourceType.setPlugin("Platforms"); - entityManager.persist(resourceType); - MeasurementDefinition def = new MeasurementDefinition(resourceType, "Fake Definition"); - def.setUnits(MeasurementUnits.SECONDS); - def.setResourceType(resourceType); - entityManager.persist(def); - resourceType.addMetricDefinition(def); - res = new Resource("org.jboss.on.TestPlatfor", FAKE_PLATFORM_NAME, resourceType); - entityManager.persist(res); - entityManager.flush(); - } - - return res; - } - - @SuppressWarnings("deprecation") - public void setAgentCurrentlyScheduledMetrics(double value) { - String scheduleString = "SELECT schedule " + "FROM MeasurementSchedule schedule " - + "WHERE schedule.definition.name = 'CurrentlyScheduleMeasurements' " - + "AND schedule.resource.name LIKE '%Agent%'"; - - Query scheduleQuery = entityManager.createQuery(scheduleString); - MeasurementSchedule schedule = (MeasurementSchedule) scheduleQuery.getSingleResult(); - - MeasurementDataNumeric numericData = new MeasurementDataNumeric(new MeasurementDataPK(schedule.getId()), value); - - entityManager.persist(numericData); - - LookupUtil.getAlertConditionCacheManager().checkConditions(numericData); - } - - public Map<String, Long> snapshotMeasurementTables() { - String qTrue = this.databaseType.getBooleanValue(true); - - String snapshotQuery = "" // - + "select" // - + "(select count(*) from rhq_meas_data_num_r00) as r00," // - + "(select count(*) from rhq_meas_data_num_r01) as r01," // - + "(select count(*) from rhq_meas_data_num_r02) as r02," // - + "(select count(*) from rhq_meas_data_num_r03) as r03," // - + "(select count(*) from rhq_meas_data_num_r04) as r04," // - + "(select count(*) from rhq_meas_data_num_r05) as r05," // - + "(select count(*) from rhq_meas_data_num_r06) as r06," // - + "(select count(*) from rhq_meas_data_num_r07) as r07," // - + "(select count(*) from rhq_meas_data_num_r08) as r08," // - + "(select count(*) from rhq_meas_data_num_r09) as r09," // - + "(select count(*) from rhq_meas_data_num_r10) as r10," // - + "(select count(*) from rhq_meas_data_num_r11) as r11," // - + "(select count(*) from rhq_meas_data_num_r12) as r12," // - + "(select count(*) from rhq_meas_data_num_r13) as r13," // - + "(select count(*) from rhq_meas_data_num_r14) as r14," // - + "(select count(*) from rhq_measurement_data_num_1h) as oneHour," // - + "(select count(*) from rhq_measurement_data_num_6h) as sixHour," // - + "(select count(*) from rhq_measurement_data_num_1d) as oneDay," // - + "(select count(*) from rhq_measurement_data_trait) as trait," // - + "(select count(*) from rhq_measurement_bline) as bline," // - + "(select count(*) from rhq_measurement_oob) as oob," // - + "(select count(*) from rhq_measurement_oob_tmp) as oob_temp," // - + "(select count(*) from rhq_calltime_data_key) as callkey," // - + "(select count(*) from rhq_calltime_data_value) as calldata," // - + "(select count(ms.id) from rhq_measurement_sched ms" // - + " join rhq_measurement_def md on ms.definition = md.id" // - + " where ms.enabled = " + qTrue + " and md.data_type=0) as enabledMetricSchedules," // - + "(select count(ms.id) from rhq_measurement_sched ms" // - + " join rhq_measurement_def md on ms.definition = md.id" // - + " where ms.enabled = " + qTrue + " and md.data_type=1) as enabledTraitSchedules," // - + "(select count(ms.id) from rhq_measurement_sched ms" // - + " join rhq_measurement_def md on ms.definition = md.id" // - + " where ms.enabled = " + qTrue + " and md.data_type=3) as enabledCalltimeSchedules"; - - String querySuffix = ";"; - if (DatabaseTypeFactory.isOracle(this.databaseType)) { - querySuffix = " from dual"; - } - - Map<String, Long> results = new LinkedHashMap<String, Long>(); - - Connection conn = null; - PreparedStatement ps = null; - ResultSet rs = null; - try { - conn = rhqDs.getConnection(); - ps = conn.prepareStatement(snapshotQuery + querySuffix); - rs = ps.executeQuery(); - - String[] columnNames = { "r00", "r01", "r02", "r03", "r04", "r05", "r06", "r07", "r08", "r09", "r10", - "r11", "r12", "r13", "r14", "oneHour", "sixHour", "oneDay", "trait", "bline", "oob", "oob_temp", - "callkey", "calldata", "enabledMetricSchedules", "enabledTraitSchedules", "enabledCalltimeSchedules" }; - if (rs.next()) { - for (String nextColumn : columnNames) { - Long nextValue = rs.getLong(nextColumn); - results.put(nextColumn, nextValue); - } - } - } catch (Throwable t) { - log.error("Could not snapshot measurement tables", t); - } finally { - JDBCUtil.safeClose(conn, ps, rs); - } - - return results; - } - - public static void main(String[] args) { - Map<String, Long> results = new MeasurementTestBean().snapshotMeasurementTables(); - for (Map.Entry<String, Long> nextCount : results.entrySet()) { - String tableAlias = nextCount.getKey(); - Long tableCount = nextCount.getValue(); - - } - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java deleted file mode 100644 index 616bcbe..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/MeasurementTestLocal.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.util.Map; - -import javax.ejb.Local; - -/** - * An EJB for testing the measurement subsystem - used by control.jsp - */ -@Local -public interface MeasurementTestLocal { - void sendTestMeasurementReport(); - - void addProblemResource(); - - void setAgentCurrentlyScheduledMetrics(double value); - - Map<String, Long> snapshotMeasurementTables(); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java deleted file mode 100644 index 89f9d0b..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.util.List; -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.Query; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.enterprise.server.RHQConstants; - -@Stateless -public class ResourceGroupTestBean implements ResourceGroupTestLocal { - private static int compatCounter = 0; - - private int getNextCompat() { - return compatCounter++; - } - - private static int mixedCounter = 0; - - private int getNextMixed() { - return mixedCounter++; - } - - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager entityManager; - - @SuppressWarnings("unchecked") - public void setupCompatibleGroups() { - List<ResourceType> types = entityManager - .createQuery("SELECT rt FROM ResourceType rt WHERE rt.deleted = false") - .getResultList(); - for (ResourceType type : types) { - Query query = entityManager.createQuery("SELECT res FROM Resource res WHERE res.resourceType = :type AND res.resourceType.deleted = false"); - query.setParameter("type", type); - List<Resource> resources = query.getResultList(); - ResourceGroup compatGroup = new ResourceGroup("Compat Group - " + getNextCompat(), type); - entityManager.persist(compatGroup); - - compatGroup.getExplicitResources().addAll(resources); - compatGroup.getImplicitResources().addAll(resources); - for (Resource resource : resources) { - resource.getExplicitGroups().add(compatGroup); - resource.getImplicitGroups().add(compatGroup); - entityManager.merge(resource); - } - - entityManager.merge(compatGroup); - } - } - - @SuppressWarnings("unchecked") - public void setupUberMixedGroup() { - Query query = entityManager.createQuery("SELECT res FROM Resource res"); - List<Resource> resources = query.getResultList(); - ResourceGroup mixedGroup = new ResourceGroup("Mixed Group - " + getNextMixed()); - entityManager.persist(mixedGroup); - - mixedGroup.getExplicitResources().addAll(resources); - mixedGroup.getImplicitResources().addAll(resources); - for (Resource resource : resources) { - resource.getExplicitGroups().add(mixedGroup); - resource.getImplicitGroups().add(mixedGroup); - entityManager.merge(resource); - } - - entityManager.merge(mixedGroup); - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java deleted file mode 100644 index eb426dc..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; - -@Local -public interface ResourceGroupTestLocal { - public void setupUberMixedGroup(); - - public void setupCompatibleGroups(); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java deleted file mode 100644 index dedfc75..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Stateless; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.authz.Role; -import org.rhq.enterprise.server.RHQConstants; - -@Stateless -public class SubjectRoleTestBean implements SubjectRoleTestLocal { - @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) - private EntityManager entityManager; - - public void createRolesAndUsers(int roleCount, int usersInRoleCount) { - long createTime = System.currentTimeMillis(); - for (int i = 0; i < roleCount; i++) { - Role role = new Role("role" + i + "-" + createTime); - entityManager.persist(role); - - for (int j = 0; j < usersInRoleCount; j++) { - Subject subject = new Subject("subject" + i + "-" + j + "-" + createTime, true, false); - entityManager.persist(subject); - - role.addSubject(subject); - entityManager.merge(subject); - } - - entityManager.merge(role); - } - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java deleted file mode 100644 index 7a31234..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; - -@Local -public interface SubjectRoleTestLocal { - /** - * creates roleCount*usersInRoleCount number of objects in the system - * - * @param roleCount the number of roles to create - * @param usersInRoleCount the number of users to create and attach to each role - */ - public void createRolesAndUsers(int roleCount, int usersInRoleCount); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestBean.java new file mode 100644 index 0000000..d628a78 --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestBean.java @@ -0,0 +1,151 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2012 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.server.test; + +import java.lang.management.ManagementFactory; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.LinkedHashMap; +import java.util.Map; + +import javax.annotation.PostConstruct; +import javax.ejb.Stateless; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.sql.DataSource; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.db.DatabaseType; +import org.rhq.core.db.DatabaseTypeFactory; +import org.rhq.core.domain.server.PersistenceUtility; +import org.rhq.core.util.jdbc.JDBCUtil; +import org.rhq.enterprise.server.RHQConstants; + +@Stateless +@javax.annotation.Resource(name = "RHQ_DS", mappedName = RHQConstants.DATASOURCE_JNDI_NAME) +public class TestBean implements TestLocal { + private final Log log = LogFactory.getLog(TestBean.class); + + @PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME) + EntityManager entityManager; + + @javax.annotation.Resource(name = "RHQ_DS") + private DataSource rhqDs; + + private DatabaseType databaseType; + + @PostConstruct + public void init() { + Connection conn = null; + try { + conn = rhqDs.getConnection(); + databaseType = DatabaseTypeFactory.getDatabaseType(conn); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + JDBCUtil.safeClose(conn); + } + } + + @Override + public void enableHibernateStatistics() { + PersistenceUtility.enableHibernateStatistics(entityManager, ManagementFactory.getPlatformMBeanServer(), true); + } + + @Override + public void disableHibernateStatistics() { + PersistenceUtility.enableHibernateStatistics(entityManager, ManagementFactory.getPlatformMBeanServer(), false); + } + + @Override + public Map<String, Long> getMeasurementTableStats() { + String qTrue = this.databaseType.getBooleanValue(true); + + String snapshotQuery = "" // + + "select" // + + "(select count(*) from rhq_meas_data_num_r00) as r00," // + + "(select count(*) from rhq_meas_data_num_r01) as r01," // + + "(select count(*) from rhq_meas_data_num_r02) as r02," // + + "(select count(*) from rhq_meas_data_num_r03) as r03," // + + "(select count(*) from rhq_meas_data_num_r04) as r04," // + + "(select count(*) from rhq_meas_data_num_r05) as r05," // + + "(select count(*) from rhq_meas_data_num_r06) as r06," // + + "(select count(*) from rhq_meas_data_num_r07) as r07," // + + "(select count(*) from rhq_meas_data_num_r08) as r08," // + + "(select count(*) from rhq_meas_data_num_r09) as r09," // + + "(select count(*) from rhq_meas_data_num_r10) as r10," // + + "(select count(*) from rhq_meas_data_num_r11) as r11," // + + "(select count(*) from rhq_meas_data_num_r12) as r12," // + + "(select count(*) from rhq_meas_data_num_r13) as r13," // + + "(select count(*) from rhq_meas_data_num_r14) as r14," // + + "(select count(*) from rhq_measurement_data_num_1h) as oneHour," // + + "(select count(*) from rhq_measurement_data_num_6h) as sixHour," // + + "(select count(*) from rhq_measurement_data_num_1d) as oneDay," // + + "(select count(*) from rhq_measurement_data_trait) as trait," // + + "(select count(*) from rhq_measurement_bline) as bline," // + + "(select count(*) from rhq_measurement_oob) as oob," // + + "(select count(*) from rhq_measurement_oob_tmp) as oob_temp," // + + "(select count(*) from rhq_calltime_data_key) as callkey," // + + "(select count(*) from rhq_calltime_data_value) as calldata," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabled = " + qTrue + " and md.data_type=0) as enabledMetricSchedules," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabled = " + qTrue + " and md.data_type=1) as enabledTraitSchedules," // + + "(select count(ms.id) from rhq_measurement_sched ms" // + + " join rhq_measurement_def md on ms.definition = md.id" // + + " where ms.enabled = " + qTrue + " and md.data_type=3) as enabledCalltimeSchedules"; + + String querySuffix = ";"; + if (DatabaseTypeFactory.isOracle(this.databaseType)) { + querySuffix = " from dual"; + } + + Map<String, Long> results = new LinkedHashMap<String, Long>(); + + Connection conn = null; + PreparedStatement ps = null; + ResultSet rs = null; + try { + conn = rhqDs.getConnection(); + ps = conn.prepareStatement(snapshotQuery + querySuffix); + rs = ps.executeQuery(); + + String[] columnNames = { "r00", "r01", "r02", "r03", "r04", "r05", "r06", "r07", "r08", "r09", "r10", + "r11", "r12", "r13", "r14", "oneHour", "sixHour", "oneDay", "trait", "bline", "oob", "oob_temp", + "callkey", "calldata", "enabledMetricSchedules", "enabledTraitSchedules", "enabledCalltimeSchedules" }; + if (rs.next()) { + for (String nextColumn : columnNames) { + Long nextValue = rs.getLong(nextColumn); + results.put(nextColumn, nextValue); + } + } + } catch (Throwable t) { + log.error("Could not snapshot measurement tables", t); + } finally { + JDBCUtil.safeClose(conn, ps, rs); + } + + return results; + } +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestLocal.java new file mode 100644 index 0000000..cc3f2cb --- /dev/null +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/TestLocal.java @@ -0,0 +1,35 @@ +/* + * RHQ Management Platform + * Copyright (C) 2005-2008 Red Hat, Inc. + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +package org.rhq.enterprise.server.test; + +import java.util.Map; + +import javax.ejb.Local; + +/** + * An EJB for test pages. For example, used by control.jsp + */ +@Local +public interface TestLocal { + Map<String, Long> getMeasurementTableStats(); + + void enableHibernateStatistics(); + + void disableHibernateStatistics(); +} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java index 5bc49dc..c3a4945 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java @@ -195,20 +195,8 @@ import org.rhq.enterprise.server.system.SystemManagerBean; import org.rhq.enterprise.server.system.SystemManagerLocal; import org.rhq.enterprise.server.tagging.TagManagerBean; import org.rhq.enterprise.server.tagging.TagManagerLocal; -import org.rhq.enterprise.server.test.AccessBean; -import org.rhq.enterprise.server.test.AccessLocal; -import org.rhq.enterprise.server.test.AlertTemplateTestBean; -import org.rhq.enterprise.server.test.AlertTemplateTestLocal; -import org.rhq.enterprise.server.test.CoreTestBean; -import org.rhq.enterprise.server.test.CoreTestLocal; -import org.rhq.enterprise.server.test.DiscoveryTestBean; -import org.rhq.enterprise.server.test.DiscoveryTestLocal; -import org.rhq.enterprise.server.test.MeasurementTestBean; -import org.rhq.enterprise.server.test.MeasurementTestLocal; -import org.rhq.enterprise.server.test.ResourceGroupTestBean; -import org.rhq.enterprise.server.test.ResourceGroupTestLocal; -import org.rhq.enterprise.server.test.SubjectRoleTestBean; -import org.rhq.enterprise.server.test.SubjectRoleTestLocal; +import org.rhq.enterprise.server.test.TestBean; +import org.rhq.enterprise.server.test.TestLocal;
/** * Methods that allow POJO objects to obtain references to EJB/JPA objects. These convenience methods attempt to @@ -331,10 +319,6 @@ public final class LookupUtil { return lookupLocal(AlertSubsystemManagerBean.class); }
- public static AlertTemplateTestLocal getAlertTemplateTestBean() { - return lookupLocal(AlertTemplateTestBean.class); - } - public static AuthorizationManagerLocal getAuthorizationManager() { return lookupLocal(AuthorizationManagerBean.class); } @@ -559,10 +543,6 @@ public final class LookupUtil { return lookupLocal(SubjectManagerBean.class); }
- public static SubjectRoleTestLocal getSubjectRoleTestBean() { - return lookupLocal(SubjectRoleTestBean.class); - } - public static SystemManagerLocal getSystemManager() { return lookupLocal(SystemManagerBean.class); } @@ -642,28 +622,11 @@ public final class LookupUtil { return mbs; }
- //-------------------------------------------- - // The TEST services - //-------------------------------------------- - - public static AccessLocal getAccessLocal() { - return lookupLocal(AccessBean.class); - } - - public static CoreTestLocal getCoreTest() { - return lookupLocal(CoreTestBean.class); - } - - public static DiscoveryTestLocal getDiscoveryTest() { - return lookupLocal(DiscoveryTestBean.class); - } - - public static MeasurementTestLocal getMeasurementTest() { - return lookupLocal(MeasurementTestBean.class); - } - - public static ResourceGroupTestLocal getResourceGroupTestBean() { - return lookupLocal(ResourceGroupTestBean.class); + /** + * This is a test bean used only by test code or by things like control.jsp. + */ + public static TestLocal getTest() { + return lookupLocal(TestBean.class); }
// Private Methods
rhq-commits@lists.fedorahosted.org