From: <st...@us...> - 2007-01-19 13:54:04
|
Revision: 3821 http://svn.sourceforge.net/smartfrog/?rev=3821&view=rev Author: steve_l Date: 2007-01-19 05:52:26 -0800 (Fri, 19 Jan 2007) Log Message: ----------- two new files Added Paths: ----------- trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/AbstractListenerImpl.java trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/NullListenerImpl.java Added: trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/AbstractListenerImpl.java =================================================================== --- trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/AbstractListenerImpl.java (rev 0) +++ trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/AbstractListenerImpl.java 2007-01-19 13:52:26 UTC (rev 3821) @@ -0,0 +1,104 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.xunit.listeners; + +import org.smartfrog.sfcore.prim.PrimImpl; +import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.services.xunit.base.TestListener; +import org.smartfrog.services.xunit.serial.TestInfo; +import org.smartfrog.services.xunit.serial.LogEntry; + +import java.rmi.RemoteException; + +/** + * Base class that provides no-op entry points for the various callbacks. + * It does not implement a factory; that should be done by subclasses + * created 17-Jan-2007 15:55:50 + * */ + +public abstract class AbstractListenerImpl extends PrimImpl implements TestListener { + + + public AbstractListenerImpl() throws RemoteException { + } + + + /** + * end this test suite. After calling this, caller should discard all references; they may no longer be valid. <i>No + * further methods may be called</i> + */ + public void endSuite() throws RemoteException, SmartFrogException { + + } + + /** + * An error occurred. + * + * @param test test that errored + * @throws RemoteException network problems + * @throws SmartFrogException other problems + */ + public void addError(TestInfo test) throws RemoteException, SmartFrogException { + + } + + /** + * A failure occurred. + * + * @param test test that failed + * @throws RemoteException network problems + * @throws SmartFrogException other problems + */ + public void addFailure(TestInfo test) throws RemoteException, SmartFrogException { + + } + + /** + * A test ended. + * + * @param test test that ended + * @throws RemoteException network problems + * @throws SmartFrogException other problems + */ + public void endTest(TestInfo test) throws RemoteException, SmartFrogException { + + } + + /** + * A test started. + * + * @param test test that started + * @throws RemoteException network problems + * @throws SmartFrogException other problems + */ + public void startTest(TestInfo test) throws RemoteException, SmartFrogException { + + } + + /** + * Log an event + * + * @param event what happened + * @throws RemoteException + */ + public void log(LogEntry event) throws RemoteException { + + } +} Added: trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/NullListenerImpl.java =================================================================== --- trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/NullListenerImpl.java (rev 0) +++ trunk/core/components/xunit/src/org/smartfrog/services/xunit/listeners/NullListenerImpl.java 2007-01-19 13:52:26 UTC (rev 3821) @@ -0,0 +1,55 @@ +/** (C) Copyright 2006 Hewlett-Packard Development Company, LP + + This library 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 library 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 library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + For more information: www.smartfrog.org + + */ +package org.smartfrog.services.xunit.listeners; + +import org.smartfrog.services.xunit.base.TestListenerFactory; +import org.smartfrog.services.xunit.base.TestListener; +import org.smartfrog.services.xunit.base.TestSuite; +import org.smartfrog.sfcore.common.SmartFrogException; + +import java.rmi.RemoteException; + +/** + * Dump all listened to events into the void. + */ + +public class NullListenerImpl extends AbstractListenerImpl implements TestListenerFactory { + + + public NullListenerImpl() throws RemoteException { + } + + + /** + * Start listening to a test suite + * + * @param suite the test suite that is about to run. May be null, especially during testing. + * @param hostname name of host + * @param processname name of the process + * @param suitename name of test suite + * @param timestamp start timestamp (UTC) + * @return a listener to talk to + * @throws RemoteException network problems + * @throws SmartFrogException code problems + */ + public TestListener listen(TestSuite suite, String hostname, String processname, String suitename, long timestamp) throws RemoteException, SmartFrogException { + return this; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |