Topic
  • 13 replies
  • Latest Post - ‏2016-02-12T12:28:32Z by LanceZulu
plkarthiknet
plkarthiknet
1 Post

Pinned topic Using Ant scripts from Rational Integration tester in Bamboo

‏2013-08-30T00:54:48Z |

Have someone tried running a greenhat test using ant script from a third party tool like bamboo ? How did you achieve that?

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2013-08-30T08:34:48Z  

    Not had experience of Bamboo but people generally use Ant to run tests in Continuous Integration systems.  If you have the RTCP server set-up, the results URL output at the end of a test run will take you to an HTML view the results.

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-01-19T07:14:16Z  

    Not had experience of Bamboo but people generally use Ant to run tests in Continuous Integration systems.  If you have the RTCP server set-up, the results URL output at the end of a test run will take you to an HTML view the results.

    Hi Steve,

    We use Bamboo as the orchestration toolfor CI.

    Also we work in SOA (Service oriented Architecture) project so,we use Rational Integration Tester for all tests.

    How do you say i should configure Bamboo or RIT or RTCP (Rational Test Control Panel) to pick those tests and automate testing and also help to view the results in the Bamboo Job window.

    Any help in this regard woudl be greatly appreciated.

    Looking forward to your response :)

     

    Thanks,

    Ashley

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-01-21T09:32:35Z  

    Hi Steve,

    We use Bamboo as the orchestration toolfor CI.

    Also we work in SOA (Service oriented Architecture) project so,we use Rational Integration Tester for all tests.

    How do you say i should configure Bamboo or RIT or RTCP (Rational Test Control Panel) to pick those tests and automate testing and also help to view the results in the Bamboo Job window.

    Any help in this regard woudl be greatly appreciated.

    Looking forward to your response :)

     

    Thanks,

    Ashley

    As stated in my earlier reply I have no experience of Bamboo but if you can work out how to execute an Ant task the rest is easy...

    This section of the RIT docs talks about the Ant task: Run tests by using an Ant task

    You need to have RIT installed on the machine that runs the Ant tasks.

    So you would add tests to your Ant script or go with one large suite.
    If you use a suite and have a results database configured, you will see a URL output to take you to view the results via RTCP.
    There is a specific plug-in for Jenkins to follow the URL and automatically add the results into the same browser window as the Jenkins output.  There is not one for Bamboo.

    The RTCP configuration is fairly simple, it needs to have the results database added.  You can do this from RIT Project Settings:

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-04T08:30:39Z  

    As stated in my earlier reply I have no experience of Bamboo but if you can work out how to execute an Ant task the rest is easy...

    This section of the RIT docs talks about the Ant task: Run tests by using an Ant task

    You need to have RIT installed on the machine that runs the Ant tasks.

    So you would add tests to your Ant script or go with one large suite.
    If you use a suite and have a results database configured, you will see a URL output to take you to view the results via RTCP.
    There is a specific plug-in for Jenkins to follow the URL and automatically add the results into the same browser window as the Jenkins output.  There is not one for Bamboo.

    The RTCP configuration is fairly simple, it needs to have the results database added.  You can do this from RIT Project Settings:

    Hi Steve,

    ​I really appreciate your prompt response.
    ​I have already implemented the part answered above.
    ​All i now need to know is how to create a windows command line script that determines which stubs in RTCP  pertaining to a specific domain and environment are in stopped state for whatever reason, and then automatically start them.
    ​i have the script to start stubs using command line but that just determines the stubs of particular domain or environment that i have mentioned,have nothing to do with state of stubs.
    ​could you please help me to implement one such script that can help determine state of stubs as in RTCP.
    ​Using the url  below:-
    ​https://www-01.ibm.com/support/knowledgecenter/SSBLQQ_8.7.0/com.ibm.rational.rit.ref.doc/topics/c_rtvs_start_stub_cmd_line.html​

    ​i can invoke script task in bamboo to automate start of stubs and that works fine.
    ​Now need to just add a part in script that helps determine the state of the stubs and then start them if they are in stopped state.
    ​Any help in this regard would be greatly appreciated.

    ​Thanks,
    ​Ashley

     

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-07T19:52:37Z  

    Hi Steve,

    ​I really appreciate your prompt response.
    ​I have already implemented the part answered above.
    ​All i now need to know is how to create a windows command line script that determines which stubs in RTCP  pertaining to a specific domain and environment are in stopped state for whatever reason, and then automatically start them.
    ​i have the script to start stubs using command line but that just determines the stubs of particular domain or environment that i have mentioned,have nothing to do with state of stubs.
    ​could you please help me to implement one such script that can help determine state of stubs as in RTCP.
    ​Using the url  below:-
    ​https://www-01.ibm.com/support/knowledgecenter/SSBLQQ_8.7.0/com.ibm.rational.rit.ref.doc/topics/c_rtvs_start_stub_cmd_line.html​

    ​i can invoke script task in bamboo to automate start of stubs and that works fine.
    ​Now need to just add a part in script that helps determine the state of the stubs and then start them if they are in stopped state.
    ​Any help in this regard would be greatly appreciated.

    ​Thanks,
    ​Ashley

     

    There is no command-line interface to check the status of stubs.

    This technote gives guidance on doing it in an RIT project using the REST API:

    Obtaining running status of stubs

    A variation could be run on the command line to query and start stubs.

    The best solution is to start the stubs required and save as a Scenario in RTCP.  Start the scenario using the REST API to ensure all stubs are started.

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-10T10:16:51Z  

    There is no command-line interface to check the status of stubs.

    This technote gives guidance on doing it in an RIT project using the REST API:

    Obtaining running status of stubs

    A variation could be run on the command line to query and start stubs.

    The best solution is to start the stubs required and save as a Scenario in RTCP.  Start the scenario using the REST API to ensure all stubs are started.

    Hi Steve,

     

    Thanks for the prompt response.

    I'm now just trying to start stubs using ant tasks in bamboo.

    I have the build.xml file that defines the ant target to be run in bamboo.

    
    <taskdef name="startStub" classname="com.ghc.ghTester.ant.StartStub" classpathref="tasklib" />
    
    <startStub domain="<
    Domain name>" environment="<
    Environment name>" component="<
    Component name>" operation="<
    Operation name>" name="<
    Stub name>" version="<
    Stub version number>" serverUrl="http://<
    Host name or IP address>:7819/RTCP/"/>
    

     

    I execute the above by defining my own classpath (git repository has a .ant folder that contains the RTCPAnt Client jars,files).

    For some reason bamboo build fails with an error :- unable to run StartStub. It seems 

    
    classname="com.ghc.ghTester.ant.StartStub is not being fetched or something. i'm no java expert, so i would not know why?
    

    Could you please help me with this.

     

    Thanks,

    Ashley

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-10T12:02:31Z  

    Hi Steve,

     

    Thanks for the prompt response.

    I'm now just trying to start stubs using ant tasks in bamboo.

    I have the build.xml file that defines the ant target to be run in bamboo.

    <pre class="pre codeblock" dir="ltr" style="font-family: 'Courier New', Courier, monospace, monospace; font-size: 12.8px; padding: 16px; border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; color: rgb(0, 0, 0); line-height: 16.64px; background-color: rgb(238, 238, 238);"> <taskdef name="startStub" classname="com.ghc.ghTester.ant.StartStub" classpathref="tasklib" /> <startStub domain="< Domain name>" environment="< Environment name>" component="< Component name>" operation="< Operation name>" name="< Stub name>" version="< Stub version number>" serverUrl="http://< Host name or IP address>:7819/RTCP/"/> </pre>

     

    I execute the above by defining my own classpath (git repository has a .ant folder that contains the RTCPAnt Client jars,files).

    For some reason bamboo build fails with an error :- unable to run StartStub. It seems 

    <pre class="pre codeblock" dir="ltr" style="font-family: 'Courier New', Courier, monospace, monospace; font-size: 12.8px; padding: 16px; border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; color: rgb(0, 0, 0); line-height: 16.64px; background-color: rgb(238, 238, 238);"> classname="com.ghc.ghTester.ant.StartStub is not being fetched or something. i'm no java expert, so i would not know why? </pre>

    Could you please help me with this.

     

    Thanks,

    Ashley

    Ashley,

    Running Ant with -d or -debug often helps in these cases.

    In theory setting the CLASSPATH to include the JARs should work.  I wonder if including the classpathref="tasklib" entry is telling Ant to ignore the CLASSPATH.  Try removing this?

    If you look at the sample that IBM supplies - start-stop-stub.xml - you see that tasklib is built up using the fileset directive.

    Steve

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-10T15:37:17Z  

    Ashley,

    Running Ant with -d or -debug often helps in these cases.

    In theory setting the CLASSPATH to include the JARs should work.  I wonder if including the classpathref="tasklib" entry is telling Ant to ignore the CLASSPATH.  Try removing this?

    If you look at the sample that IBM supplies - start-stop-stub.xml - you see that tasklib is built up using the fileset directive.

    Steve

    Hi Steve,

     

    Thanks for the prompt response. The error i get in bamboo is:-

    An error occurred while running StartStub

    at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:152)

    at com.ghc.ghTester.ant.StartStub.execute(StartStub.java:72)

    ................................................................

    ........................................

    .

    .

    Caused by java.lang.NullPointerException

    at

    com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:136)

    This is the error i get. 

    The classpath i have referenced here is:-

    to point to complete RTCP AntClient Package. Using same classpath i'm successfully able to run testsuite, but not able to start stub. Atleast i see here that 

    
    com.ghc.ghTester.ant.StartStub is being found in the classpath i give by bamboo, but the same is not being able to run
    

     

    Could you please help me here.

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-10T16:09:51Z  

    Hi Steve,

     

    Thanks for the prompt response. The error i get in bamboo is:-

    An error occurred while running StartStub

    at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:152)

    at com.ghc.ghTester.ant.StartStub.execute(StartStub.java:72)

    ................................................................

    ........................................

    .

    .

    Caused by java.lang.NullPointerException

    at

    com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:136)

    This is the error i get. 

    The classpath i have referenced here is:-

    to point to complete RTCP AntClient Package. Using same classpath i'm successfully able to run testsuite, but not able to start stub. Atleast i see here that 

    <pre class="pre codeblock" dir="ltr" style="font-family: 'Courier New', Courier, monospace, monospace; font-size: 12.8px; padding: 16px; border: 1px solid rgb(204, 204, 204); white-space: pre-wrap; color: rgb(0, 0, 0); line-height: 16.64px; background-color: rgb(238, 238, 238);"> com.ghc.ghTester.ant.StartStub is being found in the classpath i give by bamboo, but the same is not being able to run </pre>

     

    Could you please help me here.

    I would suggest you verify the setup by running the sample Ant script start-stop-stub.xml that is supplied, but modified to use your parameters.  Perhaps there is something missing to cause the exception.

    Starting a RIT test suite uses a completely different set of JARs so I'm not sure what that is telling us.

    As mentioned, I have no knowledge of Bamboo I'm afraid.

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-10T16:17:41Z  

    I would suggest you verify the setup by running the sample Ant script start-stop-stub.xml that is supplied, but modified to use your parameters.  Perhaps there is something missing to cause the exception.

    Starting a RIT test suite uses a completely different set of JARs so I'm not sure what that is telling us.

    As mentioned, I have no knowledge of Bamboo I'm afraid.

    Hi Steve,

     

    Ok i agree with you.

    Its not about bamboo.

    But yeah if you could point me to the fileset directory for classpath that should help.

    I have tried with RIT installation directory, RTCPANT Client directory and both places included "*.jar" to pick up any jarfile found at these places. But as mentioned above though the class is found its not being run, may be due to some other missing jars/files.

    What do you suggest should be my fileset directory, should it be ../IBM/IBMIMShared/plugins   (This one as of now isn't available with us, but i see that it has complete set of jars and other files.

    Any help in this regard would be greatly appreciated

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-11T17:51:23Z  

    Hi Steve,

     

    Ok i agree with you.

    Its not about bamboo.

    But yeah if you could point me to the fileset directory for classpath that should help.

    I have tried with RIT installation directory, RTCPANT Client directory and both places included "*.jar" to pick up any jarfile found at these places. But as mentioned above though the class is found its not being run, may be due to some other missing jars/files.

    What do you suggest should be my fileset directory, should it be ../IBM/IBMIMShared/plugins   (This one as of now isn't available with us, but i see that it has complete set of jars and other files.

    Any help in this regard would be greatly appreciated

    To be exact the error is:-

    An error occurred while running StartStub
            at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:152)
            at com.ghc.ghTester.ant.StartStub.execute(StartStub.java:72)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:435)
            at org.apache.tools.ant.Target.performTasks(Target.java:456)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
            at org.apache.tools.ant.Main.runBuild(Main.java:853)
            at org.apache.tools.ant.Main.startAnt(Main.java:235)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
    Caused by: java.lang.NullPointerException
            at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:136)
            ... 18 more

    I'm not sure what is causing this error, because i'm pretty sure the script is alright.

    All that i suspect here is could be particular jars/files missing under classpath directory.

    So if you could just help me here i would be really grateful.

  • Steve Bachini
    Steve Bachini
    14 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-12T11:11:14Z  

    To be exact the error is:-

    An error occurred while running StartStub
            at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:152)
            at com.ghc.ghTester.ant.StartStub.execute(StartStub.java:72)
            at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
            at org.apache.tools.ant.Task.perform(Task.java:348)
            at org.apache.tools.ant.Target.execute(Target.java:435)
            at org.apache.tools.ant.Target.performTasks(Target.java:456)
            at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
            at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
            at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
            at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
            at org.apache.tools.ant.Main.runBuild(Main.java:853)
            at org.apache.tools.ant.Main.startAnt(Main.java:235)
            at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
            at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
    Caused by: java.lang.NullPointerException
            at com.ghc.ghTester.ant.StartStub.startStub(StartStub.java:136)
            ... 18 more

    I'm not sure what is causing this error, because i'm pretty sure the script is alright.

    All that i suspect here is could be particular jars/files missing under classpath directory.

    So if you could just help me here i would be really grateful.

    Difficult to diagnose on a forum.

    I would expect class not found errors if JARs cannot be located.
    This error seems to be most relevant: "org.apache.tools.ant.UnknownElement.execute"

    As previously mentioned, try it with the debug option - this will confirm the JARs being read and might give other useful info.

    If you are confident that all of the parameters are correct, because they work in the start-stop-stub.xml script you can try logging a PMR.
    Please bear in mind that this is integration with a 3rd-party tool so IBM Support assistance might be limited.

  • LanceZulu
    LanceZulu
    7 Posts

    Re: Using Ant scripts from Rational Integration tester in Bamboo

    ‏2016-02-12T12:28:32Z  

    Difficult to diagnose on a forum.

    I would expect class not found errors if JARs cannot be located.
    This error seems to be most relevant: "org.apache.tools.ant.UnknownElement.execute"

    As previously mentioned, try it with the debug option - this will confirm the JARs being read and might give other useful info.

    If you are confident that all of the parameters are correct, because they work in the start-stop-stub.xml script you can try logging a PMR.
    Please bear in mind that this is integration with a 3rd-party tool so IBM Support assistance might be limited.

    Hi Steve,

     

    Thanks for  the response.

    As mentioned earlier, i'm just trying to execute an ant script using any ant supported tool here bamboo. Even using ant tool i get same error. I have always used the debug argument hence the detailed error i posted above.

    It seems there could be some issue with the jar that is being referenced under the classpath for StartStub class (com.ghc.ghTester.ant.StartStub) because whatever it is bamboo or ant tool , they are able to load this class from the specified jar (com.ghc.ghTester.ant_1.870.0.v20150202_1637.jar) but not able to run it. In the process generates NPE error.

    Since i don't know much about java so i wonder if i'm using the correct jars/files. If not then which jars/files should i use because all that i use are provided by RTCP Ant Client Package itself.

    The same task runs absolutely fine in bamboo using command line script because there i use GHTesterCmd and specify the directory path as RIT installation directory since i know GHTesterCmd application lies there.

     

    So i still wonder about the NPE error.

     

    Any help/suggestions here would be greatly appreciated.