From: <st...@us...> - 2011-04-03 22:22:23
|
Revision: 8559 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=8559&view=rev Author: steve_l Date: 2011-04-03 22:22:13 +0000 (Sun, 03 Apr 2011) Log Message: ----------- SFOS-1580 review all code in org.smartfrog.services, clean it up Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/services/assertions/Assert.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/AssertComponent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrower.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrowerImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/Fail.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/FailComponent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTarget.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTargetImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlock.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlockImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestCompoundImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestFailureException.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestTimeoutException.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestCompletedEvent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestEventSink.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestInterruptedEvent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestStartedEvent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TimeoutTracker.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/AbstractHistoryPrimImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryAssertOrderedMessages.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryEvent.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryLogAssertion.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryLogImpl.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/lifecycle/LifecycleTester.java trunk/core/smartfrog/src/org/smartfrog/services/assertions/lifecycle/LifecycleTesterImpl.java trunk/core/smartfrog/src/org/smartfrog/services/autoloader/Autoloader.java trunk/core/smartfrog/src/org/smartfrog/services/comm/mcast/SFMCastClient.java trunk/core/smartfrog/src/org/smartfrog/services/comm/mcast/SFMCastClientImpl.java trunk/core/smartfrog/src/org/smartfrog/services/comm/mcast/SFMCastServerImpl.java trunk/core/smartfrog/src/org/smartfrog/services/deploydir/DeployingDirectoryWatcherImpl.java trunk/core/smartfrog/src/org/smartfrog/services/deploydir/DirectoryApplication.java trunk/core/smartfrog/src/org/smartfrog/services/deploydir/DirectoryWatcherImpl.java trunk/core/smartfrog/src/org/smartfrog/services/display/Display.java trunk/core/smartfrog/src/org/smartfrog/services/display/FontSize.java trunk/core/smartfrog/src/org/smartfrog/services/display/HeadlessImpl.java trunk/core/smartfrog/src/org/smartfrog/services/display/PrintErrMsgInt.java trunk/core/smartfrog/src/org/smartfrog/services/display/PrintMsgInt.java trunk/core/smartfrog/src/org/smartfrog/services/display/SFDisplay.java trunk/core/smartfrog/src/org/smartfrog/services/display/StopResume.java trunk/core/smartfrog/src/org/smartfrog/services/display/WindowUtilities.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/ChmodImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/CopyFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/DeleteFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/DeployByCopyImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileExists.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileExistsImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileSystem.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileUsingComponentImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FileUsingCompoundImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/FilepathFunction.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/MkdirImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/SelfDeletingFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/TempDirImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/TempFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/TextFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/TouchFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/TupleReaderThread.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/append/AppendLinesImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/files/FilenamePatternFilter.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/files/FilesCompoundImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/files/FilesImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/files/Fileset.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/filestore/FileEntry.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/filestore/FileEntryImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/filestore/LocalFilestore.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/filestore/LocalFilestoreImpl.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/replacevar/ParserVar.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/replacevar/ReplaceVar.java trunk/core/smartfrog/src/org/smartfrog/services/filesystem/replacevar/SFReplaceFileVar.java trunk/core/smartfrog/src/org/smartfrog/services/hostnames/HostnameIsImpl.java trunk/core/smartfrog/src/org/smartfrog/services/hostnames/LocalhostAddressFunction.java trunk/core/smartfrog/src/org/smartfrog/services/hostnames/LocalhostFunction.java trunk/core/smartfrog/src/org/smartfrog/services/management/DeployEntry.java trunk/core/smartfrog/src/org/smartfrog/services/management/DeployEntryCellRenderer.java trunk/core/smartfrog/src/org/smartfrog/services/management/DeployMgnt.java trunk/core/smartfrog/src/org/smartfrog/services/management/DeployTreeModelSF.java trunk/core/smartfrog/src/org/smartfrog/services/management/DeployTreePanel.java trunk/core/smartfrog/src/org/smartfrog/services/management/NewAttributeDialog.java trunk/core/smartfrog/src/org/smartfrog/services/management/OptionSet.java trunk/core/smartfrog/src/org/smartfrog/services/management/PopUpTable.java trunk/core/smartfrog/src/org/smartfrog/services/management/PopUpTree.java trunk/core/smartfrog/src/org/smartfrog/services/management/SFDeployDisplay.java trunk/core/smartfrog/src/org/smartfrog/services/os/IsOSCondition.java trunk/core/smartfrog/src/org/smartfrog/services/os/download/DownloadImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/DirectoryClasspathImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/FlattenLocalFilesPolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/IvyLocalCachePolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/IvyLocalPublishedPolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/JavaPackage.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/JavaPackageImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/Library.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryArtifact.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryArtifactImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryCachePolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryClasspathImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryHelper.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LibraryImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LoadClassImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LoadPropertyFile.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LoadPropertyFileImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/LocalCachePolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/Maven1Policy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/Maven2Policy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/NoRemoteArtifactPolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/RemoteCachePolicy.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/RunJava.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/RunJavaImpl.java trunk/core/smartfrog/src/org/smartfrog/services/os/java/SerializedArtifact.java trunk/core/smartfrog/src/org/smartfrog/services/os/runshell/RunShellImpl.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/BulkPasswordProvider.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/FilePasswordProvider.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/InlinePasswordProviderImpl.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/PasswordChecker.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/PasswordHelper.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/PasswordProvider.java trunk/core/smartfrog/src/org/smartfrog/services/passwords/PropertyPasswordProvider.java trunk/core/smartfrog/src/org/smartfrog/services/ports/PortUtils.java trunk/core/smartfrog/src/org/smartfrog/services/scripting/common/RemoteScriptPrim.java trunk/core/smartfrog/src/org/smartfrog/services/scripting/javax/JavaxScriptingConditionImpl.java trunk/core/smartfrog/src/org/smartfrog/services/scripting/javax/JavaxScriptingImpl.java trunk/core/smartfrog/src/org/smartfrog/services/scripting/javax/ScriptHelper.java trunk/core/smartfrog/src/org/smartfrog/services/sfautowrapper/SFAutoWrapper.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/Cmd.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/FilterImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/FilterListener.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/RunProcess.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/RunProcessImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFExecution.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFProcessExecution.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFProcessExecutionImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFReadConfig.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFScript.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFScriptExecution.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/SFScriptExecutionImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecution.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptExecutionImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptLock.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptLockImpl.java trunk/core/smartfrog/src/org/smartfrog/services/shellscript/ScriptResults.java trunk/core/smartfrog/src/org/smartfrog/services/trace/BrowseTreeModelSF.java trunk/core/smartfrog/src/org/smartfrog/services/trace/BrowserEntry.java trunk/core/smartfrog/src/org/smartfrog/services/trace/Entry.java trunk/core/smartfrog/src/org/smartfrog/services/trace/SFTrace.java trunk/core/smartfrog/src/org/smartfrog/services/utils/concat/SFConcat.java trunk/core/smartfrog/src/org/smartfrog/services/utils/concat/SFConcatImpl.java trunk/core/smartfrog/src/org/smartfrog/services/utils/generic/StreamGobbler.java trunk/core/smartfrog/src/org/smartfrog/services/utils/logtofile/SFLogToFile.java trunk/core/smartfrog/src/org/smartfrog/services/utils/setproperty/SFSetPropertyImpl.java trunk/core/smartfrog/src/org/smartfrog/services/utils/setproperty/SystemPropertiesImpl.java trunk/core/smartfrog/src/org/smartfrog/sfcore/common/OptionSet.java trunk/core/smartfrog/src/org/smartfrog/sfcore/processcompound/RootLocator.java Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/Assert.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/Assert.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/Assert.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -25,92 +25,92 @@ /** * {@value} */ - public String ATTR_IS_TRUE = "isTrue"; + String ATTR_IS_TRUE = "isTrue"; /** * {@value} */ - public String ATTR_IS_FALSE = "isFalse"; + String ATTR_IS_FALSE = "isFalse"; /** * {@value} */ - public String ATTR_REFERENCE = "reference"; + String ATTR_REFERENCE = "reference"; /** * {@value} */ - public String ATTR_REFERENCE_REQUIRED = "referenceRequired"; + String ATTR_REFERENCE_REQUIRED = "referenceRequired"; /** * {@value} */ - public String ATTR_HAS_ATTRIBUTE = "hasAttribute"; + String ATTR_HAS_ATTRIBUTE = "hasAttribute"; /** * {@value} */ - public String ATTR_EVALUATES_TRUE = "evaluatesTrue"; + String ATTR_EVALUATES_TRUE = "evaluatesTrue"; /** * {@value} */ - public String ATTR_EVALUATES_FALSE = "evaluatesFalse"; + String ATTR_EVALUATES_FALSE = "evaluatesFalse"; /** * check when we start up {@value} */ - public String ATTR_CHECK_ON_STARTUP = "checkOnStartup"; + String ATTR_CHECK_ON_STARTUP = "checkOnStartup"; /** * check on a ping {@value} */ - public String ATTR_CHECK_ON_LIVENESS = "checkOnLiveness"; + String ATTR_CHECK_ON_LIVENESS = "checkOnLiveness"; /** * {@value} */ - public String ATTR_FILE_EXISTS = "fileExists"; + String ATTR_FILE_EXISTS = "fileExists"; /** * {@value} */ - public String ATTR_DIR_EXISTS = "dirExists"; + String ATTR_DIR_EXISTS = "dirExists"; /** * {@value} */ - public String ATTR_ATTRIBUTE_EQUALS = "attributeEquals"; + String ATTR_ATTRIBUTE_EQUALS = "attributeEquals"; /** * first equality string {@value} */ - public String ATTR_EQUALS_STRING1 = "equalsString1"; + String ATTR_EQUALS_STRING1 = "equalsString1"; /** * second equality string {@value} */ - public String ATTR_EQUALS_STRING2 = "equalsString2"; + String ATTR_EQUALS_STRING2 = "equalsString2"; /** * {@value} */ - public String ATTR_EQUALITY_IGNORES_CASE = "equalityIgnoresCase"; + String ATTR_EQUALITY_IGNORES_CASE = "equalityIgnoresCase"; /** * {@value} */ - public String ATTR_MESSAGE = "message"; + String ATTR_MESSAGE = "message"; // /** * value of a vector element to test {@value} */ - public String ATTR_VECTOR_VALUE = "attributeVectorValue"; + String ATTR_VECTOR_VALUE = "attributeVectorValue"; //the index to look for /** * the index to look for {@value} */ - public String ATTR_VECTOR_INDEX = "attributeVectorIndex"; + String ATTR_VECTOR_INDEX = "attributeVectorIndex"; /** * the min length of the vector {@value} */ - public String ATTR_VECTOR_MIN_LENGTH = "attributeVectorMinLength"; + String ATTR_VECTOR_MIN_LENGTH = "attributeVectorMinLength"; /** * the max length of the vector {@value} */ - public String ATTR_VECTOR_MAX_LENGTH = "attributeVectorMaxLength"; + String ATTR_VECTOR_MAX_LENGTH = "attributeVectorMaxLength"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/AssertComponent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/AssertComponent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/AssertComponent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -55,6 +55,7 @@ * @throws RemoteException * @throws SmartFrogException */ + @Override public boolean evaluate() throws RemoteException, SmartFrogException { String result = check(); if (result != null) { @@ -414,6 +415,7 @@ * @throws SmartFrogLivenessException component is terminated * @throws RemoteException In case of network/rmi error */ + @Override public void sfPing(Object source) throws SmartFrogLivenessException, RemoteException { super.sfPing(source); @@ -442,6 +444,7 @@ * @throws SmartFrogException failure while starting * @throws RemoteException In case of network/rmi error */ + @Override public synchronized void sfStart() throws SmartFrogException, RemoteException { super.sfStart(); Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrower.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrower.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrower.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -26,15 +26,15 @@ */ public interface ExceptionThrower extends Remote { - public String ATTR_CLASSNAME="classname"; + String ATTR_CLASSNAME="classname"; - public String ATTR_MESSAGE="message"; + String ATTR_MESSAGE="message"; /** {@value} */ - public String ATTR_THROW_ON_STARTUP = "throwOnStartup"; + String ATTR_THROW_ON_STARTUP = "throwOnStartup"; /** {@value} */ - public String ATTR_THROW_ON_DEPLOY = "throwOnDeploy"; + String ATTR_THROW_ON_DEPLOY = "throwOnDeploy"; /** {@value} */ - public String ATTR_THROW_ON_PING = "throwOnPing"; + String ATTR_THROW_ON_PING = "throwOnPing"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrowerImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrowerImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/ExceptionThrowerImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -119,16 +119,12 @@ instance = e; } catch (NoSuchMethodException e) { instance = e; - } catch (InstantiationException e) { instance = e; - } catch (IllegalAccessException e) { instance = e; - } catch (InvocationTargetException e) { instance = e; - } if(instance instanceof RuntimeException) { throw (RuntimeException)instance; Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/Fail.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/Fail.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/Fail.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -7,20 +7,20 @@ */ public interface Fail extends Remote { /** {@value} */ - String ATTR_MESSAGE="message"; + String ATTR_MESSAGE = "message"; /** {@value} */ - String ATTR_NORMAL="normal"; + String ATTR_NORMAL = "normal"; /** {@value} */ - String ATTR_CONDITION="condition"; + String ATTR_CONDITION = "condition"; /** {@value} */ - String ATTR_DELAY="delay"; + String ATTR_DELAY = "delay"; /** {@value} */ - String ATTR_DETACH="detach"; + String ATTR_DETACH = "detach"; /** {@value} */ - String ATTR_NOTIFY ="notifyParent"; + String ATTR_NOTIFY = "notifyParent"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/FailComponent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/FailComponent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/FailComponent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -33,10 +33,10 @@ * a scheduled delay. Useful for testing child-death-handling logic * of containers and workflow. */ -public class FailComponent extends PrimImpl implements Fail,Runnable { +public class FailComponent extends PrimImpl implements Fail, Runnable { private boolean normal; - private int delay=0; + private int delay = 0; private String message; private boolean detach; private boolean notifyParent; @@ -52,16 +52,17 @@ * @throws SmartFrogException * @throws RemoteException */ + @Override public synchronized void sfStart() - throws SmartFrogException, RemoteException { + throws SmartFrogException, RemoteException { super.sfStart(); boolean condition = sfResolve(ATTR_CONDITION, false, true); delay = sfResolve(ATTR_DELAY, 0, true); - detach= sfResolve(ATTR_DETACH, false, true); + detach = sfResolve(ATTR_DETACH, false, true); message = sfResolve(ATTR_MESSAGE, "", true); normal = sfResolve(ATTR_NORMAL, false, true); notifyParent = sfResolve(ATTR_NOTIFY, false, true); - if(condition) { + if (condition) { Thread thread = new Thread(this); thread.start(); } @@ -70,6 +71,7 @@ /** * Entry point for the run */ + @Override public void run() { if (delay > 0) { try { @@ -89,8 +91,11 @@ private TerminationRecord createTerminationRecord() { TerminationRecord record; Reference name = sfCompleteNameSafe(); - record=new TerminationRecord(normal?TerminationRecord.NORMAL:TerminationRecord.ABNORMAL, - message,name); + record = new TerminationRecord(normal ? + TerminationRecord.NORMAL + : TerminationRecord.ABNORMAL, + message, + name); return record; } } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTarget.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTarget.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTarget.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -19,12 +19,14 @@ */ package org.smartfrog.services.assertions; +import java.rmi.Remote; + /** * Created 15-Aug-2008 14:35:49 */ -public interface PingTarget { +public interface PingTarget extends Remote { String ATTR_TARGET = "target"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTargetImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTargetImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/PingTargetImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -19,11 +19,11 @@ */ package org.smartfrog.services.assertions; +import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.sfcore.common.SmartFrogLivenessException; +import org.smartfrog.sfcore.prim.Liveness; import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.prim.PrimImpl; -import org.smartfrog.sfcore.prim.Liveness; -import org.smartfrog.sfcore.common.SmartFrogException; -import org.smartfrog.sfcore.common.SmartFrogLivenessException; import org.smartfrog.sfcore.utils.ComponentHelper; import java.rmi.RemoteException; @@ -50,9 +50,9 @@ @Override public synchronized void sfStart() throws SmartFrogException, RemoteException { super.sfStart(); - target = sfResolve(ATTR_TARGET,(Prim)null,true); + target = sfResolve(ATTR_TARGET, (Prim) null, true); target.sfPing(this); - new ComponentHelper(this).sfSelfDetachAndOrTerminate(null,null,null,null); + new ComponentHelper(this).sfSelfDetachAndOrTerminate(null, null, null, null); } /** Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlock.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlock.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlock.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -19,12 +19,11 @@ */ package org.smartfrog.services.assertions; -import org.smartfrog.sfcore.prim.TerminationRecord; -import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.sfcore.prim.Prim; +import org.smartfrog.sfcore.prim.TerminationRecord; import org.smartfrog.sfcore.workflow.eventbus.EventRegistration; -import java.rmi.Remote; import java.rmi.RemoteException; /** @@ -44,16 +43,17 @@ * {@value} */ String ATTR_STATUS = "status"; + /** * {@value} */ String ATTR_FAILED = "failed"; + /** * {@value} */ String ATTR_SUCCEEDED = "succeeded"; - /** * Timeout time in millis. * {@value} @@ -117,7 +117,6 @@ */ TerminationRecord getStatus() throws RemoteException, SmartFrogException; - /** * return the current action * @return the child component. this will be null after termination. Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlockImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlockImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestBlockImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -64,6 +64,7 @@ * * @return true if we are finished */ + @Override public boolean isFinished() { return finished; } @@ -71,6 +72,7 @@ /** * @return true only if the test has finished and failed */ + @Override public boolean isFailed() { return failed; } @@ -78,7 +80,7 @@ /** * @return true iff the test succeeded */ - + @Override public boolean isSucceeded() { return succeeded; } @@ -88,6 +90,7 @@ * * @return the exit record, will be null for an unfinished child */ + @Override public TerminationRecord getStatus() { return status; } @@ -97,6 +100,7 @@ * * @return the child component. this will be null after termination. */ + @Override public Prim getAction() { return actionPrim; } @@ -106,6 +110,7 @@ * * @return false always */ + @Override public boolean isSkipped() { return false; } @@ -117,6 +122,7 @@ * @throws RemoteException In case of network/rmi error * @throws SmartFrogException In case of any error while deploying the component */ + @Override public synchronized void sfDeploy() throws SmartFrogException, RemoteException { super.sfDeploy(); description = sfResolve(ATTR_DESCRIPTION, description, false); @@ -134,6 +140,7 @@ * @throws SmartFrogException failed to start compound * @throws RemoteException In case of Remote/nework error */ + @Override public synchronized void sfStart() throws SmartFrogException, RemoteException { try { super.sfStart(); @@ -173,6 +180,7 @@ * * @param record exit status */ + @Override public void sfTerminateWith(TerminationRecord record) { sendEvent(new TerminatedEvent(this, record)); super.sfTerminateWith(record); @@ -239,6 +247,7 @@ * @throws SmartFrogRuntimeException for runtime exceptions * @throws RemoteException for network problems */ + @Override protected boolean onChildTerminated(TerminationRecord record, Prim comp) throws SmartFrogRuntimeException, RemoteException { if (comp == actionPrim) { Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestCompoundImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestCompoundImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestCompoundImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -235,19 +235,20 @@ final boolean isNormalTerminationExpected = TerminationRecord.NORMAL.equals(exitType); try { actionPrim = sfDeployComponentDescription(ACTION_RUNNING, - this, - (ComponentDescription) action.copy(), - new ContextImpl()); + this, + (ComponentDescription) action.copy(), + new ContextImpl()); // it is now a child, so need to guard against double calling of lifecycle... actionPrim.sfDeploy(); } catch (Throwable e) { thrown = e; sfLog().debug("Exception during deployment of the action", e); - } finally { - sendEvent(new TestStartedEvent(this)); } + //even if the action fails, the test started event is sent + sendEvent(new TestStartedEvent(this)); if (thrown == null) { + //nothing went wrong on startup assert actionPrim != null : "actionPrim is null, yet we did not catch an exception"; //a null exception meant the action was deployed successfully @@ -259,7 +260,7 @@ } } - //did we catch something during deployment? + //did we catch something during deployment or startup? if (thrown != null) { //get the message and check it against expections String message = thrown.getMessage(); @@ -274,9 +275,9 @@ noteStartupFailure(UNEXPECTED_STARTUP_EXCEPTION, thrown); //then throw an exception throw SmartFrogException.forward(UNEXPECTED_STARTUP_EXCEPTION - + EXPECTED_SUCCESSFUL_DEPLOYMENT - + message + "'\n", - thrown); + + EXPECTED_SUCCESSFUL_DEPLOYMENT + + message + "'\n", + thrown); } //here, an exception was expected. But was the failure we encountered the one expected? @@ -292,22 +293,22 @@ } if (wrongExitText) { recordText += EXPECTED_EXIT_TEXT + exitText + '\n' - + "But got: " + message + '\n'; + + "But got: " + message + '\n'; } else { recordText += "Exit message: \"" + message + "\"\n"; } noteStartupFailure(recordText, thrown); //then throw an exception throw SmartFrogException.forward(UNEXPECTED_STARTUP_EXCEPTION - + "expected: '" + exitText + "'\n" - + "found : '" + message + "'\n" - + (exceptionCheck != null ? exceptionCheck : ""), - thrown); + + "expected: '" + exitText + "'\n" + + "found : '" + message + "'\n" + + (exceptionCheck != null ? exceptionCheck : ""), + thrown); } else { //valid exit. Save the results TerminationRecord record; record = TerminationRecord.normal(EXIT_EXPECTED_STARTUP_EXCEPTION, - getName(), thrown); + getName(), thrown); noteEndOfTestRun(record, true); //and optionally end the component new ComponentHelper(this).sfSelfDetachAndOrTerminate(record); @@ -317,8 +318,8 @@ //the action is deployed //start the terminator actionTerminator = new DelayedTerminator(actionPrim, undeployAfter, sfLog(), - FORCED_TERMINATION + " after " + undeployAfter + " milliseconds", - !expectTerminate); + FORCED_TERMINATION + " after " + undeployAfter + " milliseconds", + !expectTerminate); actionTerminator.start(); //now deploy the tests. @@ -351,6 +352,7 @@ * @throws SmartFrogRuntimeException SmartFrog errors * @throws RemoteException network errors */ + @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) private void noteEndOfTestRun(TerminationRecord record, boolean success) throws SmartFrogRuntimeException, RemoteException { if (!success) { @@ -376,8 +378,10 @@ */ protected Prim deployComponentDescriptionThrowing(String childname, ComponentDescription desc) throws SmartFrogException, RemoteException { - Prim child = sfDeployComponentDescription(childname, this, - (ComponentDescription) desc.copy(), new ContextImpl()); + Prim child = sfDeployComponentDescription(childname, + this, + (ComponentDescription) desc.copy(), + new ContextImpl()); // it is now a child, so need to guard against double calling of lifecycle... child.sfDeploy(); return child; @@ -392,24 +396,24 @@ private synchronized void startTests() throws RemoteException, SmartFrogException { if (tests != null && testsPrim == null) { testsPrim = sfCreateNewChild(TESTS_RUNNING, - this, - (ComponentDescription) tests.copy(), - null); + this, + (ComponentDescription) tests.copy(), + null); // it is now a child, so need to guard against double calling of lifecycle... testsPrim.sfDeploy(); - - + + //the test terminator reports a termination as a failure testsTerminator = new DelayedTerminator(testsPrim, testTimeout, sfLog(), - FORCED_TERMINATION + " after " + testTimeout + " milliseconds", - false); + FORCED_TERMINATION + " after " + testTimeout + " milliseconds", + false); testsTerminator.start(); } } /** * Called by {@link #sfPing(Object)} to run through the list of children and ping each in turn. If any child fails, - * {@link #sfLivenessFailure(Object,Object,Throwable)} is called and the iteration continues. <p/> Override this + * {@link #sfLivenessFailure(Object, Object, Throwable)} is called and the iteration continues. <p/> Override this * method to implement different child ping behaviour. */ @Override @@ -508,6 +512,7 @@ * @param terminatingChild child component that is terminating * @return true if the termination event is to be forwarded up the chain. */ + @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) @Override protected boolean onChildTerminated(TerminationRecord childStatus, Prim terminatingChild) { boolean propagateTermination = shouldTerminate; @@ -522,13 +527,13 @@ actionTerminatorChild = actionTerminator; testsChild = testsPrim; } - + if (actionChild == terminatingChild) { actionTerminationRecord = childStatus; //child termination - if (actionTerminatorChild != null - && actionTerminatorChild.isForcedShutdown() - && !expectTerminate) { + if (actionTerminatorChild != null + && actionTerminatorChild.isForcedShutdown() + && !expectTerminate) { //this is a forced shutdown, all is well sfLog().info("Forced shutdown of action component (expected)"); testSucceeded = true; @@ -550,10 +555,10 @@ if (!childDescription.contains(exitText)) { exitTextMessage = TERMINATION_MESSAGE_MISMATCH + " -expected \"" - + exitText - + "\" but got \"" - + childDescription - + '\"'; + + exitText + + "\" but got \"" + + childDescription + + '\"'; sfLog().info(exitTextMessage); expected = false; } @@ -575,7 +580,7 @@ //the action prim terminated in a way that was not expected // String errorText = TEST_FAILED_WRONG_STATUS + exitType + - '\n'; + '\n'; if (exitText.length() > 0) { errorText += "and exit text '" + exitText + "'\n"; @@ -589,8 +594,8 @@ errorText += exitTextMessage; } exitRecord = TerminationRecord.abnormal(errorText, - childStatus.id, - childStatus.getCause()); + childStatus.id, + childStatus.getCause()); sfLog().error(errorText); sfLog().error(exitRecord); } else { @@ -608,8 +613,8 @@ //error is good, //The decision to terminate is based on the shouldTerminate flag sfLog().debug(propagateTermination ? - "Terminating normally" - : "Not terminating as sfShouldTerminate is false"); + "Terminating normally" + : "Not terminating as sfShouldTerminate is false"); } } @@ -623,7 +628,7 @@ (childStatus.description != null ? childStatus.description : "Action terminated normally which was not expected: " + childStatus) - + UNEXPECTED_TERMINATION, + + UNEXPECTED_TERMINATION, childStatus.id, childStatus.getCause()); } else { @@ -657,11 +662,11 @@ sfLog().warn(UNEXPECTED_CHILD_TERMINATION); exitRecord = childStatus; appendToDescription(exitRecord, UNEXPECTED_CHILD_TERMINATION - + " (" - + " testPrim = " + testsChild - + " actionPrim=" + actionChild - + " terminatingChild=" + terminatingChild - + ")"); + + " (" + + " testPrim = " + testsChild + + " actionPrim=" + actionChild + + " terminatingChild=" + terminatingChild + + ")"); testSucceeded = false; } } @@ -701,6 +706,7 @@ * @param record the termination record * @return any error string, or null for no errors */ + @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) protected String checkExceptionsWereExpected(TerminationRecord record) { return checkExceptionsWereExpected(record.getCause()); } @@ -756,6 +762,7 @@ * * @return true if the run is finished */ + @Override public boolean isFinished() { return finished; } @@ -763,6 +770,7 @@ /** * @return true only if the test has finished and failed */ + @Override public boolean isFailed() { return failed; } @@ -771,6 +779,7 @@ * @return true iff the test succeeded */ + @Override public boolean isSucceeded() { return succeeded; } @@ -781,6 +790,7 @@ * * @return the skipped state */ + @Override public boolean isSkipped() { return skipped; } @@ -792,6 +802,7 @@ */ + @Override public TerminationRecord getStatus() { return status; } @@ -801,6 +812,7 @@ * * @return the child component. this will be null after termination. */ + @Override public Prim getAction() { return actionPrim; } @@ -811,6 +823,7 @@ * * @return a termination record or null */ + @Override public TerminationRecord getActionTerminationRecord() { return actionTerminationRecord; } @@ -820,6 +833,7 @@ * * @return a termination record or null */ + @Override public TerminationRecord getTestsTerminationRecord() { return testsTerminationRecord; } @@ -829,6 +843,7 @@ * * @param status status record */ + @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) protected void setStatus(TerminationRecord status) { this.status = status; status.setCause(SmartFrogExtractedException.convert(status.getCause())); Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestFailureException.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestFailureException.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestFailureException.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -1,22 +1,22 @@ /** (C) Copyright 2007 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 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. + 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 + 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 + For more information: www.smartfrog.org -*/ + */ package org.smartfrog.services.assertions; import org.smartfrog.sfcore.common.SmartFrogException; @@ -38,11 +38,12 @@ * @param message any message * @param event this must not be null */ + @SuppressWarnings({"ThrowableResultOfMethodCallIgnored"}) public TestFailureException(String message, LifecycleEvent event) { - super(message+"\n"+event, - event.getCause(), - event.getComponent()); - this.event=event; + super(message + "\n" + event, + event.getCause(), + event.getComponent()); + this.event = event; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestTimeoutException.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestTimeoutException.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/TestTimeoutException.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -25,13 +25,14 @@ public class TestTimeoutException extends SmartFrogException { - long timeout; + public final long timeout; + public TestTimeoutException(String message) { - super(message); + this(message, 0); } public TestTimeoutException(String message, long timeout) { - super(message+"\n - time limit: "+timeout); - this.timeout=timeout; + super(message + "\n - time limit: " + timeout); + this.timeout = timeout; } } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestCompletedEvent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestCompletedEvent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestCompletedEvent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -76,6 +76,7 @@ /** * {@inheritDoc} */ + @Override public String getEventName() { return "TestCompletedEvent"; } @@ -87,6 +88,7 @@ /** * {@inheritDoc} */ + @Override public String toString() { StringBuilder buffer = new StringBuilder(super.toString()); if (description != null && description.length() > 0) { Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestEventSink.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestEventSink.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestEventSink.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -22,18 +22,17 @@ import org.smartfrog.services.assertions.TestFailureException; import org.smartfrog.services.assertions.TestTimeoutException; import org.smartfrog.sfcore.common.SmartFrogException; +import org.smartfrog.sfcore.common.SmartFrogLifecycleException; import org.smartfrog.sfcore.common.SmartFrogRuntimeException; -import org.smartfrog.sfcore.common.SmartFrogLifecycleException; -import org.smartfrog.sfcore.common.SmartFrogResolutionException; import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.prim.TerminationRecord; +import org.smartfrog.sfcore.reference.Reference; import org.smartfrog.sfcore.utils.SmartFrogThread; import org.smartfrog.sfcore.workflow.eventbus.EventRegistration; import org.smartfrog.sfcore.workflow.eventbus.EventSink; import org.smartfrog.sfcore.workflow.events.LifecycleEvent; import org.smartfrog.sfcore.workflow.events.StartedEvent; import org.smartfrog.sfcore.workflow.events.TerminatedEvent; -import org.smartfrog.sfcore.reference.Reference; import java.rmi.RemoteException; import java.rmi.server.RemoteStub; @@ -126,7 +125,7 @@ public TestEventSink(Prim application) throws RemoteException, SmartFrogRuntimeException { if (!(application instanceof EventRegistration)) { throw new SmartFrogRuntimeException(ERROR_WRONG_TYPE - + application.getClass(), application); + + application.getClass(), application); } subscribe((EventRegistration) application); } @@ -301,7 +300,7 @@ if (event == null) { return null; } - if(event instanceof TestInterruptedEvent) { + if (event instanceof TestInterruptedEvent) { throw new InterruptedException(); } isNotInstance = !clazz.isInstance(event); @@ -317,6 +316,7 @@ * @param event the received event * @throws RemoteException if the event is not a LifecyleEvent */ + @Override public void event(Object event) throws RemoteException { if (!(event instanceof LifecycleEvent)) { throw new RemoteException("Only instances of LifecycleEvent are supported"); @@ -378,7 +378,7 @@ invokeStart(); } catch (SmartFrogLifecycleException e) { Object termRec; - TerminationRecord status=null; + TerminationRecord status = null; try { termRec = app.sfResolveHere("sfTerminateWith", false); if (termRec != null && termRec instanceof TerminationRecord) { @@ -389,12 +389,12 @@ } catch (Exception e1) { status = TerminationRecord.abnormal("Failure during startup", appNameRef, e); } - TerminatedEvent te=new TerminatedEvent(app,status); - throw new TestFailureException(ERROR_PREMATURE_TERMINATION,te); + TerminatedEvent te = new TerminatedEvent(app, status); + throw new TestFailureException(ERROR_PREMATURE_TERMINATION, te); } catch (RemoteException e) { throw new TestFailureException(ERROR_PREMATURE_TERMINATION, - new TerminatedEvent(app, - TerminationRecord.abnormal("termination during startup", appNameRef, e))); + new TerminatedEvent(app, + TerminationRecord.abnormal("termination during startup", appNameRef, e))); } TimeoutTracker timedout = new TimeoutTracker(timeout); LifecycleEvent event; @@ -423,10 +423,10 @@ */ public LifecycleEvent runTestsToCompletion(long startupTimeout, long executeTimeout) throws SmartFrogException, InterruptedException, RemoteException { - if(getApplication().sfIsTerminated()) { + if (getApplication().sfIsTerminated()) { //we are (somehow) already terminated, so report this as a problem - LifecycleEvent termEvent=new TerminatedEvent(getApplication(), - TerminationRecord.abnormal("Test component has already terminated",getApplication().sfCompleteName())); + LifecycleEvent termEvent = new TerminatedEvent(getApplication(), + TerminationRecord.abnormal("Test component has already terminated", getApplication().sfCompleteName())); return termEvent; } try { @@ -435,7 +435,7 @@ //this is caused by a failure to start the application, which invariably triggers //termination of one kind or another LifecycleEvent termEvent = new TerminatedEvent(getApplication(), - TerminationRecord.abnormal("Test component terminated during startup", getApplication().sfCompleteName())); + TerminationRecord.abnormal("Test component terminated during startup", getApplication().sfCompleteName())); return termEvent; } catch (TestFailureException tfe) { //startup failed and was intercepted during startup @@ -449,7 +449,7 @@ throw new TestTimeoutException(ERROR_TEST_RUN_TIMEOUT + '\n' + dumpHistory(), executeTimeout); } } while (!(event instanceof TerminatedEvent) && !(event instanceof TestCompletedEvent) - && !timedout.isTimedOut()); + && !timedout.isTimedOut()); return event; } @@ -481,6 +481,7 @@ this.owner = owner; } + @Override public void run() { try { owner.unsubscribe(); Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestInterruptedEvent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestInterruptedEvent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestInterruptedEvent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -50,6 +50,7 @@ /** * {@inheritDoc} */ + @Override public String getEventName() { return "TestInterruptedEvent"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestStartedEvent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestStartedEvent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TestStartedEvent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -39,6 +39,7 @@ /** * {@inheritDoc} */ + @Override public String getEventName() { return "TestStartedEvent"; } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TimeoutTracker.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TimeoutTracker.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/events/TimeoutTracker.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -44,6 +44,6 @@ * @return true iff the current time is greater than th end time, */ public boolean isTimedOut() { - return delay>=0 && System.currentTimeMillis() > endtime; + return delay >= 0 && System.currentTimeMillis() > endtime; } } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/AbstractHistoryPrimImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/AbstractHistoryPrimImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/AbstractHistoryPrimImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -19,11 +19,11 @@ */ package org.smartfrog.services.assertions.history; +import org.smartfrog.services.assertions.SmartFrogAssertionException; import org.smartfrog.sfcore.common.SmartFrogResolutionException; import org.smartfrog.sfcore.prim.Prim; import org.smartfrog.sfcore.prim.PrimImpl; import org.smartfrog.sfcore.utils.ComponentHelper; -import org.smartfrog.services.assertions.SmartFrogAssertionException; import java.rmi.RemoteException; @@ -32,7 +32,7 @@ public abstract class AbstractHistoryPrimImpl extends PrimImpl { public static final String ATTR_HISTORY = "history"; - + protected AbstractHistoryPrimImpl() throws RemoteException { } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryAssertOrderedMessages.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryAssertOrderedMessages.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryAssertOrderedMessages.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -55,7 +55,7 @@ String message1 = sfResolve(ATTR_MESSAGE1, "", true); String message2 = sfResolve(ATTR_MESSAGE2, "", true); History history = resolveHistory(); - history.assertEventsOrdered(message1,message2); + history.assertEventsOrdered(message1, message2); queueForTermination("HistoryAssertOrderedMessages"); } } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryEvent.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryEvent.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryEvent.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -22,7 +22,7 @@ import java.io.Serializable; /** - * This is an event that we log + * This is an event that we log */ public class HistoryEvent implements Serializable { @@ -45,7 +45,7 @@ * @return a useful string value */ public String toString() { - return '['+index+"] [ "+Long.toString(timestamp)+"] "+message; + return '[' + index + "] [ " + Long.toString(timestamp) + "] " + message; } } Modified: trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryImpl.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryImpl.java 2011-04-03 22:16:08 UTC (rev 8558) +++ trunk/core/smartfrog/src/org/smartfrog/services/assertions/history/HistoryImpl.java 2011-04-03 22:22:13 UTC (rev 8559) @@ -24,14 +24,13 @@ import java.rmi.RemoteException; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; /** created 09-Jul-2007 12:11:03 */ public class HistoryImpl extends PrimImpl implements History { - private List<HistoryEvent> events=new ArrayList<HistoryEvent>(); + private List<HistoryEvent> events = new ArrayList<HistoryEvent>(); public HistoryImpl() throws RemoteException { } @@ -41,13 +40,14 @@ * @param event a new event to add * @return the index value of the event */ + @Override public synchronized int addEvent(HistoryEvent event) throws SmartFrogAssertionException { - if(event.message==null) { + if (event.message == null) { throw new SmartFrogAssertionException("No null messages are allowed"); } events.add(event); int index =... [truncated message content] |