Author: julien(a)jboss.com
Date: 2008-02-02 09:07:45 -0500 (Sat, 02 Feb 2008)
New Revision: 9712
Modified:
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployer.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployment.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/HibernateSupport.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/generic/agent/GenericTestAgent.java
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/BaseRunner.java
Log:
update jboss unit to use jboss logging
Modified:
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
---
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -44,6 +44,7 @@
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.impl.SimpleTestInfo;
+import org.jboss.logging.Logger;
import java.net.URL;
@@ -54,6 +55,9 @@
public class RemoteTestDriverClient extends BasicBootstrap implements TestDriver
{
+ /** . */
+ private static Logger log =
org.jboss.logging.Logger.getLogger(RemoteTestDriverClient.class);
+
// Config
/** Need to make initial node id configurable somehow. */
@@ -152,11 +156,18 @@
this.serverName = context.getProperty("serverName");
//
+ log.debug("Initializing remote test driving client");
+ log.debug("Archive path = " + archivePath);
+ log.debug("Server name = " + serverName);
+
+ //
+ log.debug("Booting kernel");
run();
// Install our self first
try
{
+ log.debug("Installing TestDriver bean");
AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestDriver",
getClass().getName());
AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
bmd.setConstructor(cmd);
@@ -168,13 +179,21 @@
}
catch (Throwable throwable)
{
- throw new DriverException("Could not start the kernel", throwable);
+ throw new DriverException("Could not install the TestDriver bean",
throwable);
}
// Now deploy beans
try
{
- URL url =
getClass().getResource("/org/jboss/unit/remote/driver/jboss-beans.xml");
+ String location = "/org/jboss/unit/remote/driver/jboss-beans.xml";
+ URL url = getClass().getResource(location);
+ if (url == null)
+ {
+ log.debug("The file jboss-beans.xml supposed to be located under "
+ location + " could not be found");
+ }
+
+ //
+ log.debug("Now deploying the beans with url " + url);
beanDeployer = new BeanXMLDeployer(getKernel());
deployment = beanDeployer.deploy(url);
beanDeployer.validate();
@@ -183,9 +202,14 @@
String archiveId = context.getProperty("archiveId");
if (archiveId != null)
{
+ log.debug("Going to deploy " + archiveId);
Node node = nodeManager.getNode(NodeId.DEFAULT);
deployer.deploy(archivePath, archiveId, node);
}
+ else
+ {
+ log.debug("No archive id was provided");
+ }
}
catch (Throwable throwable)
{
Modified:
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
===================================================================
---
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/remote/src/main/java/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -34,7 +34,7 @@
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.auth.AuthScope;
import org.apache.commons.httpclient.params.HttpMethodParams;
-import org.apache.log4j.Logger;
+import org.jboss.logging.Logger;
import org.jboss.unit.remote.http.HttpRequest;
import org.jboss.unit.remote.http.HttpHeaders;
import org.jboss.unit.remote.http.HttpHeader;
@@ -67,7 +67,7 @@
{
/** . */
- private final Logger log = Logger.getLogger(getClass());
+ private final org.jboss.logging.Logger log = Logger.getLogger(getClass());
/** . */
private final HttpClient client;
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployer.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployer.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployer.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -41,6 +41,9 @@
{
/** . */
+ private static final org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(Deployer.class);
+
+ /** . */
private Map<URL,Deployment> deployments;
public void create()
@@ -85,7 +88,16 @@
public void deploy(File parent, String childName, Node[] nodes) throws Exception
{
- deploy(new File(parent, childName).toURL(), nodes);
+ File file = new File(parent, childName);
+ if (!file.exists())
+ {
+ String msg = "Cannot deploy inexisting file " +
file.getAbsolutePath();
+ log.error(msg);
+ throw new IllegalArgumentException(msg);
+ }
+
+ //
+ deploy(file.toURL(), nodes);
}
public void deploy(String url, Node node) throws Exception
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployment.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployment.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/deployment/Deployment.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -23,7 +23,7 @@
package org.jboss.portal.test.framework.deployment;
-import org.apache.log4j.Logger;
+import org.jboss.logging.Logger;
import org.jboss.portal.test.framework.agent.TestAgent;
import org.jboss.portal.test.framework.server.Node;
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/HibernateSupport.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/HibernateSupport.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/HibernateSupport.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -35,7 +35,7 @@
import org.jboss.portal.common.io.IOTools;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
-import org.apache.log4j.Logger;
+import org.jboss.logging.Logger;
import javax.transaction.Synchronization;
import java.util.Collection;
@@ -115,11 +115,11 @@
//
if (jndiName == null)
{
- log = Logger.getLogger(HibernateSupport.class);
+ log = org.jboss.logging.Logger.getLogger(HibernateSupport.class);
}
else
{
- log = Logger.getLogger(jndiName);
+ log = org.jboss.logging.Logger.getLogger(jndiName);
}
}
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSService.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -24,7 +24,6 @@
package org.jboss.portal.test.framework.embedded.opends;
import org.opends.server.core.DirectoryServer;
-import org.apache.log4j.Logger;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -44,7 +43,7 @@
public class OpenDSService implements OpenDSServiceMBean
{
- private static final Logger log = Logger.getLogger(OpenDSService.class);
+ private static final org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(OpenDSService.class);
public static String objectName = "portal.test:service=OpenDSService";
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/embedded/opends/OpenDSUtil.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -27,7 +27,6 @@
import org.opends.server.tools.LDAPDelete;
import org.opends.server.tools.LDAPModify;
import org.opends.server.tools.LDAPSearch;
-import org.apache.log4j.Logger;
import java.net.URL;
import java.io.File;
@@ -44,7 +43,7 @@
*/
public class OpenDSUtil
{
- private static final Logger log = Logger.getLogger(OpenDSUtil.class);
+ private static final org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(OpenDSUtil.class);
public OpenDSUtil()
{
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/generic/agent/GenericTestAgent.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/generic/agent/GenericTestAgent.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/impl/generic/agent/GenericTestAgent.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -33,6 +33,7 @@
import org.codehaus.cargo.container.configuration.Configuration;
import org.codehaus.cargo.container.property.RemotePropertySet;
import org.codehaus.cargo.container.Container;
+import org.jboss.logging.Logger;
import java.net.URL;
import java.net.URISyntaxException;
@@ -46,6 +47,9 @@
{
/** . */
+ private static Logger log =
org.jboss.logging.Logger.getLogger(GenericTestAgent.class);
+
+ /** . */
private Deployer cargoDeployer;
/** . */
@@ -115,13 +119,17 @@
public void deploy(URL url) throws Exception
{
Deployable deployable = createDeployable(url);
+ log.debug("Going to deploy " + url);
cargoDeployer.deploy(deployable);
+ log.debug("Deployed " + url);
}
public void undeploy(URL url) throws Exception
{
Deployable deployable = createDeployable(url);
+ log.debug("Going to undeploy " + url);
cargoDeployer.undeploy(deployable);
+ log.debug("Undeployed " + url);
}
private Deployable createDeployable(URL url) throws URISyntaxException,
IllegalArgumentException
Modified:
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/BaseRunner.java
===================================================================
---
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/BaseRunner.java 2008-02-02
02:16:21 UTC (rev 9711)
+++
modules/test/trunk/test/src/main/java/org/jboss/portal/test/framework/runner/BaseRunner.java 2008-02-02
14:07:45 UTC (rev 9712)
@@ -26,7 +26,6 @@
import org.jboss.portal.test.framework.server.NodeManager;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.mc.TestRuntimeContext;
-import org.apache.log4j.Logger;
import org.apache.log4j.Appender;
import org.apache.log4j.SimpleLayout;
import org.apache.log4j.Level;
@@ -47,8 +46,8 @@
static
{
Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
+ org.jboss.logging.Logger.getRoot().addAppender(appender);
+ org.jboss.logging.Logger.getRoot().setLevel(Level.INFO);
}
/** . */