modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/TestBundleServerPluginService.java
| 4 +
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/test/ResourceFactoryManagerBeanTest.java
| 8 ++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginService.java
| 33 ++++++++++
modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginServiceMBean.java
| 31 +++++++++
4 files changed, 76 insertions(+)
New commits:
commit bdcff81c5db08b376358fe4467f80683f8b594f1
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Mar 4 14:11:17 2011 +0100
Fixing the ResourceFactoryManagerBeanTest and the bundle tests by correctly
initializing the server plugin master container. Whenever we create a package, we need a
package type plugin container initialized now.
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/TestBundleServerPluginService.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/TestBundleServerPluginService.java
index cb3f16e..61c53d3 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/TestBundleServerPluginService.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/bundle/TestBundleServerPluginService.java
@@ -49,6 +49,7 @@ import
org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginFacet;
import org.rhq.enterprise.server.plugin.pc.bundle.BundleServerPluginManager;
import org.rhq.enterprise.server.plugin.pc.content.ContentServerPluginContainer;
import org.rhq.enterprise.server.plugin.pc.content.ContentServerPluginManager;
+import org.rhq.enterprise.server.plugin.pc.content.PackageTypeServerPluginContainer;
import org.rhq.enterprise.server.xmlschema.ServerPluginDescriptorMetadataParser;
import
org.rhq.enterprise.server.xmlschema.generated.serverplugin.ServerPluginDescriptorType;
@@ -88,6 +89,9 @@ public class TestBundleServerPluginService extends ServerPluginService
implement
bundlePC = new TestBundleServerPluginContainer(this);
pcs.add(bundlePC);
pcs.add(new TestContentServerPluginContainer(this));
+
+ //needed internally by the server, so let's provide the standard impl.
+ pcs.add(new PackageTypeServerPluginContainer(this));
return pcs;
}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/test/ResourceFactoryManagerBeanTest.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/test/ResourceFactoryManagerBeanTest.java
index 2525cdb..aa30bf5 100644
---
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/test/ResourceFactoryManagerBeanTest.java
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/resource/test/ResourceFactoryManagerBeanTest.java
@@ -55,9 +55,11 @@ import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.plugin.pc.ServerPluginService;
import org.rhq.enterprise.server.resource.ResourceFactoryManagerLocal;
import org.rhq.enterprise.server.resource.ResourceManagerLocal;
import org.rhq.enterprise.server.test.AbstractEJB3Test;
+import org.rhq.enterprise.server.test.StandardServerPluginService;
import org.rhq.enterprise.server.test.TestServerCommunicationsService;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -92,12 +94,18 @@ public class ResourceFactoryManagerBeanTest extends AbstractEJB3Test
{
prepareScheduler();
TestServerCommunicationsService agentServiceContainer = prepareForTestAgents();
agentServiceContainer.resourceFactoryService = mockAgentService;
+
+ //the server plugins are in play when package types are involved
+ StandardServerPluginService serverPluginService = new
StandardServerPluginService();
+ prepareCustomServerPluginService(serverPluginService);
+ serverPluginService.startMasterPluginContainer();
}
@AfterClass
public void teardownAfterClass() throws Exception {
unprepareForTestAgents();
unprepareScheduler();
+ unprepareServerPluginService();
}
@BeforeMethod
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginService.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginService.java
new file mode 100644
index 0000000..a5ac8df
--- /dev/null
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginService.java
@@ -0,0 +1,33 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-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 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 org.rhq.enterprise.server.plugin.pc.ServerPluginService;
+
+/**
+ * An MBean to use as a ServerPluginService for tests that actually don't care
+ * about the server plugin services but need the server to have the server plugin
+ * infrastructure started up.
+ *
+ * @author Lukas Krejci
+ */
+public class StandardServerPluginService extends ServerPluginService implements
StandardServerPluginServiceMBean {
+
+}
diff --git
a/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginServiceMBean.java
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginServiceMBean.java
new file mode 100644
index 0000000..232ff17
--- /dev/null
+++
b/modules/enterprise/server/jar/src/test/java/org/rhq/enterprise/server/test/StandardServerPluginServiceMBean.java
@@ -0,0 +1,31 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-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 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 org.rhq.enterprise.server.plugin.pc.ServerPluginServiceManagement;
+
+/**
+ * A generic MBean interface for tests that need a ServerPluginService setup.
+ *
+ * @author Lukas Krejci
+ */
+public interface StandardServerPluginServiceMBean extends ServerPluginServiceManagement
{
+
+}
Show replies by date