com.pushtotest.testmaker.XSTest.xml.TestScenario
Class ScriptRunner

java.lang.Object
  extended by java.lang.Thread
      extended by com.pushtotest.testmaker.XSTest.xml.TestScenario.ScriptRunner
All Implemented Interfaces:
java.lang.Runnable

public class ScriptRunner
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int colddowntime
          miliseconds of coldowntime
 int CVUS
           
 boolean mustLog
           
 java.lang.String name
          Indicate the name of the machine
 boolean recordTest
           
 boolean stop
          Indicates that this thread must not continue doing the sequence and die
 long testMilliseconds
          idicate test time in milliseconfs
 long timeBetweenTransaction
          miliseconds between transaction
 long timeBetweeTest
          Indicate miliseconds bewten the test
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ScriptRunner(XMLReader reader, int sequenceNumber, SequenceT seq, int myThreadIndex, TestusecaseRunner father, java.lang.ClassLoader loader, java.util.Vector<java.lang.String> soapui, java.util.Vector<java.lang.String> tg4w)
           
 
Method Summary
 java.lang.Object[] argumentsFromCall(CallT call)
           
static java.lang.Object[] argumentsFromCallJava(java.lang.ClassLoader Loader, CallT call, java.util.HashMap dpls, int amz)
           
 java.lang.Object[] argumentsFromCallScript(CallT call, java.util.HashMap dpls, int amz)
           
 java.lang.Object[] argumentsFromCallSoapui(CallT call)
           
static java.lang.Object[] argumentsFromCallSoapui(CallT call, java.util.Vector<java.lang.String> soapuiFiles)
           
 java.lang.Object[] argumentsFromCallTestGen(CallT call)
           
static void call(java.lang.ClassLoader Loader, CallT call, java.util.HashMap dpls, int amz)
          This methods calls the method especified in call
static java.lang.Object[] castArgument(java.util.HashMap dpls, java.lang.reflect.Method m, java.lang.Class[] parameters, java.util.Vector<ArgumentT> arguments, int amz)
          Make all the cast arguments need the DPL hashmap, the method the class types the arguments and the actual message size
 boolean completeRecording()
           
static java.lang.Object execute(java.lang.reflect.Method theMeth, java.lang.Object theObj, java.lang.Object[] theArgs, long timeOut)
           
 boolean finished()
           
 java.lang.ClassLoader getLoader()
           
static boolean isInstance(java.lang.Object obj, java.lang.Class[] classes)
           
static void javaCall(java.lang.ClassLoader Loader, CallT call, java.util.HashMap dpls, int amz)
          A call in java
static void jythonCall(CallT call)
          A call in Jython
 boolean log(java.lang.String message)
          Try to log a transaction and return if it actually log it
 java.lang.reflect.Method methodFromCall(CallT call)
          Central method to dispatch all types of unit tests
 java.lang.reflect.Method methodFromCallJava(CallT call)
          Operate a test by instantiating a Java class and calling the defined method
 java.lang.reflect.Method methodFromCallScript(CallT call)
          Operates a unit test using the Java Script Engine, including Jython, Groovy, JRuby, Rhino, etc.
 java.lang.reflect.Method methodFromCallSoapui(CallT call)
          Operate a Eviware soapUI Test Suite
 java.lang.reflect.Method methodFromCallTestGen(CallT call)
          Operate a TestGen4Web unit test using the html-interpreter in TestGen4Web
 java.lang.Object objectFromCall(CallT call, java.util.Vector<CallT> calls, java.util.Vector<java.lang.Object> objects)
           
 java.lang.Object objectFromCallJava(CallT call)
           
 java.lang.Object objectFromCallScript(CallT call)
           
 void run()
          main cycle of the thread for making the test.
static void runCall(SimpleLogger logger, java.lang.ClassLoader loader, CallT call, java.util.HashMap dpls, int ms, java.lang.Class[] exe, GSRSCreator creator)
          Run the call, throw the exception if the exe had the exception value others exceptions are ignored
 void runJustOne()
           
 boolean runJustOne(java.lang.Class[] exceptions, GSRSCreator creator)
          The node will run the test until a exception is throw true fine false erros
static void runSOAPUI(com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase testcase)
          The actual method to operate a soapUI test using its provided TestRunner
 void setLoader(java.lang.ClassLoader l)
           
 void sleepBetweenTest()
           
static void soapuiCall(CallT call)
           
 int testFailed()
          The number of test failed
static void testGenCall(CallT call)
           
 int testsDone()
          Number of test succesfully done
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mustLog

public boolean mustLog

CVUS

public int CVUS

recordTest

public boolean recordTest

name

public java.lang.String name
Indicate the name of the machine


stop

public boolean stop
Indicates that this thread must not continue doing the sequence and die


testMilliseconds

public long testMilliseconds
idicate test time in milliseconfs


timeBetweeTest

public long timeBetweeTest
Indicate miliseconds bewten the test


timeBetweenTransaction

public long timeBetweenTransaction
miliseconds between transaction


colddowntime

public int colddowntime
miliseconds of coldowntime

Constructor Detail

ScriptRunner

public ScriptRunner(XMLReader reader,
                    int sequenceNumber,
                    SequenceT seq,
                    int myThreadIndex,
                    TestusecaseRunner father,
                    java.lang.ClassLoader loader,
                    java.util.Vector<java.lang.String> soapui,
                    java.util.Vector<java.lang.String> tg4w)
Method Detail

setLoader

public void setLoader(java.lang.ClassLoader l)

getLoader

public java.lang.ClassLoader getLoader()

methodFromCall

public java.lang.reflect.Method methodFromCall(CallT call)
Central method to dispatch all types of unit tests


methodFromCallScript

public java.lang.reflect.Method methodFromCallScript(CallT call)
Operates a unit test using the Java Script Engine, including Jython, Groovy, JRuby, Rhino, etc.


methodFromCallTestGen

public java.lang.reflect.Method methodFromCallTestGen(CallT call)
Operate a TestGen4Web unit test using the html-interpreter in TestGen4Web


methodFromCallSoapui

public java.lang.reflect.Method methodFromCallSoapui(CallT call)
Operate a Eviware soapUI Test Suite


runSOAPUI

public static void runSOAPUI(com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase testcase)
                      throws java.lang.Exception
The actual method to operate a soapUI test using its provided TestRunner

Throws:
java.lang.Exception

argumentsFromCallSoapui

public java.lang.Object[] argumentsFromCallSoapui(CallT call)

argumentsFromCallSoapui

public static java.lang.Object[] argumentsFromCallSoapui(CallT call,
                                                         java.util.Vector<java.lang.String> soapuiFiles)

methodFromCallJava

public java.lang.reflect.Method methodFromCallJava(CallT call)
Operate a test by instantiating a Java class and calling the defined method


objectFromCall

public java.lang.Object objectFromCall(CallT call,
                                       java.util.Vector<CallT> calls,
                                       java.util.Vector<java.lang.Object> objects)

objectFromCallJava

public java.lang.Object objectFromCallJava(CallT call)

objectFromCallScript

public java.lang.Object objectFromCallScript(CallT call)

argumentsFromCall

public java.lang.Object[] argumentsFromCall(CallT call)

argumentsFromCallScript

public java.lang.Object[] argumentsFromCallScript(CallT call,
                                                  java.util.HashMap dpls,
                                                  int amz)

argumentsFromCallTestGen

public java.lang.Object[] argumentsFromCallTestGen(CallT call)

argumentsFromCallJava

public static java.lang.Object[] argumentsFromCallJava(java.lang.ClassLoader Loader,
                                                       CallT call,
                                                       java.util.HashMap dpls,
                                                       int amz)

run

public void run()
main cycle of the thread for making the test. Follows the next sequence: setup(); //setup of the usecase if exists while (!stop) test(); teardown(); // tear down of the usecase if exist Not completely implemented

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

runJustOne

public boolean runJustOne(java.lang.Class[] exceptions,
                          GSRSCreator creator)
                   throws java.lang.Exception
The node will run the test until a exception is throw true fine false erros

Throws:
java.lang.Exception

runJustOne

public void runJustOne()
                throws java.lang.Exception
Throws:
java.lang.Exception

isInstance

public static boolean isInstance(java.lang.Object obj,
                                 java.lang.Class[] classes)

runCall

public static void runCall(SimpleLogger logger,
                           java.lang.ClassLoader loader,
                           CallT call,
                           java.util.HashMap dpls,
                           int ms,
                           java.lang.Class[] exe,
                           GSRSCreator creator)
                    throws java.lang.Exception
Run the call, throw the exception if the exe had the exception value others exceptions are ignored

Throws:
java.lang.Exception

sleepBetweenTest

public void sleepBetweenTest()

testsDone

public int testsDone()
Number of test succesfully done


testFailed

public int testFailed()
The number of test failed


finished

public boolean finished()

call

public static void call(java.lang.ClassLoader Loader,
                        CallT call,
                        java.util.HashMap dpls,
                        int amz)
                 throws java.lang.Exception
This methods calls the method especified in call

Throws:
java.lang.Exception

javaCall

public static void javaCall(java.lang.ClassLoader Loader,
                            CallT call,
                            java.util.HashMap dpls,
                            int amz)
                     throws java.lang.Exception
A call in java

Throws:
java.lang.Exception

castArgument

public static java.lang.Object[] castArgument(java.util.HashMap dpls,
                                              java.lang.reflect.Method m,
                                              java.lang.Class[] parameters,
                                              java.util.Vector<ArgumentT> arguments,
                                              int amz)
Make all the cast arguments need the DPL hashmap, the method the class types the arguments and the actual message size


execute

public static java.lang.Object execute(java.lang.reflect.Method theMeth,
                                       java.lang.Object theObj,
                                       java.lang.Object[] theArgs,
                                       long timeOut)
                                throws java.lang.Exception
Throws:
java.lang.Exception

jythonCall

public static void jythonCall(CallT call)
A call in Jython


soapuiCall

public static void soapuiCall(CallT call)

testGenCall

public static void testGenCall(CallT call)

log

public boolean log(java.lang.String message)
Try to log a transaction and return if it actually log it


completeRecording

public boolean completeRecording()