JBoss Portal SVN: r8617 - in modules/test/trunk/unit/src/main/org/jboss: test/unit/runner/event and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-12 10:10:24 -0400 (Fri, 12 Oct 2007)
New Revision: 8617
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullFilter.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerEventBroadcasterSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerLifeCycleFilter.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/filter/NullFilter.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
Log:
moved classes to correct locations
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -28,7 +28,7 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -24,8 +24,7 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerEventBroadcasterSupportTests.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -25,7 +25,7 @@
import static org.jboss.unit.api.Assert.*;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
import static org.jboss.unit.util.CollectionTools.list;
import java.util.ArrayList;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/event/TestRunnerLifeCycleFilterTests.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -26,9 +26,9 @@
import static org.jboss.unit.api.Assert.assertSame;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
-import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerEventBroadcasterSupport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerEventBroadcasterSupport.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerEventBroadcasterSupport.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -1,100 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner.event;
-
-import org.jboss.unit.runner.TestRunnerEventListener;
-import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Maintains a set of listeners that will receive events when the <code>fireEvent(TestRunnerEvent event)</code> method
- * is invoked. When a listener method is invoked, any exception is caught and logged, this include checked and unchecked
- * exception. Any other kind of unchecked throwable will not be handled.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestRunnerEventBroadcasterSupport implements TestRunnerEventBroadcaster
-{
-
- /** . */
- private List<TestRunnerEventListener> listeners = new ArrayList<TestRunnerEventListener>();
-
- /**
- * Add a listener to the set of listeners.
- *
- * @param listener the listener to add
- * @throws IllegalArgumentException if the listener is null
- */
- public void addListener(TestRunnerEventListener listener) throws IllegalArgumentException
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- if (!listeners.contains(listener))
- {
- listeners.add(listener);
- }
- }
-
- /**
- * Remove a listener from the set of listeners.
- *
- * @param listener the listener to remove
- * @throws IllegalArgumentException if the listener is null
- */
- public void removeListener(TestRunnerEventListener listener)
- {
- if (listener == null)
- {
- throw new IllegalArgumentException("No null listener accepted");
- }
- if (listeners.contains(listener))
- {
- listeners.remove(listener);
- }
- }
-
- public void fireEvent(TestRunnerEvent event)
- {
- if (event == null)
- {
- throw new IllegalArgumentException();
- }
- for (TestRunnerEventListener listener : listeners)
- {
- try
- {
- listener.onEvent(event);
- }
- catch (Exception e)
- {
-// e.printStackTrace();
- }
- }
- }
-}
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerLifeCycleFilter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerLifeCycleFilter.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerLifeCycleFilter.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -1,52 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner.event;
-
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestRunnerEventListener;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestRunnerLifeCycleFilter implements TestRunnerEventListener
-{
-
- /** . */
- private final TestRunnerEventBroadcaster broadcaster;
-
- public TestRunnerLifeCycleFilter(TestRunnerEventBroadcaster broadcaster)
- {
- this.broadcaster = broadcaster;
- }
-
- public void onEvent(TestRunnerEvent event)
- {
- if (event instanceof StartRunnerEvent || event instanceof EndRunnerEvent)
- {
- return;
- }
- broadcaster.fireEvent(event);
- }
-}
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/runner/filter/NullFilter.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/filter/NullFilter.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/filter/NullFilter.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -1,55 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner.filter;
-
-import org.jboss.unit.runner.TestFilter;
-import org.jboss.unit.TestId;
-import org.jboss.unit.info.TestInfo;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullFilter implements TestFilter
-{
-
- /** . */
- private static final NullFilter instance = new NullFilter();
-
- public static NullFilter getInstance()
- {
- return instance;
- }
-
- public boolean include(TestId testId, TestInfo testInfo)
- {
- return true;
- }
-
- public boolean include(TestId testId, Map<String, String> parametrization, TestInfo testInfo)
- {
- return true;
- }
-}
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullFilter.java (from rev 8600, modules/test/trunk/unit/src/main/org/jboss/unit/runner/filter/NullFilter.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullFilter.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullFilter.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner.impl;
+
+import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.TestId;
+import org.jboss.unit.info.TestInfo;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullFilter implements TestFilter
+{
+
+ /** . */
+ private static final NullFilter instance = new NullFilter();
+
+ public static NullFilter getInstance()
+ {
+ return instance;
+ }
+
+ public boolean include(TestId testId, TestInfo testInfo)
+ {
+ return true;
+ }
+
+ public boolean include(TestId testId, Map<String, String> parametrization, TestInfo testInfo)
+ {
+ return true;
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -25,8 +25,8 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
-import org.jboss.unit.runner.filter.NullFilter;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.NullFilter;
import java.util.Map;
import java.util.HashMap;
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java (from rev 8600, modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerEventBroadcasterSupport.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerEventBroadcasterSupport.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -0,0 +1,100 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner.impl;
+
+import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.TestRunnerEvent;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Maintains a set of listeners that will receive events when the <code>fireEvent(TestRunnerEvent event)</code> method
+ * is invoked. When a listener method is invoked, any exception is caught and logged, this include checked and unchecked
+ * exception. Any other kind of unchecked throwable will not be handled.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRunnerEventBroadcasterSupport implements TestRunnerEventBroadcaster
+{
+
+ /** . */
+ private List<TestRunnerEventListener> listeners = new ArrayList<TestRunnerEventListener>();
+
+ /**
+ * Add a listener to the set of listeners.
+ *
+ * @param listener the listener to add
+ * @throws IllegalArgumentException if the listener is null
+ */
+ public void addListener(TestRunnerEventListener listener) throws IllegalArgumentException
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ if (!listeners.contains(listener))
+ {
+ listeners.add(listener);
+ }
+ }
+
+ /**
+ * Remove a listener from the set of listeners.
+ *
+ * @param listener the listener to remove
+ * @throws IllegalArgumentException if the listener is null
+ */
+ public void removeListener(TestRunnerEventListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException("No null listener accepted");
+ }
+ if (listeners.contains(listener))
+ {
+ listeners.remove(listener);
+ }
+ }
+
+ public void fireEvent(TestRunnerEvent event)
+ {
+ if (event == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ for (TestRunnerEventListener listener : listeners)
+ {
+ try
+ {
+ listener.onEvent(event);
+ }
+ catch (Exception e)
+ {
+// e.printStackTrace();
+ }
+ }
+ }
+}
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java (from rev 8600, modules/test/trunk/unit/src/main/org/jboss/unit/runner/event/TestRunnerLifeCycleFilter.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerLifeCycleFilter.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner.impl;
+
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.TestRunnerEvent;
+import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.event.StartRunnerEvent;
+import org.jboss.unit.runner.event.EndRunnerEvent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRunnerLifeCycleFilter implements TestRunnerEventListener
+{
+
+ /** . */
+ private final TestRunnerEventBroadcaster broadcaster;
+
+ public TestRunnerLifeCycleFilter(TestRunnerEventBroadcaster broadcaster)
+ {
+ this.broadcaster = broadcaster;
+ }
+
+ public void onEvent(TestRunnerEvent event)
+ {
+ if (event instanceof StartRunnerEvent || event instanceof EndRunnerEvent)
+ {
+ return;
+ }
+ broadcaster.fireEvent(event);
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -26,8 +26,8 @@
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import java.util.Collection;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -25,9 +25,9 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.ParametrizationSet;
import org.jboss.unit.runner.TestRunnerContext;
-import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
+import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -27,9 +27,9 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
-import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.model.pojo.POJOTestSuiteDef;
import org.jboss.unit.runner.model.pojo.TestClassDef;
import org.jboss.unit.runner.model.pojo.TestCaseDef;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -24,7 +24,7 @@
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.impl.TestRunnerContextSupport;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.tooling.filter.MainTestFilter;
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 14:06:35 UTC (rev 8616)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 14:10:24 UTC (rev 8617)
@@ -24,8 +24,8 @@
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunner;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
-import org.jboss.unit.runner.filter.NullFilter;
+import org.jboss.unit.runner.impl.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.NullFilter;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.report.impl.junit.JUnitReporter;
16 years, 8 months
JBoss Portal SVN: r8616 - in modules/test/trunk/unit/src/main/org/jboss/unit/runner: impl and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-12 10:06:35 -0400 (Fri, 12 Oct 2007)
New Revision: 8616
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
Log:
removed useless class
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 14:06:35 UTC (rev 8616)
@@ -22,10 +22,8 @@
******************************************************************************/
package org.jboss.unit.runner;
-import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
-import org.jboss.unit.runner.impl.NullTestRunnerContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java 2007-10-12 14:05:39 UTC (rev 8615)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java 2007-10-12 14:06:35 UTC (rev 8616)
@@ -1,62 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner.impl;
-
-import org.jboss.unit.runner.filter.NullFilter;
-import org.jboss.unit.runner.TestRunnerContext;
-import org.jboss.unit.runner.TestFilter;
-import org.jboss.unit.runner.TestRunnerEventBroadcaster;
-
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullTestRunnerContext implements TestRunnerContext
-{
-
- /** . */
- private static final NullTestRunnerContext instance = new NullTestRunnerContext();
-
- public static NullTestRunnerContext getInstance()
- {
- return instance;
- }
-
- public Map<String, String> getProperties()
- {
- return Collections.emptyMap();
- }
-
- public TestFilter getFilter()
- {
- return NullFilter.getInstance();
- }
-
- public TestRunnerEventBroadcaster getEventBroadcaster()
- {
- return null;
- }
-}
16 years, 8 months
JBoss Portal SVN: r8615 - in modules/test/trunk/unit/src/main/org/jboss: test/unit/runner and 8 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-12 10:05:39 -0400 (Fri, 12 Oct 2007)
New Revision: 8615
Added:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
Removed:
modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java
Modified:
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
Log:
moved the test runner listener as part of the test runner contet
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTestTwo.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -28,6 +28,8 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.xml.sax.InputSource;
@@ -51,11 +53,13 @@
TestRunnerEventListener junitReporter = new JUnitReporter("output", BlahTestTwo.class.getName());
// add listeners
- runner.addListener(junitReporter);
- runner.addListener(new PrintListener());
+ TestRunnerEventBroadcasterSupport broadcaster = new TestRunnerEventBroadcasterSupport();
+ broadcaster.addListener(junitReporter);
+ broadcaster.addListener(new PrintListener());
+
// run the test
- runner.run();
+ runner.run(new TestRunnerContextSupport(broadcaster));
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/blah/BlahTests.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -24,6 +24,9 @@
import org.jboss.unit.report.impl.writer.PrintListener;
import org.jboss.unit.runner.TestRunner;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.xml.sax.InputSource;
@@ -47,9 +50,10 @@
TestRunner runner = suite.createRunner();
- runner.addListener(new PrintListener());
+ TestRunnerEventBroadcasterSupport broadcaster = new TestRunnerEventBroadcasterSupport();
+ broadcaster.addListener(new PrintListener());
- runner.run();
+ runner.run(new TestRunnerContextSupport(broadcaster));
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -24,11 +24,11 @@
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.AbstractTestRunner;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestRunnerEvent;
-import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerContext;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.impl.composite.CompositeTestRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import static org.jboss.unit.api.Assert.*;
import static org.jboss.unit.util.CollectionTools.*;
@@ -46,9 +46,9 @@
private static List<TestRunnerEvent> events = new ArrayList<TestRunnerEvent>();
- private static TestRunnerEventListener listener = new TestRunnerEventListener()
+ private static TestRunnerEventBroadcaster listener = new TestRunnerEventBroadcaster()
{
- public void onEvent(TestRunnerEvent event)
+ public void fireEvent(TestRunnerEvent event) throws IllegalArgumentException
{
events.add(event);
}
@@ -71,8 +71,7 @@
runners.add(runner1);
runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
- runner.addListener(listener);
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
assertTrue(runner1.invoked);
assertTrue(runner2.invoked);
assertEquals(4, events.size());
@@ -88,10 +87,9 @@
runners.add(runner1);
runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
- runner.addListener(listener);
try
{
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
fail();
}
catch (RuntimeException e)
@@ -112,10 +110,9 @@
runners.add(runner1);
runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
- runner.addListener(listener);
try
{
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
fail();
}
catch (RuntimeException e)
@@ -135,10 +132,9 @@
runners.add(runner1);
runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
- runner.addListener(listener);
try
{
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
fail();
}
catch (Error e)
@@ -159,10 +155,9 @@
runners.add(runner1);
runners.add(runner2);
CompositeTestRunner runner = new CompositeTestRunner(runners);
- runner.addListener(listener);
try
{
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
fail();
}
catch (Error e)
@@ -185,7 +180,7 @@
protected void internalRun(TestRunnerContext context)
{
invoked = true;
- fireEvent(event);
+ context.getEventBroadcaster().fireEvent(event);
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -23,6 +23,7 @@
package org.jboss.test.unit.runner;
import org.jboss.unit.runner.impl.generic.GenericTestRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
import org.jboss.unit.runner.model.generic.TestDef;
import org.jboss.unit.driver.TestDriver;
@@ -64,7 +65,7 @@
Driver1.init();
GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
GenericTestRunner runner = new GenericTestRunner(suite);
- runner.run();
+ runner.run(new TestRunnerContextSupport());
assertEquals(list(), Driver1.ids);
assertEquals(list(), Driver1.parametrizations);
}
@@ -76,7 +77,7 @@
GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
suite.addTest(new TestDef(new TestId("foo")));
GenericTestRunner runner = new GenericTestRunner(suite);
- runner.run();
+ runner.run(new TestRunnerContextSupport());
assertEquals(list(new TestId("foo")), Driver1.ids);
assertEquals(list(new HashMap()), Driver1.parametrizations);
}
@@ -89,7 +90,7 @@
GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
suite.addTest(new TestDef(new TestId("foo")));
GenericTestRunner runner = new GenericTestRunner(suite);
- runner.run();
+ runner.run(new TestRunnerContextSupport());
assertEquals(list(new TestId("foo")), Driver1.ids);
assertEquals(list(new HashMap()), Driver1.parametrizations);
}
@@ -101,7 +102,7 @@
Driver1.testSuiteInfo.addTest(new SimpleTestCaseInfo("bar"));
GenericTestSuiteDef suite = new GenericTestSuiteDef(Driver1.class.getName());
GenericTestRunner runner = new GenericTestRunner(suite);
- runner.run();
+ runner.run(new TestRunnerContextSupport());
assertEquals(list(new TestId("foo"), new TestId("bar")), Driver1.ids);
assertEquals(list(new HashMap(), new HashMap()), Driver1.parametrizations);
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -23,10 +23,12 @@
package org.jboss.test.unit.runner;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestResult;
import org.jboss.unit.runner.ParametrizationSet;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
import org.jboss.unit.runner.results.TestFailure;
import org.jboss.unit.runner.results.TestSuccess;
import org.jboss.unit.runner.event.EndTestEvent;
@@ -100,10 +102,9 @@
//
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo"), new TestId("Bar")));
@@ -137,10 +138,9 @@
//
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo")));
@@ -183,10 +183,9 @@
//
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo"), new TestId("Foo")));
@@ -221,10 +220,9 @@
//
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(new ArrayList<TestId>());
@@ -241,10 +239,9 @@
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo")));
@@ -269,10 +266,9 @@
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo")));
@@ -297,10 +293,9 @@
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo")));
@@ -325,10 +320,9 @@
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
EventList listener = new EventList();
- runner.addListener(listener);
//
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
//
testDriver.assertIdList(list(new TestId("Foo")));
@@ -356,12 +350,11 @@
testDriver.info.addTest(new SimpleTestCaseInfo("Foo"));
TestDriverRunner runner = new TestDriverRunner(testDriver, new TestId());
EventList listener = new EventList();
- runner.addListener(listener);
//
try
{
- runner.run();
+ runner.run(new TestRunnerContextSupport(listener));
}
catch (Error e)
{
@@ -445,13 +438,13 @@
assertInstanceOf(event, EndRunnerEvent.class);
}
- private static class EventList implements TestRunnerEventListener
+ private static class EventList implements TestRunnerEventBroadcaster
{
/** . */
private final List<TestRunnerEvent> events = new ArrayList<TestRunnerEvent>();
- public void onEvent(TestRunnerEvent event)
+ public void fireEvent(TestRunnerEvent event) throws IllegalArgumentException
{
events.add(event);
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -25,6 +25,7 @@
import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
+import org.jboss.unit.runner.impl.NullTestRunnerContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -33,44 +34,16 @@
public abstract class AbstractTestRunner implements TestRunner
{
- /** . */
- protected final TestRunnerEventBroadcasterSupport broadcaster;
-
protected AbstractTestRunner()
{
- this(new TestRunnerEventBroadcasterSupport());
}
- protected AbstractTestRunner(TestRunnerEventBroadcasterSupport broadcaster)
- {
- this.broadcaster = broadcaster;
- }
-
- public void addListener(TestRunnerEventListener listener)
- {
- broadcaster.addListener(listener);
- }
-
- public void removeListener(TestRunnerEventListener listener)
- {
- broadcaster.removeListener(listener);
- }
-
- protected final void fireEvent(TestRunnerEvent event)
- {
- broadcaster.fireEvent(event);
- }
-
- public final void run()
- {
- run(NullTestRunnerContext.getInstance());
- }
-
public final void run(TestRunnerContext context)
{
- fireEvent(new StartRunnerEvent());
+ TestRunnerEventBroadcaster broadcaster = context.getEventBroadcaster();
+ broadcaster.fireEvent(new StartRunnerEvent());
internalRun(context);
- fireEvent(new EndRunnerEvent());
+ broadcaster.fireEvent(new EndRunnerEvent());
}
protected abstract void internalRun(TestRunnerContext context);
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -1,54 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.runner;
-
-import org.jboss.unit.runner.filter.NullFilter;
-
-import java.util.Map;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NullTestRunnerContext implements TestRunnerContext
-{
-
- /** . */
- private static final NullTestRunnerContext instance = new NullTestRunnerContext();
-
- public static NullTestRunnerContext getInstance()
- {
- return instance;
- }
-
- public Map<String, String> getProperties()
- {
- return Collections.emptyMap();
- }
-
- public TestFilter getFilter()
- {
- return NullFilter.getInstance();
- }
-}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -31,12 +31,6 @@
public interface TestRunner
{
- void addListener(TestRunnerEventListener listener);
-
- void removeListener(TestRunnerEventListener listener);
-
- void run();
-
void run(TestRunnerContext context);
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -35,4 +35,6 @@
TestFilter getFilter();
+ TestRunnerEventBroadcaster getEventBroadcaster();
+
}
Copied: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java (from rev 8613, modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java)
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/NullTestRunnerContext.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner.impl;
+
+import org.jboss.unit.runner.filter.NullFilter;
+import org.jboss.unit.runner.TestRunnerContext;
+import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullTestRunnerContext implements TestRunnerContext
+{
+
+ /** . */
+ private static final NullTestRunnerContext instance = new NullTestRunnerContext();
+
+ public static NullTestRunnerContext getInstance()
+ {
+ return instance;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
+
+ public TestFilter getFilter()
+ {
+ return NullFilter.getInstance();
+ }
+
+ public TestRunnerEventBroadcaster getEventBroadcaster()
+ {
+ return null;
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/TestRunnerContextSupport.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner.impl;
+
+import org.jboss.unit.runner.TestRunnerContext;
+import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerEventBroadcaster;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
+import org.jboss.unit.runner.filter.NullFilter;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestRunnerContextSupport implements TestRunnerContext
+{
+
+ /** . */
+ private Map<String,String> properties;
+
+ /** . */
+ private TestFilter filter;
+
+ /** . */
+ private TestRunnerEventBroadcaster eventBroadcaster;
+
+
+ public TestRunnerContextSupport(TestRunnerEventBroadcaster eventBroadcaster)
+ {
+ this(new HashMap<String, String>(), NullFilter.getInstance(), eventBroadcaster);
+ }
+
+ public TestRunnerContextSupport()
+ {
+ this(new HashMap<String, String>(), NullFilter.getInstance(), new TestRunnerEventBroadcasterSupport());
+ }
+
+ public TestRunnerContextSupport(Map<String, String> properties, TestFilter filter, TestRunnerEventBroadcaster eventBroadcaster)
+ {
+ this.properties = properties;
+ this.filter = filter;
+ this.eventBroadcaster = eventBroadcaster;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public TestFilter getFilter()
+ {
+ return filter;
+ }
+
+ public TestRunnerEventBroadcaster getEventBroadcaster()
+ {
+ return eventBroadcaster;
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -24,9 +24,10 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestRunner;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestRunnerContext;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import java.util.Collection;
@@ -44,30 +45,21 @@
/** . */
private final Collection<TestRunner> runners;
- /** . */
- private final TestRunnerLifeCycleFilter lifeCycleFilter;
-
public CompositeTestRunner(Collection<TestRunner> runners)
{
this.runners = runners;
- this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
protected void internalRun(TestRunnerContext context)
{
+ // Setup intermediate event filtering
+ TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ TestRunnerContextSupport nestedContext = new TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+
for (TestRunner runner : runners)
{
- try
- {
- runner.addListener(lifeCycleFilter);
-
- //
- runner.run(context);
- }
- finally
- {
- runner.removeListener(lifeCycleFilter);
- }
+ runner.run(nestedContext);
}
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -103,7 +103,7 @@
{
if (testId == null)
{
- fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("No test id specified")));
+ context.getEventBroadcaster().fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("No test id specified")));
}
else
{
@@ -114,7 +114,7 @@
}
catch (Exception e)
{
- fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Was not able to start the test driver properly", e)));
+ context.getEventBroadcaster().fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Was not able to start the test driver properly", e)));
return;
}
@@ -163,7 +163,7 @@
TestCaseInfo testCaseInfo = (TestCaseInfo)testInfo;
for (Map<String,String> parametrization : parametrizationSet.enumerate(testCaseInfo.getParameters().keySet()))
{
- fireEvent(new StartTestEvent(testId, testCaseInfo));
+ context.getEventBroadcaster().fireEvent(new StartTestEvent(testId, testCaseInfo));
//
StartTestCommand command = new StartTestCommand(parametrization);
@@ -200,7 +200,7 @@
}
//
- fireEvent(new EndTestEvent(testId, result));
+ context.getEventBroadcaster().fireEvent(new EndTestEvent(testId, result));
}
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -54,7 +54,7 @@
{
for (TestRunnerEvent event : events)
{
- fireEvent(event);
+ context.getEventBroadcaster().fireEvent(event);
}
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -27,7 +27,9 @@
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.model.generic.GenericTestSuiteDef;
import org.jboss.unit.runner.model.generic.TestDef;
import org.jboss.unit.driver.TestDriver;
@@ -47,19 +49,20 @@
/** . */
private final GenericTestSuiteDef def;
- /** . */
- private final TestRunnerLifeCycleFilter lifeCycleFilter;
-
public GenericTestRunner(GenericTestSuiteDef def)
{
this.def = def;
- this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
protected void internalRun(TestRunnerContext context)
{
String className = def.getClassName();
+ // Setup intermediate event filtering
+ TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ TestRunnerContextSupport nestedContext = new TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+
//
try
{
@@ -83,13 +86,14 @@
//
TestDriverRunner runner = new TestDriverRunner(driver, parametrizations, testDef.getRefId());
- runner.addListener(lifeCycleFilter);
- runner.run(context);
+
+ //
+ runner.run(nestedContext);
}
}
catch (Exception e)
{
- fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " + className,e)));
+ nestedContext.getEventBroadcaster().fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " + className,e)));
}
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -26,8 +26,10 @@
import org.jboss.unit.runner.ParametrizationSet;
import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.model.pojo.POJOTestSuiteDef;
import org.jboss.unit.runner.model.pojo.TestClassDef;
import org.jboss.unit.runner.model.pojo.TestCaseDef;
@@ -50,17 +52,19 @@
/** . */
private final POJOTestSuiteDef suite;
- /** . */
- private final TestRunnerLifeCycleFilter lifeCycleFilter;
-
public POJOTestRunner(POJOTestSuiteDef suiteDef)
{
this.suite = suiteDef;
- this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
protected void internalRun(TestRunnerContext context)
{
+ // Setup intermediate event filtering
+ TestRunnerEventBroadcasterSupport tmp = new TestRunnerEventBroadcasterSupport();
+ tmp.addListener(new TestRunnerLifeCycleFilter(context.getEventBroadcaster()));
+ TestRunnerContextSupport nestedContext = new TestRunnerContextSupport(context.getProperties(), context.getFilter(), tmp);
+
+ //
for (TestClassDef testClass : suite.getTestClasses())
{
String className = testClass.getName();
@@ -97,13 +101,12 @@
{
TestId testCaseId = new TestId(testCaseName);
runner.setTestId(testCaseId);
- runner.addListener(lifeCycleFilter);
- runner.run(context);
+ runner.run(nestedContext);
}
}
catch (Exception e)
{
- fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " + className,e)));
+ nestedContext.getEventBroadcaster().fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Cannot execute test class " + className,e)));
}
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -22,8 +22,9 @@
package org.jboss.unit.tooling;
-import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunner;
+import org.jboss.unit.runner.impl.TestRunnerContextSupport;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.model.TestSuiteDef;
import org.jboss.unit.tooling.filter.MainTestFilter;
@@ -42,14 +43,14 @@
private final MainTestFilter mainFilter;
- private final Set<TestRunnerEventListener> listeners;
-
private final TestRunner runner;
private final TestSuiteDef suiteDef;
private final Map<String,String> properties;
+ private final TestRunnerEventBroadcasterSupport broadcaster;
+
// public static final String JBOSS_UNIT_NAMES = "jboss.unit.names";
//
// public static final String JBOSS_UNIT_KEYWORDS = "jboss.unit.keywords";
@@ -121,17 +122,8 @@
options_no_arg = Collections.unmodifiableSet(opts);
}
- private Main()
+ public Main(TestRunner runner, MainTestFilter mainFilter, TestRunnerEventBroadcasterSupport broadcaster, TestSuiteDef suiteDef, Map<String,String> properties)
{
- mainFilter = null;
- listeners = null;
- runner = null;
- suiteDef = null;
- properties = null;
- }
-
- public Main(TestRunner runner, MainTestFilter mainFilter, Set<TestRunnerEventListener> listeners, TestSuiteDef suiteDef, Map<String,String> properties)
- {
if (runner == null)
{
throw new IllegalArgumentException("runner cannot be null");
@@ -142,9 +134,9 @@
throw new IllegalArgumentException("mainFilter cannot be null");
}
- if (listeners == null)
+ if (broadcaster == null)
{
- throw new IllegalArgumentException("listeners cannot be null");
+ throw new IllegalArgumentException("broadcaster cannot be null");
}
if (suiteDef == null)
@@ -158,15 +150,15 @@
}
this.mainFilter = mainFilter;
- this.listeners = listeners;
this.runner = runner;
this.suiteDef = suiteDef;
this.properties = properties;
+ this.broadcaster = broadcaster;
}
public void execute()
{
- MainTestRunnerContext runnerContext = new MainTestRunnerContext(properties, mainFilter);
+ TestRunnerContextSupport runnerContext = new TestRunnerContextSupport(properties, mainFilter, broadcaster);
runner.run(runnerContext);
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -24,6 +24,7 @@
import org.jboss.unit.runner.TestRunnerEventListener;
import org.jboss.unit.runner.TestRunner;
+import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.filter.NullFilter;
import org.jboss.unit.runner.model.ModelBuilder;
import org.jboss.unit.runner.model.TestSuiteDef;
@@ -340,12 +341,13 @@
ModelBuilder builder = new ModelBuilder(source);
TestSuiteDef suite = builder.build();
TestRunner runner = suite.createRunner();
+ TestRunnerEventBroadcasterSupport broadcaster = new TestRunnerEventBroadcasterSupport();
// Add listeners
for (TestRunnerEventListener listener : listeners)
{
- runner.addListener(listener);
+ broadcaster.addListener(listener);
}
//add PrintListener by default
@@ -371,7 +373,7 @@
reporter.setXmlReporter(xmlReporter);
}
- runner.addListener(reporter);
+ broadcaster.addListener(reporter);
@@ -397,7 +399,7 @@
}
- return new Main(runner, filter, listeners, suite, properties);
+ return new Main(runner, filter, broadcaster, suite, properties);
}
public static void checkCreateOutputDirectory(String dir) throws Exception
Deleted: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java 2007-10-12 13:23:21 UTC (rev 8614)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java 2007-10-12 14:05:39 UTC (rev 8615)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.unit.tooling;
-
-import org.jboss.unit.runner.TestRunnerContext;
-import org.jboss.unit.runner.TestFilter;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class MainTestRunnerContext implements TestRunnerContext
-{
-
- /** . */
- private Map<String,String> properties;
-
- /** . */
- private TestFilter filter;
-
- public MainTestRunnerContext(Map<String, String> properties, TestFilter filter)
- {
- this.properties = properties;
- this.filter = filter;
- }
-
- public Map<String, String> getProperties()
- {
- return properties;
- }
-
- public TestFilter getFilter()
- {
- return filter;
- }
-}
16 years, 8 months
JBoss Portal SVN: r8614 - modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-10-12 09:23:21 -0400 (Fri, 12 Oct 2007)
New Revision: 8614
Removed:
modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java
Modified:
modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java
modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java
Log:
Fix the bridge (Would need more testing)
Deleted: modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java
===================================================================
--- modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java 2007-10-12 13:04:19 UTC (rev 8613)
+++ modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java 2007-10-12 13:23:21 UTC (rev 8614)
@@ -1,329 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.bridge;
-
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-
-import javax.portlet.PortletRequest;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6862 $
- */
-public class BridgeRequest implements HttpServletRequest
-{
-
- protected final PortletRequest preq;
- protected final HttpServletRequest hreq;
-
- public BridgeRequest(JBossServletContextProvider.BridgeInfo info)
- {
- PortletInvocation invocation = info.getInvocation();
- this.hreq = invocation.getDispatchedRequest();
- this.preq = (PortletRequest)hreq.getAttribute("javax.portlet.request");
- }
-
- public String getProtocol()
- {
- return null;
- }
-
- public String getRemoteAddr()
- {
- return null;
- }
-
- public String getRemoteHost()
- {
- return null;
- }
-
- public String getRealPath(String s)
- {
- return null;
- }
-
- public StringBuffer getRequestURL()
- {
- return null;
- }
-
- public String getPathInfo()
- {
- return hreq.getPathInfo();
- }
-
- public String getQueryString()
- {
- return hreq.getQueryString();
- }
-
- public String getServletPath()
- {
- return hreq.getServletPath();
- }
-
- public String getRequestURI()
- {
- return hreq.getRequestURI();
- }
-
- public String getPathTranslated()
- {
- return hreq.getPathTranslated();
- }
-
- public String getScheme()
- {
- return preq.getScheme();
- }
-
- public String getServerName()
- {
- return preq.getServerName();
- }
-
- public int getServerPort()
- {
- return preq.getServerPort();
- }
-
- public Object getAttribute(String name)
- {
- return preq.getAttribute(name);
- }
-
- public Enumeration getAttributeNames()
- {
- return preq.getAttributeNames();
- }
-
- public void setAttribute(String name, Object value)
- {
- preq.setAttribute(name, value);
- }
-
- public void removeAttribute(String name)
- {
- preq.removeAttribute(name);
- }
-
- public Locale getLocale()
- {
- return preq.getLocale();
- }
-
- public Enumeration getLocales()
- {
- return preq.getLocales();
- }
-
- public boolean isSecure()
- {
- return preq.isSecure();
- }
-
- public String getAuthType()
- {
- return preq.getAuthType();
- }
-
- public String getContextPath()
- {
- return preq.getContextPath();
- }
-
- public String getRemoteUser()
- {
- return preq.getRemoteUser();
- }
-
- public Principal getUserPrincipal()
- {
- return preq.getUserPrincipal();
- }
-
- public String getRequestedSessionId()
- {
- return preq.getRequestedSessionId();
- }
-
- public boolean isRequestedSessionIdValid()
- {
- return preq.isRequestedSessionIdValid();
- }
-
- public String getParameter(String s)
- {
- return preq.getParameter(s);
- }
-
- public Enumeration getParameterNames()
- {
- return preq.getParameterNames();
- }
-
- public String[] getParameterValues(String s)
- {
- return preq.getParameterValues(s);
- }
-
- public Map getParameterMap()
- {
- return preq.getParameterMap();
- }
-
- public String getCharacterEncoding()
- {
- return null;
- }
-
- public void setCharacterEncoding(String s) throws UnsupportedEncodingException
- {
- }
-
- public int getContentLength()
- {
- return 0;
- }
-
- public String getContentType()
- {
- return null;
- }
-
- public ServletInputStream getInputStream() throws IOException
- {
- return null;
- }
-
- public BufferedReader getReader() throws IOException
- {
- return null;
- }
-
- // Must be based on properties provided by the getProperties method of the PortletRequest interface
-
- public String getHeader(String name)
- {
- return null;
- }
-
- public Enumeration getHeaders(String names)
- {
- return null;
- }
-
- public Enumeration getHeaderNames()
- {
- return null;
- }
-
- public Cookie[] getCookies()
- {
- return new Cookie[0];
- }
-
- public long getDateHeader(String s)
- {
- return 0;
- }
-
- public int getIntHeader(String s)
- {
- return 0;
- }
-
- public String getMethod()
- {
- return "GET";
- }
-
- public RequestDispatcher getRequestDispatcher(String s)
- {
- return hreq.getRequestDispatcher(s);
- }
-
- public boolean isUserInRole(String roleName)
- {
- return preq.isUserInRole(roleName);
- }
-
- public HttpSession getSession(boolean create)
- {
- return hreq.getSession(create);
- }
-
- public HttpSession getSession()
- {
- return hreq.getSession();
- }
-
- public boolean isRequestedSessionIdFromCookie()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromURL()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromUrl()
- {
- return false;
- }
-
- public int getRemotePort()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public String getLocalName()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public String getLocalAddr()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public int getLocalPort()
- {
- throw new UnsupportedOperationException("NYI");
- }
-}
Modified: modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java
===================================================================
--- modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java 2007-10-12 13:04:19 UTC (rev 8613)
+++ modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java 2007-10-12 13:23:21 UTC (rev 8614)
@@ -22,24 +22,25 @@
******************************************************************************/
package org.jboss.portal.portlet.bridge;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
import javax.portlet.PortletResponse;
import javax.portlet.RenderResponse;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
+import javax.servlet.http.HttpServletResponseWrapper;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6862 $
*/
-public class BridgeResponse implements HttpServletResponse
+public class BridgeResponse extends HttpServletResponseWrapper
{
/** . */
@@ -53,6 +54,7 @@
public BridgeResponse(JBossServletContextProvider.BridgeInfo info)
{
+ super(info.getInvocation().getDispatchedResponse());
invocation = info.getInvocation();
HttpServletRequest hreq = invocation.getDispatchedRequest();
this.presp = (PortletResponse)hreq.getAttribute("javax.portlet.response");
Modified: modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java
===================================================================
--- modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java 2007-10-12 13:04:19 UTC (rev 8613)
+++ modules/portlet/trunk/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java 2007-10-12 13:23:21 UTC (rev 8614)
@@ -22,11 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.bridge;
-import org.apache.portals.bridges.common.ServletContextProvider;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.container.PortletContainer;
-
import javax.portlet.GenericPortlet;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
@@ -34,6 +29,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.portals.bridges.common.ServletContextProvider;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
/**
* The JBoss implementation of <code>org.apache.portals.bridges.common.ServletContextProvider</code> use thread local
* variables to keep the request associated with the current thread of execution.
@@ -102,7 +102,7 @@
/** Lazy initialisation of the bridge info. */
private void init(BridgeInfo bridgeInfo)
{
- bridgeInfo.breq = new BridgeRequest(bridgeInfo);
+ bridgeInfo.breq = bridgeInfo.getInvocation().getDispatchedRequest();
bridgeInfo.bresp = new BridgeResponse(bridgeInfo);
}
@@ -115,10 +115,10 @@
private final ServletContext ctx;
/** The bridge response. */
- private BridgeRequest breq;
+ private HttpServletRequest breq;
/** The bridge response. */
- private BridgeResponse bresp;
+ private HttpServletResponse bresp;
public BridgeInfo(PortletInvocation invocation)
{
16 years, 8 months
JBoss Portal SVN: r8613 - in modules/test/trunk: remote/src/main/org/jboss/unit/remote/driver and 17 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-12 09:04:19 -0400 (Fri, 12 Oct 2007)
New Revision: 8613
Added:
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/PropertyType.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/SimpleDriverContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java
Modified:
modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverResponse.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/POJOTestSuiteDriver.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
Log:
start to add property support + introduced TestRunnerContext + introduced TestDriver life cycle and contextualization
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/ResponseContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -31,7 +31,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class ResponseContext
+public class ResponseContext implements Serializable
{
/** The test response. */
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -25,12 +25,12 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.DriverContext;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.TestSuiteInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
-import org.jboss.unit.info.impl.SimpleParameterInfo;
import org.jboss.unit.TestId;
import org.jboss.unit.Failure;
import org.jboss.portal.test.framework.server.NodeId;
@@ -45,8 +45,6 @@
import org.jboss.beans.metadata.plugins.annotations.Inject;
import java.net.URL;
-import java.util.Map;
-import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -63,6 +61,9 @@
// Services
/** . */
+ private DriverContext context;
+
+ /** . */
private NodeManager nodeManager;
/** . */
@@ -86,11 +87,6 @@
return archivePath;
}
- public void setArchivePath(String archivePath)
- {
- this.archivePath = archivePath;
- }
-
public NodeManager getNodeManager()
{
return nodeManager;
@@ -118,62 +114,71 @@
return (RemoteTestDriver)node.lookupService(RemoteTestDriver.SERVICE_ID);
}
- private boolean started = false;
private FailureResponse failed;
private KernelDeployment deployment;
private BeanXMLDeployer beanDeployer;
- private void start()
+ public void initDriver(DriverContext context)
{
- if (!started && failed == null)
- {
+ this.context = context;
- //
- run();
+ // Get this property
+ this.archivePath = context.getProperty("archivePath");
- // Install our self first
- try
- {
- AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestDriver", getClass().getName());
- AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
- bmd.setConstructor(cmd);
- TestCaseFactory factory = new TestCaseFactory(this);
- AbstractValueMetaData vmd = new AbstractValueMetaData(factory);
- cmd.setFactory(vmd);
- cmd.setFactoryMethod("getTestCase");
- getKernel().getController().install(bmd);
- }
- catch (Throwable throwable)
- {
- throwable.printStackTrace();
- failed = new FailureResponse(Failure.createErrorFailure("Could not startup kernel", throwable));
- return;
- }
+ //
+ run();
- // Now deploy beans
- try
- {
- URL url = getClass().getResource("/org/jboss/unit/remote/driver/jboss-beans.xml");
- beanDeployer = new BeanXMLDeployer(getKernel());
- deployment = beanDeployer.deploy(url);
- beanDeployer.validate();
- }
- catch (Throwable throwable)
- {
- throwable.printStackTrace();
- failed = new FailureResponse(Failure.createErrorFailure("Could not deploy beans", throwable));
- return;
- }
+ // Install our self first
+ try
+ {
+ AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestDriver", getClass().getName());
+ AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
+ bmd.setConstructor(cmd);
+ TestCaseFactory factory = new TestCaseFactory(this);
+ AbstractValueMetaData vmd = new AbstractValueMetaData(factory);
+ cmd.setFactory(vmd);
+ cmd.setFactoryMethod("getTestCase");
+ getKernel().getController().install(bmd);
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ failed = new FailureResponse(Failure.createErrorFailure("Could not startup kernel", throwable));
+ return;
+ }
- //
- started = true;
+ // Now deploy beans
+ try
+ {
+ URL url = getClass().getResource("/org/jboss/unit/remote/driver/jboss-beans.xml");
+ beanDeployer = new BeanXMLDeployer(getKernel());
+ deployment = beanDeployer.deploy(url);
+ beanDeployer.validate();
}
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ failed = new FailureResponse(Failure.createErrorFailure("Could not deploy beans", throwable));
+ }
}
- public TestInfo getInfo()
+ public void destroyDriver()
{
- start();
+ try
+ {
+ beanDeployer.undeploy(deployment);
+ }
+ catch (Throwable ignore)
+ {
+ ignore.printStackTrace();
+ }
+ //
+ this.context = null;
+ }
+
+ public TestInfo getInfo()
+ {
// Always retrieve meta data from the default node
Node node = nodeManager.getNode(NodeId.DEFAULT);
@@ -181,33 +186,13 @@
TestDriver server = getServer(node);
//
- SimpleTestSuiteInfo testInfo = new SimpleTestSuiteInfo((TestSuiteInfo)server.getInfo());
-
- System.out.println("testInfo = " + testInfo);
-
- //
- Map<String, SimpleParameterInfo> parameters = new HashMap<String, SimpleParameterInfo>(testInfo.getParameters());
-
- //
- parameters.put("archivePath", new SimpleParameterInfo("archivePath"));
-
- //
- testInfo.setParameters(parameters);
-
- //
- return testInfo;
+ return new SimpleTestSuiteInfo((TestSuiteInfo)server.getInfo());
}
public DriverResponse invoke(TestId testId, DriverCommand command)
{
- start();
-
- //
if (command instanceof StartTestCommand)
{
- StartTestCommand start = (StartTestCommand)command;
- archivePath = start.getParametrization().get("archivePath");
-
try
{
Node node = nodeManager.getNode(NodeId.DEFAULT);
@@ -222,17 +207,6 @@
{
return new FailureResponse(Failure.createErrorFailure(e));
}
- finally
- {
- try
- {
- beanDeployer.undeploy(deployment);
- }
- catch (Throwable ignore)
- {
- ignore.printStackTrace();
- }
- }
}
else
{
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -27,6 +27,7 @@
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.TestDriver;
+import org.jboss.unit.driver.AbstractTestDriver;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.info.TestInfo;
import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
@@ -40,7 +41,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5636 $
*/
-public class RemoteTestDriverServer implements RemoteTestDriver
+public class RemoteTestDriverServer extends AbstractTestDriver implements RemoteTestDriver
{
/** . */
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -119,11 +119,24 @@
return new RemoteDriverCommandContext(responseContext.getCommandContext());
}
+ //
+ if (nextHandler != null)
+ {
+ return nextHandler.handleResponse(testConversation, responseContext);
+ }
+
+ //
return null;
}
public RemoteDriverResponseContext handleCommand(TestConversation conversation, RemoteDriverCommandContext commandContext) throws Exception
{
- return nextHandler.handleCommand(conversation, commandContext);
+ if (nextHandler != null)
+ {
+ return nextHandler.handleCommand(conversation, commandContext);
+ }
+
+ //
+ return null;
}
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -24,12 +24,10 @@
import org.jboss.unit.driver.DriverResponse;
-import java.io.Serializable;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class DeployerResponse extends DriverResponse implements Serializable
+public class DeployerResponse extends DriverResponse
{
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/HTTPConversation.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -189,8 +189,16 @@
private RemoteDriverResponseContext decodeHTTPResponse(RemoteDriverCommandContext commandContext, HttpMethod httpMethod) throws Exception
{
+ DriverResponse response = null;
+
+ //
ResponseContext ctx = conversation.popContext();
- DriverResponse response = ctx.getResponse();
+ if (ctx != null)
+ {
+ response = ctx.getResponse();
+ }
+
+ //
int status = httpMethod.getStatusCode();
switch (status)
{
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -24,12 +24,10 @@
import org.jboss.unit.driver.DriverCommand;
-import java.io.Serializable;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class HTTPDriverCommand extends DriverCommand implements Serializable
+public class HTTPDriverCommand extends DriverCommand
{
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -24,12 +24,10 @@
import org.jboss.unit.driver.DriverResponse;
-import java.io.Serializable;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class HTTPDriverResponse extends DriverResponse implements Serializable
+public abstract class HTTPDriverResponse extends DriverResponse
{
}
Added: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/PropertyType.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/PropertyType.java (rev 0)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/PropertyType.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.tooling.ant;
+
+/**
+ * A property.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyType
+{
+
+ /** . */
+ private String name;
+
+ /** . */
+ private String value;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+}
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -35,6 +35,7 @@
import java.util.List;
import java.util.LinkedList;
import java.util.Set;
+import java.util.ArrayList;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -46,9 +47,9 @@
private boolean fork = true;
- private List<IncludeType> includes = new LinkedList();
+ private List<IncludeType> includes = new LinkedList<IncludeType>();
- private List<ExcludeType> excludes = new LinkedList();
+ private List<ExcludeType> excludes = new LinkedList<ExcludeType>();
private ReportsType reports;
@@ -60,7 +61,9 @@
private boolean jpda;
+ private List<PropertyType> properties = new ArrayList<PropertyType>();
+
public TestsType()
{
}
@@ -256,6 +259,11 @@
{
javaTask.createArg().setValue(generateArgument(excludeFilter.getKeywords(), Main.OPT_EX_KEYWORDS));
}
+
+ for (PropertyType property : properties)
+ {
+ javaTask.createArg().setValue(Main.OPT_PROPERTY + "=" + property.getName() + "=" + property.getValue());
+ }
}
private String generateArgument(Set<String> values, String argumentName)
@@ -289,6 +297,11 @@
this.reports = reports;
}
+ public void addConfiguredProperty(PropertyType property)
+ {
+ this.properties.add(property);
+ }
+
public void addTask(Task task)
{
//To change body of implemented methods use File | Settings | File Templates.
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/CompositeTestRunnerTests.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -27,6 +27,7 @@
import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestRunnerEventListener;
+import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.composite.CompositeTestRunner;
import static org.jboss.unit.api.Assert.*;
@@ -181,7 +182,7 @@
boolean invoked;
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
invoked = true;
fireEvent(event);
@@ -194,7 +195,7 @@
/** . */
final RuntimeException exception = new RuntimeException();
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
throw exception;
}
@@ -206,7 +207,7 @@
/** . */
final Error error = new Error();
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
throw error;
}
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/GenericTestRunnerTests.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -28,6 +28,7 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.AbstractTestDriver;
import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.info.TestInfo;
@@ -105,7 +106,7 @@
assertEquals(list(new HashMap(), new HashMap()), Driver1.parametrizations);
}
- public static class Driver1 implements TestDriver
+ public static class Driver1 extends AbstractTestDriver
{
static SimpleTestSuiteInfo testSuiteInfo;
Modified: modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/test/unit/runner/TestDriverRunnerTests.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -36,6 +36,7 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.AbstractTestDriver;
import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.driver.response.FailureResponse;
@@ -376,7 +377,7 @@
assertStartTestEvent(listener.events.get(1), new TestId("Foo"));
}
- private static class TestDriverImpl implements TestDriver
+ private static class TestDriverImpl extends AbstractTestDriver
{
List<TestId> ids = new ArrayList<TestId>();
Added: modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/AbstractTestDriver.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.driver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AbstractTestDriver implements TestDriver
+{
+
+ /** . */
+ private DriverContext context;
+
+ public void initDriver(DriverContext context)
+ {
+ this.context = context;
+
+ //
+ doInit();
+ }
+
+ protected void doInit()
+ {
+ }
+
+ protected void doDestroy()
+ {
+ }
+
+ protected DriverContext getContext()
+ {
+ return context;
+ }
+
+ public void destroyDriver()
+ {
+ try
+ {
+ doDestroy();
+ }
+ finally
+ {
+ this.context = null;
+ }
+ }
+}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.driver;
+
+/**
+ * The context in which a driver is placed.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface DriverContext
+{
+
+ /**
+ * Return a property of the context.
+ *
+ * @param name
+ * @return
+ */
+ String getProperty(String name);
+
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverResponse.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverResponse.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/DriverResponse.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -22,10 +22,12 @@
******************************************************************************/
package org.jboss.unit.driver;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class DriverResponse
+public abstract class DriverResponse implements Serializable
{
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/TestDriver.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -35,6 +35,18 @@
{
/**
+ * Initialize the test driver.
+ *
+ * @param context the driver context
+ */
+ void initDriver(DriverContext context);
+
+ /**
+ * Destroy the test driver.
+ */
+ void destroyDriver();
+
+ /**
* Return a runtime meta data about this test driver.
*
* @return the description
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/POJOTestSuiteDriver.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/POJOTestSuiteDriver.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/POJOTestSuiteDriver.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -31,6 +31,7 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.AbstractTestDriver;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.driver.command.StartTestCommand;
@@ -49,7 +50,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class POJOTestSuiteDriver implements TestDriver
+public class POJOTestSuiteDriver extends AbstractTestDriver
{
/** . */
Added: modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/SimpleDriverContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/SimpleDriverContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/driver/impl/pojo/SimpleDriverContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.driver.impl.pojo;
+
+import org.jboss.unit.driver.DriverContext;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class SimpleDriverContext implements DriverContext
+{
+
+ /** . */
+ private final Map<String,String> properties;
+
+ public SimpleDriverContext(Map<String, String> properties)
+ {
+ if (properties == null)
+ {
+ throw new IllegalArgumentException("No null property name accepted");
+ }
+ this.properties = properties;
+ }
+
+ public SimpleDriverContext()
+ {
+ this(new HashMap<String, String>());
+ }
+
+ public String getProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("No null property name accepted");
+ }
+ return properties.get(name);
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/AbstractTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.unit.runner;
-import org.jboss.unit.runner.filter.NullFilter;
import org.jboss.unit.runner.event.TestRunnerEventBroadcasterSupport;
import org.jboss.unit.runner.event.EndRunnerEvent;
import org.jboss.unit.runner.event.StartRunnerEvent;
@@ -64,15 +63,15 @@
public final void run()
{
- run(NullFilter.getInstance());
+ run(NullTestRunnerContext.getInstance());
}
- public final void run(TestFilter filter)
+ public final void run(TestRunnerContext context)
{
fireEvent(new StartRunnerEvent());
- internalRun(filter);
+ internalRun(context);
fireEvent(new EndRunnerEvent());
}
- protected abstract void internalRun(TestFilter filter);
+ protected abstract void internalRun(TestRunnerContext context);
}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/NullTestRunnerContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner;
+
+import org.jboss.unit.runner.filter.NullFilter;
+
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NullTestRunnerContext implements TestRunnerContext
+{
+
+ /** . */
+ private static final NullTestRunnerContext instance = new NullTestRunnerContext();
+
+ public static NullTestRunnerContext getInstance()
+ {
+ return instance;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
+
+ public TestFilter getFilter()
+ {
+ return NullFilter.getInstance();
+ }
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -37,6 +37,6 @@
void run();
- void run(TestFilter filter);
+ void run(TestRunnerContext context);
}
Added: modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/TestRunnerContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.runner;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface TestRunnerContext
+{
+
+ Map<String,String> getProperties();
+
+ TestFilter getFilter();
+
+}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/composite/CompositeTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -25,6 +25,7 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestRunner;
import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
import java.util.Collection;
@@ -52,7 +53,7 @@
this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
for (TestRunner runner : runners)
{
@@ -61,7 +62,7 @@
runner.addListener(lifeCycleFilter);
//
- runner.run(filter);
+ runner.run(context);
}
finally
{
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/driver/TestDriverRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -24,6 +24,7 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.impl.pojo.SimpleDriverContext;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.driver.response.FailureResponse;
import org.jboss.unit.driver.command.StartTestCommand;
@@ -39,12 +40,11 @@
import org.jboss.unit.runner.event.EndTestEvent;
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.AbstractTestRunner;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.TestResult;
import org.jboss.unit.runner.ParametrizationSet;
+import org.jboss.unit.runner.TestRunnerContext;
import java.util.Map;
-import java.util.HashMap;
/**
* An implementation that uses a test driver and transform test driver
@@ -70,7 +70,7 @@
private final ParametrizationSet parametrizationSet;
/** . */
- private final TestId testId;
+ private TestId testId;
public TestDriverRunner(TestDriver driver, ParametrizationSet parametrizationSet, TestId testId)
{
@@ -79,25 +79,73 @@
this.testId = testId;
}
+ public TestDriverRunner(TestDriver driver,ParametrizationSet parametrizationSet)
+ {
+ this(driver, parametrizationSet, null);
+ }
+
public TestDriverRunner(TestDriver driver, TestId testId)
{
this(driver, new ParametrizationSet(), testId);
}
- protected void internalRun(TestFilter filter)
+ public TestId getTestId()
{
- TestSuiteInfo info = (TestSuiteInfo)driver.getInfo();
+ return testId;
+ }
- //
- TestInfo testInfo = info.findTest(testId);
+ public void setTestId(TestId testId)
+ {
+ this.testId = testId;
+ }
- //
- internalRun(filter, testInfo, testId);
+ protected void internalRun(TestRunnerContext context)
+ {
+ if (testId == null)
+ {
+ fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("No test id specified")));
+ }
+ else
+ {
+ // Init the test driver
+ try
+ {
+ driver.initDriver(new SimpleDriverContext(context.getProperties()));
+ }
+ catch (Exception e)
+ {
+ fireEvent(new RunnerFailureEvent(Failure.createErrorFailure("Was not able to start the test driver properly", e)));
+ return;
+ }
+
+ //
+ try
+ {
+ TestSuiteInfo info = (TestSuiteInfo)driver.getInfo();
+
+ //
+ TestInfo testInfo = info.findTest(testId);
+
+ //
+ internalRun(context, testInfo, testId);
+ }
+ finally
+ {
+ // Perform cleanup of life cycle
+ try
+ {
+ driver.destroyDriver();
+ }
+ catch (Throwable ignore)
+ {
+ }
+ }
+ }
}
- private void internalRun(TestFilter filter, TestInfo testInfo, TestId testId)
+ private void internalRun(TestRunnerContext context, TestInfo testInfo, TestId testId)
{
- if (filter.include(testId, testInfo))
+ if (context.getFilter().include(testId, testInfo))
{
if (testInfo instanceof TestSuiteInfo)
{
@@ -107,7 +155,7 @@
for (String name : testSuiteInfo.getNames())
{
TestInfo childTestInfo = testSuiteInfo.getTest(name);
- internalRun(filter, childTestInfo, new TestId(testId, name));
+ internalRun(context, childTestInfo, new TestId(testId, name));
}
}
else
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/event/EventDrivenTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -25,6 +25,7 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestRunnerEvent;
import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerContext;
import java.util.Collection;
import java.util.Arrays;
@@ -49,7 +50,7 @@
this.events = events;
}
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
for (TestRunnerEvent event : events)
{
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/failure/FailureTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -25,6 +25,7 @@
import org.jboss.unit.runner.AbstractTestRunner;
import org.jboss.unit.runner.TestResult;
import org.jboss.unit.runner.TestFilter;
+import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.TestId;
import org.jboss.unit.info.TestInfo;
@@ -49,9 +50,9 @@
this.testInfo = new FailureTestCaseInfo(name);
}
- public void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
- if (filter.include(testId, null, testInfo))
+ if (context.getFilter().include(testId, null, testInfo))
{
// failures.add(new StartTestEvent(tmp, new ));
// failures.add(new EndTestEvent(blah, new TestError(e, 0)));
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/generic/GenericTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -23,8 +23,8 @@
package org.jboss.unit.runner.impl.generic;
import org.jboss.unit.runner.AbstractTestRunner;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.ParametrizationSet;
+import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
@@ -56,7 +56,7 @@
this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
String className = def.getClassName();
@@ -84,7 +84,7 @@
//
TestDriverRunner runner = new TestDriverRunner(driver, parametrizations, testDef.getRefId());
runner.addListener(lifeCycleFilter);
- runner.run(filter);
+ runner.run(context);
}
}
catch (Exception e)
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/runner/impl/pojo/POJOTestRunner.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -23,8 +23,8 @@
package org.jboss.unit.runner.impl.pojo;
import org.jboss.unit.runner.AbstractTestRunner;
-import org.jboss.unit.runner.TestFilter;
import org.jboss.unit.runner.ParametrizationSet;
+import org.jboss.unit.runner.TestRunnerContext;
import org.jboss.unit.runner.impl.driver.TestDriverRunner;
import org.jboss.unit.runner.event.RunnerFailureEvent;
import org.jboss.unit.runner.event.TestRunnerLifeCycleFilter;
@@ -59,7 +59,7 @@
this.lifeCycleFilter = new TestRunnerLifeCycleFilter(broadcaster);
}
- protected void internalRun(TestFilter filter)
+ protected void internalRun(TestRunnerContext context)
{
for (TestClassDef testClass : suite.getTestClasses())
{
@@ -90,12 +90,15 @@
parametrizations.merge(testClass.getParameters().getParametrization());
//
+ TestDriverRunner runner = new TestDriverRunner(driver, parametrizations);
+
+ //
for (String testCaseName : testCaseNames)
{
TestId testCaseId = new TestId(testCaseName);
- TestDriverRunner runner = new TestDriverRunner(driver, parametrizations, testCaseId);
+ runner.setTestId(testCaseId);
runner.addListener(lifeCycleFilter);
- runner.run(filter);
+ runner.run(context);
}
}
catch (Exception e)
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/Main.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -48,6 +48,8 @@
private final TestSuiteDef suiteDef;
+ private final Map<String,String> properties;
+
// public static final String JBOSS_UNIT_NAMES = "jboss.unit.names";
//
// public static final String JBOSS_UNIT_KEYWORDS = "jboss.unit.keywords";
@@ -78,12 +80,19 @@
public static final String OPT_SUITE_NAME = "--suite_name";
- public static final String OPT_NO_CONSOLE = "--noconsole";
+ public static final String OPT_NO_CONSOLE = "--no_console";
public static final String OPT_XML_REPORT_DIR = "--xml_report_dir";
public static final String OPT_HTML_REPORT_DIR = "--html_report_dir";
+ /**
+ * For now usage should be like
+ *
+ * --property name=value .
+ */
+ public static final String OPT_PROPERTY = "--property";
+
public static final Set options;
public static final Set options_no_arg;
@@ -103,6 +112,7 @@
opts.add(OPT_NO_CONSOLE);
opts.add(OPT_XML_REPORT_DIR);
opts.add(OPT_HTML_REPORT_DIR);
+ opts.add(OPT_PROPERTY);
options = Collections.unmodifiableSet(opts);
@@ -117,9 +127,10 @@
listeners = null;
runner = null;
suiteDef = null;
+ properties = null;
}
- public Main(TestRunner runner, MainTestFilter mainFilter, Set<TestRunnerEventListener> listeners, TestSuiteDef suiteDef)
+ public Main(TestRunner runner, MainTestFilter mainFilter, Set<TestRunnerEventListener> listeners, TestSuiteDef suiteDef, Map<String,String> properties)
{
if (runner == null)
{
@@ -141,15 +152,22 @@
throw new IllegalArgumentException("suiteDef cannot be null");
}
+ if (properties == null)
+ {
+ throw new IllegalArgumentException("properties cannot be null");
+ }
+
this.mainFilter = mainFilter;
this.listeners = listeners;
this.runner = runner;
this.suiteDef = suiteDef;
+ this.properties = properties;
}
public void execute()
{
- runner.run(mainFilter);
+ MainTestRunnerContext runnerContext = new MainTestRunnerContext(properties, mainFilter);
+ runner.run(runnerContext);
}
public static void main(String[] args) throws Exception
@@ -237,21 +255,21 @@
if (arguments.keySet().contains(OPT_XML_REPORT_DIR))
{
- builder.setXmlReportDir(arguments.get(OPT_XML_REPORT_DIR));
+ builder.setXMLReportDir(arguments.get(OPT_XML_REPORT_DIR));
}
if (arguments.keySet().contains(OPT_HTML_REPORT_DIR))
{
- builder.setHtmlReportDir(arguments.get(OPT_HTML_REPORT_DIR));
+ builder.setHTMLReportDir(arguments.get(OPT_HTML_REPORT_DIR));
}
+ if (arguments.keySet().contains(OPT_PROPERTY))
+ {
+ builder.addUnparsedProperty(arguments.get(OPT_PROPERTY));
+ }
-
-
Main main = builder.build();
main.execute();
-
-
}
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 10:24:41 UTC (rev 8612)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainBuilder.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -36,6 +36,8 @@
import java.util.Set;
import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
import java.io.InputStream;
import java.io.FileInputStream;
import java.io.File;
@@ -47,19 +49,19 @@
public class MainBuilder
{
- private Set<String> keywords = new HashSet();
+ private Set<String> keywords = new HashSet<String>();
- private Set<String> names = new HashSet();
+ private Set<String> names = new HashSet<String>();
- private Set<String> namePatterns = new HashSet();
+ private Set<String> namePatterns = new HashSet<String>();
- private Set<String> excludeKeywords = new HashSet();
+ private Set<String> excludeKeywords = new HashSet<String>();
- private Set<String> excludeNames = new HashSet();
+ private Set<String> excludeNames = new HashSet<String>();
- private Set<String> excludeNamePatterns = new HashSet();
+ private Set<String> excludeNamePatterns = new HashSet<String>();
- private Set<TestRunnerEventListener> listeners = new HashSet();
+ private Set<TestRunnerEventListener> listeners = new HashSet<TestRunnerEventListener>();
private String suiteName;
@@ -71,7 +73,9 @@
private String htmlReportDir;
+ private Map<String,String> properties = new HashMap<String, String>();
+
private MainBuilder()
{
@@ -251,7 +255,7 @@
return this;
}
- public MainBuilder addJunitReporting(String directory)
+ public MainBuilder addJUnitReporting(String directory)
{
if (directory == null)
{
@@ -263,7 +267,44 @@
return this;
}
+ public MainBuilder addUnparsedProperty(String propertyString)
+ {
+ if (propertyString == null)
+ {
+ throw new IllegalArgumentException("No null property name accepted");
+ }
+ //
+ String[] patternValues = propertyString.split("=");
+
+ //
+ if (patternValues.length != 2)
+ {
+ throw new IllegalArgumentException("Property not accepted, it should match a=b and it is " + propertyString);
+ }
+
+ //
+ properties.put(patternValues[0], patternValues[1]);
+
+ //
+ return this;
+ }
+
+ public MainBuilder addProperty(String propertyName, String propertyValue)
+ {
+ if (propertyName == null)
+ {
+ throw new IllegalArgumentException("No null property name accepted");
+ }
+
+ //
+ properties.put(propertyName, propertyValue);
+
+ //
+ return this;
+ }
+
+
public String getSuiteName()
{
return suiteName;
@@ -279,12 +320,12 @@
this.noConsole = noConsole;
}
- public void setXmlReportDir(String xmlReportDir)
+ public void setXMLReportDir(String xmlReportDir)
{
this.xmlReportDir = xmlReportDir;
}
- public void setHtmlReportDir(String htmlReportDir)
+ public void setHTMLReportDir(String htmlReportDir)
{
this.htmlReportDir = htmlReportDir;
}
@@ -324,7 +365,7 @@
}
else
{
- xmlReporter = new JUnitReporter(xmlReportDir);
+ xmlReporter = new JUnitReporter(xmlReportDir);
}
reporter.setXmlReporter(xmlReporter);
@@ -356,7 +397,7 @@
}
- return new Main(runner, filter, listeners, suite);
+ return new Main(runner, filter, listeners, suite, properties);
}
public static void checkCreateOutputDirectory(String dir) throws Exception
Added: modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java (rev 0)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/tooling/MainTestRunnerContext.java 2007-10-12 13:04:19 UTC (rev 8613)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.tooling;
+
+import org.jboss.unit.runner.TestRunnerContext;
+import org.jboss.unit.runner.TestFilter;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MainTestRunnerContext implements TestRunnerContext
+{
+
+ /** . */
+ private Map<String,String> properties;
+
+ /** . */
+ private TestFilter filter;
+
+ public MainTestRunnerContext(Map<String, String> properties, TestFilter filter)
+ {
+ this.properties = properties;
+ this.filter = filter;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ public TestFilter getFilter()
+ {
+ return filter;
+ }
+}
16 years, 8 months
JBoss Portal SVN: r8612 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-10-12 06:24:41 -0400 (Fri, 12 Oct 2007)
New Revision: 8612
Modified:
docs/trunk/referenceGuide/en/modules/identity.xml
Log:
Useless warning, it will only evolve in the next major release, which is expected.
Modified: docs/trunk/referenceGuide/en/modules/identity.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/identity.xml 2007-10-12 00:33:50 UTC (rev 8611)
+++ docs/trunk/referenceGuide/en/modules/identity.xml 2007-10-12 10:24:41 UTC (rev 8612)
@@ -10,11 +10,6 @@
<para>This chapter addresses identity management in JBoss Portal 2.6</para>
<sect1 id="management_api">
<title>Identity management API</title>
- <para>
- <warning>
- JBoss Portal Identity API can evolve over time and is not officially supported.
- </warning>
- </para>
<para>Since JBoss Portal 2.6 there are 4 identity services and 2 identity related interfaces. The goal of
having such a fine grained API is to enable flexible implementations based on different
identity storage like relational databases or LDAP servers. The Membership service takes care of managing the relationship
16 years, 8 months
JBoss Portal SVN: r8611 - in docs: trunk/referenceGuide/en/modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-11 20:33:50 -0400 (Thu, 11 Oct 2007)
New Revision: 8611
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
docs/trunk/referenceGuide/en/modules/configuration.xml
docs/trunk/referenceGuide/en/modules/installation.xml
Log:
- Minor content improvements.
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2007-10-12 00:33:46 UTC (rev 8610)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/configuration.xml 2007-10-12 00:33:50 UTC (rev 8611)
@@ -28,31 +28,25 @@
port manually. Since port forwarding is not always possible, below are the instructions to change the port
number manually.
</para>
- <para>To change it, you need to edit the file
- <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal>
- and change the port value of the HTTP Connector. You can also change the value of the SSL
- port, by default it is set to 8443. Remember to uncomment the following when you have
- configured it:
- <programlisting>
- <![CDATA[
- <!-- SSL/TLS Connector configuration using the admin devl guide keystore
- <Connector port="8443" address="${jboss.bind.address}"
- maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
- emptySessionPath="true"
- scheme="https" secure="true" clientAuth="false"
- keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
- keystorePass="rmi+ssl" sslProtocol = "TLS" />
- -->
- ]]>
- </programlisting>
+ <para>To change it, you need to edit the file <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal>
+ (<literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal> on JBoss AS 4.0.x)
+ and change the port value of the HTTP Connector.
</para>
<para>
- Please refer to <xref linkend="wsrp-ports"/> to update the WSRP after having changed the port.
+ You can also change the value of the SSL port, by default it is set to 8443. To activate support for HTTPS,
+ please refer to the appropriate
+ <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">chapter</ulink> of the
+ JBoss AS guide. You might also want to refer to
+ <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>
+ for more details.
</para>
+ <para>
+ Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
+ </para>
<para>Now you can restart JBoss and use the new port that you defined. On systems like Linux,
you need privileges to be able to run a server on a port lower than 1000, starting JBoss on
- the port 80 as a regular user will not work, for testing you can log as root but is not
- recommended if the server is public as it could be a security breach in your system.
+ the port 80 as a regular user will not work. For testing purposes, you can start JBoss AS as root but this
+ setup is not recommended if the server is public as it could lead to security breaches of your system.
</para>
</sect1>
<sect1 id="configuration-contextroot">
@@ -65,9 +59,16 @@
.
</para>
<note>
- By default, Tomcat holds on to the root context '/'. You may need to either remove the
- <emphasis>$JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war</emphasis>
- or add a jboss-web.xml (declaring another context-root other than '/')under its WEB-INFO directory for the below changes to take effect on restart.
+ By default, Tomcat holds on to the root context '/'. You may need to either remove
+ <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war</literal>
+ (<literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war</literal> on JBoss AS 4.0.x)
+ or add a <literal>jboss-web.xml</literal> file (declaring another context-root other than '/') under
+ <literal>ROOT.war/WEB-INF</literal> directory for the below changes to take effect on restart.
+ <programlisting><![CDATA[
+<?xml version="1.0"?>
+<jboss-web>
+ <context-root>/tomcat-root</context-root>
+</jboss-web>]]></programlisting>
</note>
<para>You can accomplish this, with either a deployed jboss-portal.sar or before you build from source:
<itemizedlist>
@@ -134,79 +135,40 @@
<note>Under most common circumstances, the auto-detect feature should work fine.</note>
</para>
<sect2>
- <title>DB Dialect settings for the portal core</title>
- <para>Modify
- <emphasis>jboss-portal.sar/conf/hibernate/[module]/hibernate.cfg.xml</emphasis>
- . A list of supported dialects
- for Hibernate3, can be found
- <ulink
- url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat..."
- >here
- </ulink>
- .
+ <title>DB Dialect settings for Portal</title>
+ <para>You will need to modify all the <literal>hibernate.cfg.xml</literal> files in all the Portal modules you
+ intend to use by uncommenting the following line in these files and using the appropriate dialect (see
+ <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">here
+ </ulink> for a list of supported dialects in Hibernate 3):
<programlisting><![CDATA[
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
-<session-factory>
-<property name="connection.datasource">java:PortalDS</property>
-<property name="show_sql">false</property>
-<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
-<property name="cache.use_query_cache">true</property>
-
<!-- Force the dialect instead of using autodetection -->
<!--
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
--->
-
-<!-- Mapping files -->
-<mapping resource="conf/hibernate/user/domain.hbm.xml"/>
-</session-factory>
-</hibernate-configuration>
- ]]></programlisting>
+-->]]></programlisting>
</para>
+ <para>These files are found in <literal>jboss-portal.sar/[module]/conf/hibernate/[directory]/hibernate.cfg.xml</literal>
+ where <literal>[module]</literal> is a module name and <literal>[directory]</literal> is a directory that
+ may or may not be present.
+ </para>
</sect2>
<sect2>
<title>DB Dialect settings for the CMS component</title>
- <para>Modify
- <emphasis>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</emphasis>
- . A list of supported dialects
- for Hibernate3, can be found
- <ulink
- url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat..."
- >here
- </ulink>
- .
+ <para>Modify <literal>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</literal> by
+ uncommenting the following line in these files and using the appropriate dialect (see
+ <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">here
+ </ulink> for a list of supported dialects in Hibernate 3):
<programlisting><![CDATA[
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
- <property name="connection.datasource">java:@portal.datasource.name@</property>
- <property name="show_sql">@portal.sql.show@</property>
- <property name="cache.use_second_level_cache">false</property>
- <property name="cache.use_query_cache">true</property>
-
- <!-- Force the dialect instead of using autodetection -->
- <!--
- <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
- -->
-
- <!-- Mapping files -->
- <mapping resource="conf/hibernate/cms/domain.hbm.xml"/>
- </session-factory>
-</hibernate-configuration>]]></programlisting>
+<!-- Force the dialect instead of using autodetection -->
+<!--
+<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+-->]]></programlisting>
</para>
</sect2>
</sect1>
<sect1 id="emailConfiguration">
<title>Setting up the email service</title>
<para>To be able to use the email service (for example to verify user emails when someone subscribes or for CMS
- workflow notifications) it has to be configured correctly. To configure it, go to
+ workflow notifications) it has to be configured correctly. To configure it, go to
<literal>jboss-portal.sar/portal-core.sar/META-INF/jboss-service.xml</literal>.
In this file, the mail module is configured like this:
<programlisting><![CDATA[<mbean
@@ -226,9 +188,9 @@
<attribute name="SMTPTimeout">10000</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>]]></programlisting>
- Here you can specify a different SMTP server than localhost, then precise the Smtp username and Smtp passwords to
- use to send the mails.</para>
- <para>If i wanted to use GMail smtp server, i would write:
+ Here you can specify a different SMTP server than localhost, then precise the SMTP username and SMTP password to
+ use to send emails.</para>
+ <para>For example, to use GMail's SMTP server:
<programlisting><![CDATA[<mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
Modified: docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2007-10-12 00:33:46 UTC (rev 8610)
+++ docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/installation.xml 2007-10-12 00:33:50 UTC (rev 8611)
@@ -17,11 +17,11 @@
<para>If you need to install JBoss Portal on JBoss AS 4.0.x, please refer to the dedicated
<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=Portal26_AS40">wiki page</ulink>.</para>
</note>
-
+
</para>
<sect1 id="install_bundle">
<title>Installing from Bundled Download</title>
- <para>This is the easiest and fastest way to get JBoss Portal installed and running. The reason, is that the
+ <para>This is the easiest and fastest way to get JBoss Portal installed and running. The reason is that the
download bundle contains JBoss Application Server, and JBoss Portal uses the embedded Hypersonic
Database.
</para>
@@ -104,11 +104,7 @@
subscription contract with Red Hat, can have access to the EAP
version from the <ulink url="http://network.jboss.com/">support portal</ulink>.
For the other versions you can get them
- <ulink
- url="http://labs.jboss.com/portal/jbossas/download/index.html"
- >here
- </ulink>
- .
+ <ulink url="http://labs.jboss.com/portal/jbossas/download/index.html">here</ulink> .
<warning>Make sure to download the JBoss AS Zip version.
<emphasis role="bold">DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss
AS!
@@ -155,7 +151,8 @@
contains pre-configured datasource descriptors, you can use for most popular RDBMS under the
<emphasis>setup</emphasis>
directory. For more details about the datasource descriptor or if your database server is not part
- of the pre-built descriptors, please refer to: <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">the dedicated wiki page.</ulink>
+ of the pre-built descriptors, please refer to
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">the dedicated wiki page.</ulink>
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
@@ -568,4 +565,4 @@
</imageobject>
</mediaobject>
</para>
-</chapter>
+</chapter>
Modified: docs/trunk/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/configuration.xml 2007-10-12 00:33:46 UTC (rev 8610)
+++ docs/trunk/referenceGuide/en/modules/configuration.xml 2007-10-12 00:33:50 UTC (rev 8611)
@@ -28,31 +28,25 @@
port manually. Since port forwarding is not always possible, below are the instructions to change the port
number manually.
</para>
- <para>To change it, you need to edit the file
- <literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal>
- and change the port value of the HTTP Connector. You can also change the value of the SSL
- port, by default it is set to 8443. Remember to uncomment the following when you have
- configured it:
- <programlisting>
- <![CDATA[
- <!-- SSL/TLS Connector configuration using the admin devl guide keystore
- <Connector port="8443" address="${jboss.bind.address}"
- maxThreads="100" strategy="ms" maxHttpHeaderSize="8192"
- emptySessionPath="true"
- scheme="https" secure="true" clientAuth="false"
- keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
- keystorePass="rmi+ssl" sslProtocol = "TLS" />
- -->
- ]]>
- </programlisting>
+ <para>To change it, you need to edit the file <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/server.xml</literal>
+ (<literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/server.xml</literal> on JBoss AS 4.0.x)
+ and change the port value of the HTTP Connector.
</para>
<para>
- Please refer to <xref linkend="wsrp-ports"/> to update the WSRP after having changed the port.
+ You can also change the value of the SSL port, by default it is set to 8443. To activate support for HTTPS,
+ please refer to the appropriate
+ <ulink url="http://docs.jboss.org/jbossas/jboss4guide/r4/html/ch9.chapt.html#d0e21962">chapter</ulink> of the
+ JBoss AS guide. You might also want to refer to
+ <ulink url="http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html">Tomcat's SSL configuration how-to</ulink>
+ for more details.
</para>
+ <para>
+ Please refer to <xref linkend="wsrp-ports"/> to update the WSRP service after having changed the port.
+ </para>
<para>Now you can restart JBoss and use the new port that you defined. On systems like Linux,
you need privileges to be able to run a server on a port lower than 1000, starting JBoss on
- the port 80 as a regular user will not work, for testing you can log as root but is not
- recommended if the server is public as it could be a security breach in your system.
+ the port 80 as a regular user will not work. For testing purposes, you can start JBoss AS as root but this
+ setup is not recommended if the server is public as it could lead to security breaches of your system.
</para>
</sect1>
<sect1 id="configuration-contextroot">
@@ -65,9 +59,16 @@
.
</para>
<note>
- By default, Tomcat holds on to the root context '/'. You may need to either remove the
- <emphasis>$JBOSS_HOME\server\default\deploy\jbossweb-tomcat55.sar\ROOT.war</emphasis>
- or add a jboss-web.xml (declaring another context-root other than '/')under its WEB-INFO directory for the below changes to take effect on restart.
+ By default, Tomcat holds on to the root context '/'. You may need to either remove
+ <literal>$JBOSS_HOME/server/default/deploy/jboss-web.deployer/ROOT.war</literal>
+ (<literal>$JBOSS_HOME/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war</literal> on JBoss AS 4.0.x)
+ or add a <literal>jboss-web.xml</literal> file (declaring another context-root other than '/') under
+ <literal>ROOT.war/WEB-INF</literal> directory for the below changes to take effect on restart.
+ <programlisting><![CDATA[
+<?xml version="1.0"?>
+<jboss-web>
+ <context-root>/tomcat-root</context-root>
+</jboss-web>]]></programlisting>
</note>
<para>You can accomplish this, with either a deployed jboss-portal.sar or before you build from source:
<itemizedlist>
@@ -134,72 +135,33 @@
<note>Under most common circumstances, the auto-detect feature should work fine.</note>
</para>
<sect2>
- <title>DB Dialect settings for the portal core</title>
- <para>Modify
- <emphasis>jboss-portal.sar/conf/hibernate/[module]/hibernate.cfg.xml</emphasis>
- . A list of supported dialects
- for Hibernate3, can be found
- <ulink
- url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat..."
- >here
- </ulink>
- .
+ <title>DB Dialect settings for Portal</title>
+ <para>You will need to modify all the <literal>hibernate.cfg.xml</literal> files in all the Portal modules you
+ intend to use by uncommenting the following line in these files and using the appropriate dialect (see
+ <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">here
+ </ulink> for a list of supported dialects in Hibernate 3):
<programlisting><![CDATA[
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
-<session-factory>
-<property name="connection.datasource">java:PortalDS</property>
-<property name="show_sql">false</property>
-<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
-<property name="cache.use_query_cache">true</property>
-
<!-- Force the dialect instead of using autodetection -->
<!--
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
--->
-
-<!-- Mapping files -->
-<mapping resource="conf/hibernate/user/domain.hbm.xml"/>
-</session-factory>
-</hibernate-configuration>
- ]]></programlisting>
+-->]]></programlisting>
</para>
+ <para>These files are found in <literal>jboss-portal.sar/[module]/conf/hibernate/[directory]/hibernate.cfg.xml</literal>
+ where <literal>[module]</literal> is a module name and <literal>[directory]</literal> is a directory that
+ may or may not be present.
+ </para>
</sect2>
<sect2>
<title>DB Dialect settings for the CMS component</title>
- <para>Modify
- <emphasis>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</emphasis>
- . A list of supported dialects
- for Hibernate3, can be found
- <ulink
- url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat..."
- >here
- </ulink>
- .
+ <para>Modify <literal>jboss-portal.sar/portal-cms.sar/conf/hibernate/cms/hibernate.cfg.xml</literal> by
+ uncommenting the following line in these files and using the appropriate dialect (see
+ <ulink url="http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configurat...">here
+ </ulink> for a list of supported dialects in Hibernate 3):
<programlisting><![CDATA[
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
- <property name="connection.datasource">java:@portal.datasource.name@</property>
- <property name="show_sql">@portal.sql.show@</property>
- <property name="cache.use_second_level_cache">false</property>
- <property name="cache.use_query_cache">true</property>
-
- <!-- Force the dialect instead of using autodetection -->
- <!--
- <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
- -->
-
- <!-- Mapping files -->
- <mapping resource="conf/hibernate/cms/domain.hbm.xml"/>
- </session-factory>
-</hibernate-configuration>]]></programlisting>
+<!-- Force the dialect instead of using autodetection -->
+<!--
+<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+-->]]></programlisting>
</para>
</sect2>
</sect1>
@@ -226,9 +188,9 @@
<attribute name="SMTPTimeout">10000</attribute>
<attribute name="JNDIName">java:portal/MailModule</attribute>
</mbean>]]></programlisting>
- Here you can specify a different SMTP server than localhost, then precise the Smtp username and Smtp passwords to
- use to send the mails.</para>
- <para>If i wanted to use GMail smtp server, i would write:
+ Here you can specify a different SMTP server than localhost, then precise the SMTP username and SMTP password to
+ use to send emails.</para>
+ <para>For example, to use GMail's SMTP server:
<programlisting><![CDATA[<mbean
code="org.jboss.portal.core.impl.mail.MailModuleImpl"
name="portal:service=Module,type=Mail"
Modified: docs/trunk/referenceGuide/en/modules/installation.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/installation.xml 2007-10-12 00:33:46 UTC (rev 8610)
+++ docs/trunk/referenceGuide/en/modules/installation.xml 2007-10-12 00:33:50 UTC (rev 8611)
@@ -21,7 +21,7 @@
</para>
<sect1 id="install_bundle">
<title>Installing from Bundled Download</title>
- <para>This is the easiest and fastest way to get JBoss Portal installed and running. The reason, is that the
+ <para>This is the easiest and fastest way to get JBoss Portal installed and running. The reason is that the
download bundle contains JBoss Application Server, and JBoss Portal uses the embedded Hypersonic
Database.
</para>
@@ -104,11 +104,7 @@
subscription contract with Red Hat, can have access to the EAP
version from the <ulink url="http://network.jboss.com/">support portal</ulink>.
For the other versions you can get them
- <ulink
- url="http://labs.jboss.com/portal/jbossas/download/index.html"
- >here
- </ulink>
- .
+ <ulink url="http://labs.jboss.com/portal/jbossas/download/index.html">here</ulink> .
<warning>Make sure to download the JBoss AS Zip version.
<emphasis role="bold">DO NOT ATTEMPT to deploy JBoss Portal on the installer version of JBoss
AS!
@@ -155,7 +151,8 @@
contains pre-configured datasource descriptors, you can use for most popular RDBMS under the
<emphasis>setup</emphasis>
directory. For more details about the datasource descriptor or if your database server is not part
- of the pre-built descriptors, please refer to: <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">the dedicated wiki page.</ulink>
+ of the pre-built descriptors, please refer to
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CreateAJDBCDataSource">the dedicated wiki page.</ulink>
<mediaobject>
<imageobject>
<imagedata align="center" valign="middle" fileref="images/setup/dsfiles.png"/>
16 years, 8 months
JBoss Portal SVN: r8610 - in modules/test/trunk: build/ide/intellij/idea60/modules/tooling and 19 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-10-11 20:33:46 -0400 (Thu, 11 Oct 2007)
New Revision: 8610
Added:
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestCaseFactory.java
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/
modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml
Modified:
modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml
modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml
modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml
modules/test/trunk/remote/build.xml
modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
modules/test/trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java
modules/test/trunk/tooling/build.xml
modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java
modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestCaseInfo.java
modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestSuiteInfo.java
Log:
more work on remote extension + set JVM property for jboss logging to use JUL logging + started to implement JPDA option
Modified: modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/remote/remote.iml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -37,6 +37,168 @@
</library>
</orderEntry>
<orderEntry type="module" module-name="test" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-managed.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-metatype.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-kernel.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-classloader.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container-metadata.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-dependency.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-container.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-client.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-aop-mc-int.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/tooling/tooling.iml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -9,6 +9,24 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="unit" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-ant/lib/ant.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../tools/lib/ant-junit.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml
===================================================================
--- modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/build/ide/intellij/idea60/modules/unit/unit.iml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -8,6 +8,15 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: modules/test/trunk/remote/build.xml
===================================================================
--- modules/test/trunk/remote/build.xml 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/build.xml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -86,10 +86,16 @@
&libraries;
<path id="library.classpath">
<path refid="jboss.portal/modules/common.classpath"/>
+
+ <path refid="apache.log4j.classpath"/>
+
<path refid="apache.httpclient.classpath"/>
<path refid="apache.codec.classpath"/>
<path refid="apache.logging.classpath"/>
- <path refid="apache.log4j.classpath"/>
+
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss/common.logging.spi.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
</path>
<!-- Configure modules -->
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/RequestContext.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -47,4 +47,24 @@
this.parametrization = parametrization;
this.payload = payload;
}
+
+ public boolean isRequestCount(int requestCount)
+ {
+ return this.requestCount == requestCount;
+ }
+
+ public int getRequestCount()
+ {
+ return requestCount;
+ }
+
+ public Map<String, String> getParametrization()
+ {
+ return parametrization;
+ }
+
+ public Map<String, Serializable> getPayload()
+ {
+ return payload;
+ }
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverClient.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -25,23 +25,40 @@
import org.jboss.unit.driver.TestDriver;
import org.jboss.unit.driver.DriverCommand;
import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.info.TestInfo;
+import org.jboss.unit.info.TestSuiteInfo;
+import org.jboss.unit.info.impl.SimpleTestSuiteInfo;
+import org.jboss.unit.info.impl.SimpleParameterInfo;
import org.jboss.unit.TestId;
+import org.jboss.unit.Failure;
import org.jboss.portal.test.framework.server.NodeId;
import org.jboss.portal.test.framework.server.Node;
import org.jboss.portal.test.framework.server.NodeManager;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import java.net.URL;
+import java.util.Map;
+import java.util.HashMap;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class RemoteTestDriverClient implements TestDriver
+public class RemoteTestDriverClient extends BasicBootstrap implements TestDriver
{
// Config
- /** . */
- private NodeId initialNodeId;
+ /** Need to make initial node id configurable somehow. */
+// private String initialNodeId;
// Services
@@ -51,14 +68,27 @@
/** . */
private ProtocolHandler protocolHandler;
- public NodeId getInitialNodeId()
+ /** . */
+ private String archivePath;
+
+// public String getInitialNodeId()
+// {
+// return initialNodeId;
+// }
+//
+// public void setInitialNodeId(String initialNodeId)
+// {
+// this.initialNodeId = initialNodeId;
+// }
+
+ public String getArchivePath()
{
- return initialNodeId;
+ return archivePath;
}
- public void setInitialNodeId(NodeId initialNodeId)
+ public void setArchivePath(String archivePath)
{
- this.initialNodeId = initialNodeId;
+ this.archivePath = archivePath;
}
public NodeManager getNodeManager()
@@ -66,6 +96,7 @@
return nodeManager;
}
+ @Inject(bean="NodeManager")
public void setNodeManager(NodeManager nodeManager)
{
this.nodeManager = nodeManager;
@@ -76,6 +107,7 @@
return protocolHandler;
}
+ @Inject(bean="DeployerHandler")
public void setProtocolHandler(ProtocolHandler protocolHandler)
{
this.protocolHandler = protocolHandler;
@@ -86,28 +118,125 @@
return (RemoteTestDriver)node.lookupService(RemoteTestDriver.SERVICE_ID);
}
+ private boolean started = false;
+ private FailureResponse failed;
+ private KernelDeployment deployment;
+ private BeanXMLDeployer beanDeployer;
+
+ private void start()
+ {
+ if (!started && failed == null)
+ {
+
+ //
+ run();
+
+ // Install our self first
+ try
+ {
+ AbstractBeanMetaData bmd = new AbstractBeanMetaData("TestDriver", getClass().getName());
+ AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
+ bmd.setConstructor(cmd);
+ TestCaseFactory factory = new TestCaseFactory(this);
+ AbstractValueMetaData vmd = new AbstractValueMetaData(factory);
+ cmd.setFactory(vmd);
+ cmd.setFactoryMethod("getTestCase");
+ getKernel().getController().install(bmd);
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ failed = new FailureResponse(Failure.createErrorFailure("Could not startup kernel", throwable));
+ return;
+ }
+
+ // Now deploy beans
+ try
+ {
+ URL url = getClass().getResource("/org/jboss/unit/remote/driver/jboss-beans.xml");
+ beanDeployer = new BeanXMLDeployer(getKernel());
+ deployment = beanDeployer.deploy(url);
+ beanDeployer.validate();
+ }
+ catch (Throwable throwable)
+ {
+ throwable.printStackTrace();
+ failed = new FailureResponse(Failure.createErrorFailure("Could not deploy beans", throwable));
+ return;
+ }
+
+ //
+ started = true;
+ }
+ }
+
public TestInfo getInfo()
{
- Node node = nodeManager.getNode(initialNodeId);
+ start();
+
+ // Always retrieve meta data from the default node
+ Node node = nodeManager.getNode(NodeId.DEFAULT);
+
+ //
TestDriver server = getServer(node);
- return server.getInfo();
+
+ //
+ SimpleTestSuiteInfo testInfo = new SimpleTestSuiteInfo((TestSuiteInfo)server.getInfo());
+
+ System.out.println("testInfo = " + testInfo);
+
+ //
+ Map<String, SimpleParameterInfo> parameters = new HashMap<String, SimpleParameterInfo>(testInfo.getParameters());
+
+ //
+ parameters.put("archivePath", new SimpleParameterInfo("archivePath"));
+
+ //
+ testInfo.setParameters(parameters);
+
+ //
+ return testInfo;
}
public DriverResponse invoke(TestId testId, DriverCommand command)
{
- try
+ start();
+
+ //
+ if (command instanceof StartTestCommand)
{
- Node node = nodeManager.getNode(initialNodeId);
+ StartTestCommand start = (StartTestCommand)command;
+ archivePath = start.getParametrization().get("archivePath");
- // Create conversation
- TestConversation conversation = createConversation(testId, node);
+ try
+ {
+ Node node = nodeManager.getNode(NodeId.DEFAULT);
- //
- return conversation.handleCommand(command);
+ // Create conversation
+ TestConversation conversation = createConversation(testId, node);
+
+ //
+ return conversation.handleCommand(command);
+ }
+ catch (Exception e)
+ {
+ return new FailureResponse(Failure.createErrorFailure(e));
+ }
+ finally
+ {
+ try
+ {
+ beanDeployer.undeploy(deployment);
+ }
+ catch (Throwable ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
}
- catch (Exception e)
+ else
{
- throw new Error(e);
+ return new FailureResponse(Failure.createErrorFailure("Command " + command + " not accepted"));
}
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/RemoteTestDriverServer.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -47,22 +47,28 @@
private SimpleTestSuiteInfo info = new SimpleTestSuiteInfo("Main");
/** . */
- private Map<String, TestDriver> drivers = new HashMap<String, TestDriver>();
+ private Map<String, RemoteTestDriver> drivers = new HashMap<String, RemoteTestDriver>();
- /** . */
- private RequestContext requestContext;
+ public void pushContext(TestId testId, RequestContext requestContext)
+ {
+ String name = testId.getName(0);
- /** . */
- private ResponseContext responseContext;
+ //
+ RemoteTestDriver driver = drivers.get(name);
- public void pushContext(TestId testId, RequestContext testContext)
- {
- this.requestContext = testContext;
+ //
+ driver.pushContext(testId.range(1), requestContext);
}
public ResponseContext popContext(TestId testId)
{
- return responseContext;
+ String name = testId.getName(0);
+
+ //
+ RemoteTestDriver driver = drivers.get(name);
+
+ //
+ return driver.popContext(testId.range(1));
}
public TestInfo getInfo()
@@ -96,7 +102,7 @@
return driver.invoke(driverId, command);
}
- public void addDriver(TestDriver driver)
+ public void mount(RemoteTestDriver driver)
{
synchronized(RemoteTestDriverServer.class)
{
@@ -108,7 +114,7 @@
}
}
- public synchronized void removeDriver(TestDriver driver)
+ public synchronized void unmount(RemoteTestDriver driver)
{
synchronized(RemoteTestDriverServer.class)
{
@@ -120,11 +126,6 @@
}
}
-
-
-
-
-
// /** . */
// private String initialPath = "/test";
//
Added: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestCaseFactory.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestCaseFactory.java (rev 0)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestCaseFactory.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.unit.remote.driver;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestCaseFactory
+{
+
+ /** . */
+ private final Object testCase;
+
+ public TestCaseFactory(Object testCase)
+ {
+ this.testCase = testCase;
+ }
+
+ public Object getTestCase()
+ {
+ return testCase;
+ }
+}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/TestConversation.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -24,6 +24,7 @@
import org.jboss.unit.driver.DriverResponse;
import org.jboss.unit.driver.DriverCommand;
+import org.jboss.unit.driver.command.StartTestCommand;
import org.jboss.unit.driver.response.EndTestResponse;
import org.jboss.unit.remote.RequestContext;
import org.jboss.unit.remote.ResponseContext;
@@ -87,26 +88,23 @@
*/
public final DriverResponse handleCommand(RemoteDriverCommandContext commandContext) throws Exception
{
+ DriverCommand command = commandContext.getCommand();
+
//
-// if (command instanceof StartTestCommand)
-// {
-// StartTestCommand start = (StartTestCommand)command;
-// parametrization = start.getParametrization();
-// pushContext(commandContext);
-// DriverResponse response = getDriver().getServer(node).invoke(testId, command);
-// return commandContext.createResponseContext(response);
-// }
-// else if (command instanceof HTTPDriverCommand)
-// {
-// return new HTTPTestDriverHandler().invoke(this, commandContext);
-// }
-// else
-// {
-// throw new IllegalArgumentException("Not yet handled " + command);
-// }
+ RemoteDriverResponseContext respCtx;
+ if (command instanceof StartTestCommand)
+ {
+ StartTestCommand start = (StartTestCommand)command;
+ parametrization = start.getParametrization();
+ pushContext(commandContext);
+ DriverResponse response = getDriver().getServer(node).invoke(testId, command);
+ respCtx = commandContext.createResponseContext(response);
+ }
+ else
+ {
+ respCtx = protocolHandler.handleCommand(this, commandContext);
+ }
- RemoteDriverResponseContext respCtx = protocolHandler.handleCommand(this, commandContext);
-
//
DriverResponse response = respCtx.getResponse();
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/DeployerHandler.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -119,7 +119,7 @@
return new RemoteDriverCommandContext(responseContext.getCommandContext());
}
- return null; //To change body of implemented methods use File | Settings | File Templates.
+ return null;
}
public RemoteDriverResponseContext handleCommand(TestConversation conversation, RemoteDriverCommandContext commandContext) throws Exception
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/deployer/response/DeployerResponse.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -24,10 +24,12 @@
import org.jboss.unit.driver.DriverResponse;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class DeployerResponse extends DriverResponse
+public class DeployerResponse extends DriverResponse implements Serializable
{
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/command/HTTPDriverCommand.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -24,10 +24,12 @@
import org.jboss.unit.driver.DriverCommand;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class HTTPDriverCommand extends DriverCommand
+public class HTTPDriverCommand extends DriverCommand implements Serializable
{
}
Modified: modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java
===================================================================
--- modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/remote/src/main/org/jboss/unit/remote/driver/handler/http/response/HTTPDriverResponse.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -24,10 +24,12 @@
import org.jboss.unit.driver.DriverResponse;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public abstract class HTTPDriverResponse extends DriverResponse
+public abstract class HTTPDriverResponse extends DriverResponse implements Serializable
{
}
Added: modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml
===================================================================
--- modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml (rev 0)
+++ modules/test/trunk/remote/src/resources/jboss-unit-remote-jar/org/jboss/unit/remote/driver/jboss-beans.xml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software 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 ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"
+ xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="NodeFactory" class="org.jboss.portal.test.framework.impl.generic.server.GenericNodeFactory">
+ <constructor>
+ <parameter>servers.xml</parameter>
+ <parameter>RemoteTomcat_6_0</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Node0" class="org.jboss.portal.test.framework.impl.generic.server.GenericNode">
+ <constructor factoryMethod="getNode">
+ <factory bean="NodeFactory" />
+ <parameter>default</parameter>
+ </constructor>
+ </bean>
+
+ <bean name="NodeManager" class="org.jboss.portal.test.framework.server.NodeManager">
+ <constructor>
+ <parameter>
+ <list>
+ <inject bean="Node0"/>
+<!--
+ <inject bean="Node1"/>
+ <inject bean="Node2"/>
+-->
+ </list>
+ </parameter>
+ </constructor>
+ </bean>
+
+ <bean name="Deployer" class="org.jboss.portal.test.framework.deployment.Deployer">
+ </bean>
+
+ <bean name="HTTPHandler" class="org.jboss.unit.remote.driver.handler.http.HTTPHandler">
+ </bean>
+
+ <bean name="DeployerHandler" class="org.jboss.unit.remote.driver.handler.deployer.DeployerHandler">
+ <property name="nextHandler"><inject bean="HTTPHandler"/></property>
+ <property name="archivePath"><inject bean="TestDriver" property="archivePath" state="Instantiated"/></property>
+ <property name="deployer"><inject bean="Deployer"/></property>
+ </bean>
+
+</deployment>
Modified: modules/test/trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java
===================================================================
--- modules/test/trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/test/src/main/org/jboss/portal/test/framework/deployment/Deployer.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -25,11 +25,9 @@
import org.jboss.portal.test.framework.server.Node;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.io.File;
@@ -43,7 +41,7 @@
{
/** . */
- private Map deployments;
+ private Map<URL,Deployment> deployments;
public void create()
{
@@ -52,14 +50,13 @@
public void start()
{
// Should check that the deployer agent is here
- deployments = new HashMap();
+ deployments = new HashMap<URL,Deployment>();
}
public void stop()
{
- for (Iterator i = new ArrayList(deployments.keySet()).iterator(); i.hasNext();)
+ for (URL url : new ArrayList<URL>(deployments.keySet()))
{
- URL url = (URL)i.next();
undeploy(url);
}
@@ -110,12 +107,12 @@
public void deploy(String url, Node[] nodes) throws Exception
{
- this.deploy(getArchiveURL(url), nodes);
+ this.deploy(new URL(url), nodes);
}
public void undeploy(URL url)
{
- Deployment deployment = (Deployment)deployments.remove(url);
+ Deployment deployment = deployments.remove(url);
if (deployment != null)
{
deployment.undeploy();
@@ -134,57 +131,6 @@
public void undeploy(String url) throws Exception
{
- this.undeploy(getArchiveURL(url));
+ this.undeploy(new URL(url));
}
-
- /**
- * Try to discover the URL for the deployment archive based on the archive name and "standard" archive locations
- * (relative to the where the test is executed):
- * <p/>
- * <ul> <li>.</li> <li>output/libs/</li> <li>test/outputs/libs/</li> <li>output/lib/</li> <li>test/output/lib/</li>
- * <li>../output/lib/</li> <li>../test/output/lib/</li> </ul>
- *
- * @param archive the name of the archive to deploy
- * @return a URL pointing to the archive to be deployed
- * @throws IllegalArgumentException if no archive with the given name can be found to be deployed
- */
- private URL getArchiveURL(String archive)
- {
- URL url = null;
- try
- {
- url = new URL(archive);
- }
- catch (MalformedURLException ignore)
- {
-// // archive parameter was not a URL, try to build one from "standard" locations, by considering it as a file name
-// String locs[] = {archive, "output/libs/" + archive, "test/outputs/libs/" + archive, "output/lib/" + archive,
-// "test/output/lib/" + archive, "../output/lib/" + archive, "../test/output/lib/" + archive,
-// "../output/lib/tests/" + archive};
-//
-// for (int i = 0; i < locs.length && url == null; i++)
-// {
-// File file = new File(locs[i]);
-// if (file.exists())
-// {
-// try
-// {
-// url = file.toURL();
-// }
-// catch (MalformedURLException e)
-// {
-// // shouldn't happen
-// }
-// }
-// }
- }
-
- // if we still don't have a URL at this point, we won't find one: declare failure!
- if (url == null)
- {
- throw new IllegalArgumentException("Cannot obtain URL for: " + archive);
- }
-
- return url;
- }
}
Modified: modules/test/trunk/tooling/build.xml
===================================================================
--- modules/test/trunk/tooling/build.xml 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/tooling/build.xml 2007-10-12 00:33:46 UTC (rev 8610)
@@ -85,7 +85,7 @@
<!-- Configure thirdparty libraries -->
&libraries;
<path id="library.classpath">
- <path location="${apache.ant.lib}/ant-junit.jar"/>
+ <path location="../tools/lib/ant-junit.jar"/>
<path location="${apache.ant.lib}/ant.jar"/>
<path location="${project.root}/unit/"/>
</path>
Modified: modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java
===================================================================
--- modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/tooling/src/main/org/jboss/unit/tooling/ant/TestsType.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -26,20 +26,15 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Environment;
import org.apache.tools.ant.taskdefs.Java;
-import org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator;
-import org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer;
import org.jboss.unit.tooling.filter.IncludeTestFilter;
import org.jboss.unit.tooling.filter.ExcludeTestFilter;
import org.jboss.unit.tooling.Main;
-import org.jboss.unit.tooling.MainBuilder;
-import org.jboss.unit.report.impl.junit.JUnitTestReport;
import java.util.List;
import java.util.LinkedList;
import java.util.Set;
-import java.io.File;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -63,7 +58,9 @@
private String suiteName;
+ private boolean jpda;
+
public TestsType()
{
}
@@ -79,8 +76,6 @@
addArguments(javaTask);
-
-
javaTask.setClassname("org.jboss.unit.tooling.Main");
try
@@ -111,7 +106,22 @@
javaTask = (Java)getProject().createTask("java");
+ // Set jboss logging to use JUL
+ Environment.Variable pluginProperty = new Environment.Variable();
+ pluginProperty.setKey("org.jboss.logging.Logger.pluginClass");
+ pluginProperty.setValue("org.jboss.logging.jdk.JDK14LoggerPlugin");
+ javaTask.addSysproperty(pluginProperty);
+ // Beginning of jpda option implementation, need to improve it
+ if (jpda)
+ {
+ Environment.Variable javaDotCompilerProperty = new Environment.Variable();
+ javaDotCompilerProperty.setKey("java.compiler");
+ javaDotCompilerProperty.setValue("NONE");
+ javaTask.addSysproperty(javaDotCompilerProperty);
+ javaTask.setJvmargs("-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000");
+ }
+
// Apply task classpath
if (getClasspath() != null)
{
@@ -347,4 +357,14 @@
{
this.suiteName = suiteName;
}
+
+ public boolean isJpda()
+ {
+ return jpda;
+ }
+
+ public void setJpda(boolean jpda)
+ {
+ this.jpda = jpda;
+ }
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/Failure.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -76,9 +76,9 @@
return type;
}
- public static Failure createErrorFailure(String messge)
+ public static Failure createErrorFailure(String message)
{
- return new Failure(messge, FailureType.ERROR);
+ return new Failure(message, FailureType.ERROR);
}
public static Failure createErrorFailure(String message, Throwable throwable)
@@ -95,4 +95,9 @@
{
return new Failure(throwable, FailureType.ASSERTION);
}
+
+ public static Failure createAssertionFailure(String message)
+ {
+ return new Failure(message, FailureType.ASSERTION);
+ }
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestCaseInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestCaseInfo.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestCaseInfo.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -39,4 +39,9 @@
{
super(that);
}
+
+ public String toString()
+ {
+ return getName();
+ }
}
Modified: modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestSuiteInfo.java
===================================================================
--- modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestSuiteInfo.java 2007-10-12 00:05:43 UTC (rev 8609)
+++ modules/test/trunk/unit/src/main/org/jboss/unit/info/impl/SimpleTestSuiteInfo.java 2007-10-12 00:33:46 UTC (rev 8610)
@@ -31,6 +31,7 @@
import java.util.HashMap;
import java.util.Set;
import java.util.Collections;
+import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -142,4 +143,21 @@
return new SimpleTestCaseInfo(testCase);
}
}
+
+ public String toString()
+ {
+ StringBuilder builder = new StringBuilder(getName());
+ builder.append('[');
+ for (Iterator i = tests.values().iterator();i.hasNext();)
+ {
+ TestInfo test = (TestInfo)i.next();
+ builder.append(test);
+ if (i.hasNext())
+ {
+ builder.append(',');
+ }
+ }
+ builder.append(']');
+ return builder.toString();
+ }
}
16 years, 8 months
JBoss Portal SVN: r8609 - in trunk: core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF and 6 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-11 20:05:43 -0400 (Thu, 11 Oct 2007)
New Revision: 8609
Added:
trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml
Removed:
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/
trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/
Modified:
trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
Log:
- JBPORTAL-1715: Added support for adding registration properties (does not work properly but committing for synchronization purpose: QNameConverter will probably be removed to avoid CCE with XB).
- Moved Hibernate configuration to a location mirroring that of other modules.
Modified: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
--- trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-11 23:44:03 UTC (rev 8608)
+++ trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-12 00:05:43 UTC (rev 8609)
@@ -25,6 +25,7 @@
import org.jboss.portal.registration.RegistrationPolicy;
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -47,6 +48,9 @@
private ProducerConfigurationService configurationService;
private String policyClassName;
private String validatorClassName;
+ private static final String PROPERTY = "property";
+ private static int counter = 0;
+ private static final String PRODUCER = "producer";
public ProducerConfigurationService getConfigurationService()
{
@@ -157,6 +161,12 @@
log.debug(e);
beanContext.createErrorMessage("status", "Couldn't save producer configuration. Cause: " + e.getLocalizedMessage());
}
- return null;
+ return PRODUCER;
}
+
+ public String addRegistrationProperty()
+ {
+ getRegRequirements().addRegistrationProperty(new RegistrationPropertyDescription(PROPERTY + counter++, WSRPConstants.XSD_STRING));
+ return PRODUCER;
+ }
}
Copied: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java (from rev 8606, branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java)
===================================================================
--- trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java (rev 0)
+++ trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/QNameConverter.java 2007-10-12 00:05:43 UTC (rev 8609)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.wsrp.admin.ui;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class QNameConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String s)
+ {
+ return s == null ? null : QName.valueOf(s);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object o)
+ {
+ return o == null ? null : o.toString();
+ }
+}
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-11 23:44:03 UTC (rev 8608)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -36,6 +36,10 @@
<converter-for-class>org.jboss.portal.wsrp.registration.LocalizedString</converter-for-class>
<converter-class>org.jboss.portal.wsrp.admin.ui.LocalizedStringConverter</converter-class>
</converter>
+ <converter>
+ <converter-for-class>javax.xml.namespace.QName</converter-for-class>
+ <converter-class>org.jboss.portal.wsrp.admin.ui.QNameConverter</converter-class>
+ </converter>
<managed-bean>
<managed-bean-name>beanContext</managed-bean-name>
@@ -83,7 +87,7 @@
<managed-bean>
<managed-bean-name>producer</managed-bean-name>
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
+ <managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>configurationService</property-name>
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</property-class>
Modified: trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml
===================================================================
--- trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-11 23:44:03 UTC (rev 8608)
+++ trunk/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer.xhtml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -56,7 +56,7 @@
headerClass="portlet-section-header">
<h:column>
<f:facet name="header">Name</f:facet>
- <h:inputText value="#{property.name}" size="60"/>
+ <h:inputText value="#{property.name}" size="30"/>
</h:column>
<h:column>
<f:facet name="header">Type</f:facet>
@@ -66,25 +66,25 @@
</h:column>
<h:column>
<f:facet name="header">Label</f:facet>
- <h:inputText value="#{property.label}" size="60"/>
+ <h:inputText value="#{property.label}" size="50"/>
</h:column>
<h:column>
<f:facet name="header">Hint</f:facet>
- <h:inputText value="#{property.hint}" size="60"/>
+ <h:inputText value="#{property.hint}" size="50"/>
</h:column>
</h:dataTable>
- <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
- styleClass="portlet-form-button"/>
</c:when>
<c:otherwise>
<h:outputText value="No specified required registration properties."/>
</c:otherwise>
</c:choose>
+ <h:commandLink action="#{producer.addRegistrationProperty}" value="Add property"
+ styleClass="portlet-form-button"/>
</h:panelGroup>
</h:panelGroup>
<h:outputText value=" "/>
- <h:commandLink action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
+ <h:commandButton action="#{producer.save}" value="Save" styleClass="portlet-form-button"/>
</h:panelGrid>
</h:form>
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-10-11 23:44:03 UTC (rev 8608)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-10-12 00:05:43 UTC (rev 8609)
@@ -99,6 +99,11 @@
reloadConfiguration();
}
+ protected void stopService() throws Exception
+ {
+ saveConfiguration();
+ }
+
public void reloadConfiguration() throws Exception
{
URL configURL = getConfigLocationURL();
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-10-11 23:44:03 UTC (rev 8608)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -146,7 +146,7 @@
<depends>portal:service=TreeCacheProvider,type=hibernate</depends>
@portal.single.xml.open@ -->
<attribute name="DoChecking">true</attribute>
- <attribute name="ConfigLocation">conf/consumer/hibernate/hibernate.cfg.xml</attribute>
+ <attribute name="ConfigLocation">conf/hibernate/consumer/hibernate.cfg.xml</attribute>
<attribute name="JNDIName">java:/portal/WSRPConsumerSessionFactory</attribute>
</mbean>
Copied: trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate (from rev 8606, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate)
Copied: trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer (from rev 8606, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer)
Copied: trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml (from rev 8607, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml)
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml (rev 0)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/domain.hbm.xml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -0,0 +1,145 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software 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 ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+ <hibernate-mapping>
+ <class name="org.jboss.portal.wsrp.consumer.ProducerInfo" table="JBP_PRODUCER_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" access="field" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <many-to-one name="endpointConfigurationInfo"
+ column="ENDPOINT_ID"
+ class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
+ unique="true"
+ not-null="true"
+ cascade="all"
+ lazy="false"/>
+ <many-to-one name="registrationInfo"
+ column="REGISTRATION_ID"
+ class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
+ unique="true"
+ not-null="false"
+ cascade="all"
+ lazy="false"/>
+ <property name="expirationCacheSeconds" column="EXPIRATION_CACHE_SECONDS" type="java.lang.Integer"/>
+ <property name="active" not-null="true" column="ACTIVE" type="boolean"/>
+ <property name="persistentId" column="PRODUCER_ID" not-null="true" unique="true" type="java.lang.String"
+ access="field"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo" table="JBP_ENDPOINT_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="serviceDescriptionURL" column="SD_URL" type="java.lang.String" not-null="true"/>
+ <property name="markupURL" column="M_URL" type="java.lang.String" not-null="true"/>
+ <property name="portletManagementURL" column="PM_URL" type="java.lang.String" not-null="false"/>
+ <property name="registrationURL" column="R_URL" type="java.lang.String" not-null="false"/>
+ <property name="wsdlDefinitionURL" column="WSDL_URL" type="java.lang.String" not-null="false"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationInfo" table="JBP_REGISTRATION_INFO">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="consumerName" column="CONSUMER_NAME" type="java.lang.String" not-null="true"/>
+ <property name="registrationHandle" column="HANDLE" type="java.lang.String"/>
+ <property name="registrationState" column="STATE" type="binary" length="50000000"/>
+ <map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="REG_PK" not-null="true"/>
+ <map-key type="string" formula="name"/>
+ <one-to-many class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
+ </map>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationProperty" table="JBP_REG_PROPERTY">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME" type="java.lang.String" not-null="true"/>
+ <property name="value" column="VALUE" type="java.lang.String"/>
+ <property name="invalid" column="INVALID" type="java.lang.Boolean"/>
+ <property name="lang" column="LANG" type="java.lang.String" not-null="true"/>
+ <many-to-one
+ name="description"
+ column="DESC_PK"
+ class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
+ unique="true"
+ cascade="all"
+ lazy="false"/>
+ </class>
+ <class name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription" table="JBP_REG_PROP_DESC">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <id name="key" column="PK" type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">portlet_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
+ <property name="type" column="TYPE" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"/>
+ <property name="schemaLocation" column="SCHEMA_LOCATION" type="java.lang.String"/>
+ <component name="description" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="DESC_VALUE"/>
+ <property name="locale" column="DESC_LOCALE"/>
+ <property name="resourceName" column="DESC_RES"/>
+ </component>
+ <component name="hint" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="HINT_VALUE"/>
+ <property name="locale" column="HINT_LOCALE"/>
+ <property name="resourceName" column="HINT_RES"/>
+ </component>
+ <component name="label" class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="LABEL_VALUE"/>
+ <property name="locale" column="LABEL_LOCALE"/>
+ <property name="resourceName" column="LABEL_RES"/>
+ </component>
+ <array name="usages" table="JBP_REG_PROP_DESC_USAGES" cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="USAGE" type="java.lang.String" not-null="true" unique="false"/>
+ </array>
+ <array name="aliases" table="JBP_REG_PROP_DESC_ALIASES" cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage@"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="ALIAS" type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true" unique="false"/>
+ </array>
+ </class>
+</hibernate-mapping>
Copied: trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml (from rev 8607, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml)
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml (rev 0)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/ehcache.xml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -0,0 +1,60 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software 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 ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<ehcache>
+
+ <!-- Sets the path to the directory where cache .data files are created.
+
+ If the path is a Java System Property it is replaced by
+ its value in the running VM.
+
+ The following properties are translated:
+ user.home - User's home directory
+ user.dir - User's current working directory
+ java.io.tmpdir - Default temp file path -->
+ <diskStore path="java.io.tmpdir/wsrpconsumer"/>
+
+
+ <!--Default Cache configuration. These will applied to caches programmatically created through
+ the CacheManager.
+
+ The following attributes are required for defaultCache:
+
+ maxInMemory - Sets the maximum number of objects that will be created in memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
+ if the element is not eternal. Idle time is now - last accessed time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
+ has reached the maxInMemory limit.
+
+ -->
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="1800"
+ timeToLiveSeconds="1800"
+ overflowToDisk="false"
+ />
+</ehcache>
\ No newline at end of file
Copied: trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml (from rev 8607, branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml)
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml (rev 0)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/hibernate/consumer/hibernate.cfg.xml 2007-10-12 00:05:43 UTC (rev 8609)
@@ -0,0 +1,58 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software 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 ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <property name="connection.datasource">java:@portal.datasource.name@</property>
+ <property name="show_sql">@portal.sql.show@</property>
+ <property name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">true</property>
+
+ <!--
+ | Uncomment in clustered mode : use transactional replicated cache
+ @portal.single.xml.close@
+ <property name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
+ <property name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
+ @portal.single.xml.open@
+ -->
+
+ <!--
+ | Comment in clustered mode
+ @portal.clustered.xml.close@
+ <property name="cache.provider_configuration_file_resource_path">conf/consumer/hibernate/ehcache.xml</property>
+ <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+ @portal.clustered.xml.open@
+ -->
+
+ <!-- Force the dialect instead of using autodetection -->
+ <!--
+ <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ -->
+
+ <!-- Mapping files -->
+ <mapping resource="conf/consumer/hibernate/domain.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
16 years, 8 months
JBoss Portal SVN: r8608 - in branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar: conf and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-11 19:44:03 -0400 (Thu, 11 Oct 2007)
New Revision: 8608
Removed:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/conf/consumer/
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
Log:
- Forgot to commit service definition and to remove files (more accurately, IDEA screwed up on the last couple of commits) :(
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-10-11 23:40:06 UTC (rev 8607)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-10-11 23:44:03 UTC (rev 8608)
@@ -145,7 +145,7 @@
<depends>portal:service=TreeCacheProvider,type=hibernate</depends>
@portal.single.xml.open@ -->
<attribute name="DoChecking">true</attribute>
- <attribute name="ConfigLocation">conf/consumer/hibernate/hibernate.cfg.xml</attribute>
+ <attribute name="ConfigLocation">conf/hibernate/consumer/hibernate.cfg.xml</attribute>
<attribute name="JNDIName">java:/portal/WSRPConsumerSessionFactory</attribute>
</mbean>
16 years, 8 months