Functional testing with TestNG using JBoss

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Functional testing with TestNG using JBoss

tarun3kumar

We are using JBoss 4.0.3SP1. Our application posts JMS Messages and uses MDB to parse the messages and do required functionality. Entire application completely depends on JMS, MDB and datasource. Application is bundled in Ear file. Ear file in turn consists of jar and war file.

We would like to use TestNG for functional testing(end-to-end) of our application. Please note we are not interested in doing unit testing MDB, JMS codes, We require only end to end testing.
1. Is it possible to use testNG for testing application running within application server container.
2. If yes for point 1, please provide us info or any reference on how to do this.
3. If No for point 1, Is it possible to do anything on the JBoss side to implement automated testing which uses the container services.
4. How do we achieve the automated testing in JBoss using testnG, where the application is tightly bound to container services(JMS, MDB, Datasource).

We tried the following

1. Wrote servlet and tried to call testNG programatically, program given below. Though testnG runs it does not run the test class TestHarness.

         TestNG testng = new TestNG();
        Class c1=com.example.TestHarness.class;
        Class[] cArr= new Class[1];
        cArr[0]=c1;
        testng.setTestClasses(cArr);
          TestListenerAdapter tla = new TestListenerAdapter();
        testng.addListener(tla);        
        testng.run();

Output in server console is as given below. The testNG report in output folder also displays  Total tests run as 0.

2007-04-18 15:42:23,159 INFO  [STDOUT] Calling testNG from servlet test class
2007-04-18 15:42:23,160 INFO  [STDOUT] [Parser] Running:
  Command line suite
2007-04-18 15:42:23,169 INFO  [STDOUT]
===============================================
Command line suite
Total tests run: 0, Failures: 0, Skips: 0
===============================================
2007-04-18 15:42:23,175 INFO  [STDOUT] Out of servlet test class

We had posted in forums also, which did not help much.
Please help us in understanding the problem. Please suggest with examples/references for us to proceed.

Very urgent.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142844#142844


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

tarun3kumar

As per Alex,to get the TestNG logs we added

testng.setVerbose(3);

The output after adding the above is given in attached Log File.txt

Still we are facing the same problem.
The Test Class TestHarness.java is attached.

As per the log we see
[STDOUT] [TestNGClassFinder] SKIPPING CLASS class com.sonata.testharness.TestHarness no TestNG annotations found

Why it is unable to find out TestNG annotations?

 Attached below is:
 - Log file.txt
 - TestHarness.java

 Outside the container, sample on programatic invocation to run TestNG works fine.

Is our approach correct - Deploying TestNG files with our application EAR
& programatically invoking TestNG from a servlet in EAR?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142845#142845


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

tarun3kumar
In reply to this post by tarun3kumar
I missed to attach the files in previous post.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142846#142846

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Command line suite
2007-04-18 17:43:22,240 INFO  [STDOUT] [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@6f403e priority: 10
2007-04-18 17:43:22,255 INFO  [STDOUT] [TestNGClassFinder] SKIPPING CLASS class com.sonata.testharness.TestHarness no TestNG annotations found
2007-04-18 17:43:22,283 INFO  [STDOUT] [SuiteRunner] Created 1 TestRunners
2007-04-18 17:43:22,283 INFO  [STDOUT] [TestRunner] Running test Command line test on 0  classes,  included groups:[] excluded groups:[]
2007-04-18 17:43:22,293 INFO  [STDOUT] [TestRunner] WILL BE RUN IN RANDOM ORDER:
2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] WILL BE RUN SEQUENTIALLY:
2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] ===
2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] Found 0 applicable methods
2007-04-18 17:43:22,296 INFO  [STDOUT]
*********** INVOKED METHODS
2007-04-18 17:43:22,296 INFO  [STDOUT]
***********
2007-04-18 17:43:22,299 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.html
2007-04-18 17:43:22,308 INFO  [STDOUT]
===============================================
    Command line test
    Tests run: 0, Failures: 0, Skips: 0
===============================================
2007-04-18 17:43:22,312 INFO  [STDOUT]
===============================================
Command line suite
Total tests run: 0, Failures: 0, Skips: 0
===============================================
2007-04-18 17:43:22,314 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/toc.html
2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.properties
2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/index.html
2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/main.html
2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/groups.html
2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods.html
2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-alphabetical.html
2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/classes.html
2007-04-18 17:43:22,321 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/reporter-output.html
2007-04-18 17:43:22,322 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-not-run.html
2007-04-18 17:43:22,330 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/testng.xml.html
2007-04-18 17:43:22,331 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/index.html

TestHarness.java (886 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Cédric Beust ♔

Amit,

What happens when you try to run your test class directly through
TestNG (as opposed to using the programmatic API, as you are currently
doing):

java org.testng.TestNG com.sonata.TestHarness

?

--
Cedric


On 4/18/07, amits <[hidden email]> wrote:

> I missed to attach the files in previous post.
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142846#142846
>
> >
>
> Command line suite
> 2007-04-18 17:43:22,240 INFO  [STDOUT] [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@6f403e priority: 10
> 2007-04-18 17:43:22,255 INFO  [STDOUT] [TestNGClassFinder] SKIPPING CLASS class com.sonata.testharness.TestHarness no TestNG annotations found
> 2007-04-18 17:43:22,283 INFO  [STDOUT] [SuiteRunner] Created 1 TestRunners
> 2007-04-18 17:43:22,283 INFO  [STDOUT] [TestRunner] Running test Command line test on 0  classes,  included groups:[] excluded groups:[]
> 2007-04-18 17:43:22,293 INFO  [STDOUT] [TestRunner] WILL BE RUN IN RANDOM ORDER:
> 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] WILL BE RUN SEQUENTIALLY:
> 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] ===
> 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] Found 0 applicable methods
> 2007-04-18 17:43:22,296 INFO  [STDOUT]
> *********** INVOKED METHODS
> 2007-04-18 17:43:22,296 INFO  [STDOUT]
> ***********
> 2007-04-18 17:43:22,299 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.html
> 2007-04-18 17:43:22,308 INFO  [STDOUT]
> ===============================================
>     Command line test
>     Tests run: 0, Failures: 0, Skips: 0
> ===============================================
> 2007-04-18 17:43:22,312 INFO  [STDOUT]
> ===============================================
> Command line suite
> Total tests run: 0, Failures: 0, Skips: 0
> ===============================================
> 2007-04-18 17:43:22,314 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/toc.html
> 2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.properties
> 2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/index.html
> 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/main.html
> 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/groups.html
> 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods.html
> 2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-alphabetical.html
> 2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/classes.html
> 2007-04-18 17:43:22,321 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/reporter-output.html
> 2007-04-18 17:43:22,322 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-not-run.html
> 2007-04-18 17:43:22,330 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/testng.xml.html
> 2007-04-18 17:43:22,331 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/index.html
>
>


--
Cédric

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Alexandru Popescu ☀
Amit can you send me the TestHarness.class extracted from the ear? I
just want to be 100% sure it is having the annotations. Also, in the
source of your servlet, I hope you are not having any kind of empty
catch around the TestNG code (if there is an exception let's see it).

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator


On 4/18/07, Cédric Beust ♔ <[hidden email]> wrote:

>
> Amit,
>
> What happens when you try to run your test class directly through
> TestNG (as opposed to using the programmatic API, as you are currently
> doing):
>
> java org.testng.TestNG com.sonata.TestHarness
>
> ?
>
> --
> Cedric
>
>
> On 4/18/07, amits <[hidden email]> wrote:
> > I missed to attach the files in previous post.
> > ---------------------------------------------------------------------
> > Posted via Jive Forums
> > http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142846#142846
> >
> > >
> >
> > Command line suite
> > 2007-04-18 17:43:22,240 INFO  [STDOUT] [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@6f403e priority: 10
> > 2007-04-18 17:43:22,255 INFO  [STDOUT] [TestNGClassFinder] SKIPPING CLASS class com.sonata.testharness.TestHarness no TestNG annotations found
> > 2007-04-18 17:43:22,283 INFO  [STDOUT] [SuiteRunner] Created 1 TestRunners
> > 2007-04-18 17:43:22,283 INFO  [STDOUT] [TestRunner] Running test Command line test on 0  classes,  included groups:[] excluded groups:[]
> > 2007-04-18 17:43:22,293 INFO  [STDOUT] [TestRunner] WILL BE RUN IN RANDOM ORDER:
> > 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] WILL BE RUN SEQUENTIALLY:
> > 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] ===
> > 2007-04-18 17:43:22,294 INFO  [STDOUT] [TestRunner] Found 0 applicable methods
> > 2007-04-18 17:43:22,296 INFO  [STDOUT]
> > *********** INVOKED METHODS
> > 2007-04-18 17:43:22,296 INFO  [STDOUT]
> > ***********
> > 2007-04-18 17:43:22,299 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.html
> > 2007-04-18 17:43:22,308 INFO  [STDOUT]
> > ===============================================
> >     Command line test
> >     Tests run: 0, Failures: 0, Skips: 0
> > ===============================================
> > 2007-04-18 17:43:22,312 INFO  [STDOUT]
> > ===============================================
> > Command line suite
> > Total tests run: 0, Failures: 0, Skips: 0
> > ===============================================
> > 2007-04-18 17:43:22,314 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/toc.html
> > 2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/Command line test.properties
> > 2007-04-18 17:43:22,315 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/index.html
> > 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/main.html
> > 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/groups.html
> > 2007-04-18 17:43:22,316 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods.html
> > 2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-alphabetical.html
> > 2007-04-18 17:43:22,319 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/classes.html
> > 2007-04-18 17:43:22,321 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/reporter-output.html
> > 2007-04-18 17:43:22,322 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/methods-not-run.html
> > 2007-04-18 17:43:22,330 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/Command line suite/testng.xml.html
> > 2007-04-18 17:43:22,331 INFO  [STDOUT] Creating /opt/jboss-4.0.3SP1/bin/test-output/index.html
> >
> >
>
>
> --
> Cédric
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

tarun3kumar
In reply to this post by Cédric Beust ♔

Hi Cedric,

If I try to run my test class directly through TestNG, I invoke TestNG with ANT in my IDE Intellij IDEA 6.0.4.

It compiles but at the runtime if fails to understand the JBoss container services.
Our application is tightly bound to container services(JMS, MDB, Datasource).

Hence, in order to do in-container testing using TestNG, I have tried using the Programmatic testng running approach.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=142859#142859


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

James-170

I am having the exactly the same problem when I try to run my TestNG
on WebSphere Application Server.  When I run the same TestNG class
with similar testng.xml file using command line with Ant.  The test
will run fine.

On Apr 18, 10:43 am, amits <[hidden email]> wrote:

> Hi Cedric,
>
> If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
>
> It compiles but at the runtime if fails to understand the JBoss container services.
> Our application is tightly bound to container services(JMS, MDB, Datasource).
>
> Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> ---------------------------------------------------------------------
> Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Alexandru Popescu ☀

On 4/18/07, James <[hidden email]> wrote:
>
> I am having the exactly the same problem when I try to run my TestNG
> on WebSphere Application Server.  When I run the same TestNG class
> with similar testng.xml file using command line with Ant.  The test
> will run fine.
>

This is a very wild guess: is your contain configured to use some
security manager? I know there are a couple of permissions defining
access to classloaders, file readers, etc., so this may be the cause.

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator


> On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > Hi Cedric,
> >
> > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
> >
> > It compiles but at the runtime if fails to understand the JBoss container services.
> > Our application is tightly bound to container services(JMS, MDB, Datasource).
> >
> > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > ---------------------------------------------------------------------
> > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Alexandru Popescu ☀
On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:

> On 4/18/07, James <[hidden email]> wrote:
> >
> > I am having the exactly the same problem when I try to run my TestNG
> > on WebSphere Application Server.  When I run the same TestNG class
> > with similar testng.xml file using command line with Ant.  The test
> > will run fine.
> >
>
> This is a very wild guess: is your contain configured to use some
> security manager? I know there are a couple of permissions defining
> access to classloaders, file readers, etc., so this may be the cause.
>

Darn: the previous should read:

"is your container configured...."

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
>
> > On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > > Hi Cedric,
> > >
> > > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
> > >
> > > It compiles but at the runtime if fails to understand the JBoss container services.
> > > Our application is tightly bound to container services(JMS, MDB, Datasource).
> > >
> > > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > > ---------------------------------------------------------------------
> > > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...
> >
> >
> > > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Alexandru Popescu ☀
On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:

> On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
> > On 4/18/07, James <[hidden email]> wrote:
> > >
> > > I am having the exactly the same problem when I try to run my TestNG
> > > on WebSphere Application Server.  When I run the same TestNG class
> > > with similar testng.xml file using command line with Ant.  The test
> > > will run fine.
> > >
> >
> > This is a very wild guess: is your contain configured to use some
> > security manager? I know there are a couple of permissions defining
> > access to classloaders, file readers, etc., so this may be the cause.
> >
>
> Darn: the previous should read:
>
> "is your container configured...."
>


Well trying to run a simple test in a VM where I set
-Djava.security.manager=default resulted in a couple of errors. So, I
suppose you have some try/catch block there that is not showing the
root cause of the problem. Further investigating, I have created a
policy file:

grant {
    permission java.util.PropertyPermission "file.encoding", "read";
    permission java.util.PropertyPermission "user.dir", "read";
    permission java.io.FilePermission
"d:/workspace/java/cvsprojects/svn/testng/test-output",
"read,delete,write";
    permission java.io.FilePermission
"d:/workspace/java/cvsprojects/svn/testng/test-output/-",
"read,delete,write";
    permission java.lang.RuntimePermission "accessDeclaredMembers";
};

and passed it to the VM using -Djava.security.policy=testng.policy and
everything worked as expected. So, I am supposing this is the cause of
the problems you are seeing.

./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> ./alex
> --
> .w( the_mindstorm )p.
>   TestNG co-founder
> EclipseTestNG Creator
>
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >   TestNG co-founder
> > EclipseTestNG Creator
> >
> >
> > > On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > > > Hi Cedric,
> > > >
> > > > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
> > > >
> > > > It compiles but at the runtime if fails to understand the JBoss container services.
> > > > Our application is tightly bound to container services(JMS, MDB, Datasource).
> > > >
> > > > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > > > ---------------------------------------------------------------------
> > > > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...
> > >
> > >
> > > > > >
> > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

James-170

Thanks for the info, Alex.

I debug the code through and found out that TestNGClassFinder did try
to find the annotations and did not find anything in the TestNG
class.  So I used a decompiler to view the actual class binary and
noticed that the Java doc type of annotation is not there.  Not sure
is the decompiler ignored the java doc or the compiled java class
binary will ignore the java doc.

Since I am using Java doc annotation based on JDK 1.4.2,  do you think
I will need always provide a source dir for TestNGClassFinder to find
the Java doc based TestNG annotation?

I am not use any security manager in my WebSphere container at all so
I don't think the permission will help and I will give it a try
anyway.

Thanks.

On Apr 18, 11:57 am, "Alexandru Popescu ☀"
<[hidden email]> wrote:

> On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
>
>
>
> > On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
> > > On 4/18/07, James <[hidden email]> wrote:
>
> > > > I am having the exactly the same problem when I try to run myTestNG
> > > > on WebSphere Application Server.  When I run the sameTestNGclass
> > > > with similartestng.xml file using command line with Ant.  The test
> > > > will run fine.
>
> > > This is a very wild guess: is your contain configured to use some
> > > security manager? I know there are a couple of permissions defining
> > > access to classloaders, file readers, etc., so this may be the cause.
>
> > Darn: the previous should read:
>
> > "is your container configured...."
>
> Well trying to run a simple test in a VM where I set
> -Djava.security.manager=default resulted in a couple of errors. So, I
> suppose you have some try/catch block there that is not showing the
> root cause of the problem. Further investigating, I have created a
> policy file:
>
> grant {
>     permission java.util.PropertyPermission "file.encoding", "read";
>     permission java.util.PropertyPermission "user.dir", "read";
>     permission java.io.FilePermission
> "d:/workspace/java/cvsprojects/svn/testng/test-output",
> "read,delete,write";
>     permission java.io.FilePermission
> "d:/workspace/java/cvsprojects/svn/testng/test-output/-",
> "read,delete,write";
>     permission java.lang.RuntimePermission "accessDeclaredMembers";
>
> };
>
> and passed it to the VM using -Djava.security.policy=testng.policy and
> everything worked as expected. So, I am supposing this is the cause of
> the problems you are seeing.
>
> ./alex
> --
> .w( the_mindstorm )p.
>  TestNGco-founder
> EclipseTestNG Creator
>
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >  TestNGco-founder
> > EclipseTestNG Creator
>
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >  TestNGco-founder
> > > EclipseTestNG Creator
>
> > > > On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > > > > Hi Cedric,
>
> > > > > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
>
> > > > > It compiles but at the runtime if fails to understand the JBoss container services.
> > > > > Our application is tightly bound to container services(JMS, MDB, Datasource).
>
> > > > > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > > > > ---------------------------------------------------------------------
> > > > > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

Alexandru Popescu ☀
On 4/18/07, James <[hidden email]> wrote:

>
> Thanks for the info, Alex.
>
> I debug the code through and found out that TestNGClassFinder did try
> to find the annotations and did not find anything in the TestNG
> class.  So I used a decompiler to view the actual class binary and
> noticed that the Java doc type of annotation is not there.  Not sure
> is the decompiler ignored the java doc or the compiled java class
> binary will ignore the java doc.
>
> Since I am using Java doc annotation based on JDK 1.4.2,  do you think
> I will need always provide a source dir for TestNGClassFinder to find
> the Java doc based TestNG annotation?
>

Oh man... are you kidding me? Please read the documentation: javadoc
annotation will work ONLY IF the source is provided. There is no
javadoc inside the bytecode. It has never been and it will never be.

Also, it will be nice to provide all information at once: TestNG
version, launch mode, JVM, etc. so that I am not loosing time to
investigate problems that don't exist.


./alex
--
.w( the_mindstorm )p.
  TestNG co-founder
EclipseTestNG Creator

> I am not use any security manager in my WebSphere container at all so
> I don't think the permission will help and I will give it a try
> anyway.
>
> Thanks.
>
> On Apr 18, 11:57 am, "Alexandru Popescu ☀"
> <[hidden email]> wrote:
> > On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
> >
> >
> >
> > > On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
> > > > On 4/18/07, James <[hidden email]> wrote:
> >
> > > > > I am having the exactly the same problem when I try to run myTestNG
> > > > > on WebSphere Application Server.  When I run the sameTestNGclass
> > > > > with similartestng.xml file using command line with Ant.  The test
> > > > > will run fine.
> >
> > > > This is a very wild guess: is your contain configured to use some
> > > > security manager? I know there are a couple of permissions defining
> > > > access to classloaders, file readers, etc., so this may be the cause.
> >
> > > Darn: the previous should read:
> >
> > > "is your container configured...."
> >
> > Well trying to run a simple test in a VM where I set
> > -Djava.security.manager=default resulted in a couple of errors. So, I
> > suppose you have some try/catch block there that is not showing the
> > root cause of the problem. Further investigating, I have created a
> > policy file:
> >
> > grant {
> >     permission java.util.PropertyPermission "file.encoding", "read";
> >     permission java.util.PropertyPermission "user.dir", "read";
> >     permission java.io.FilePermission
> > "d:/workspace/java/cvsprojects/svn/testng/test-output",
> > "read,delete,write";
> >     permission java.io.FilePermission
> > "d:/workspace/java/cvsprojects/svn/testng/test-output/-",
> > "read,delete,write";
> >     permission java.lang.RuntimePermission "accessDeclaredMembers";
> >
> > };
> >
> > and passed it to the VM using -Djava.security.policy=testng.policy and
> > everything worked as expected. So, I am supposing this is the cause of
> > the problems you are seeing.
> >
> > ./alex
> > --
> > .w( the_mindstorm )p.
> >  TestNGco-founder
> > EclipseTestNG Creator
> >
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >  TestNGco-founder
> > > EclipseTestNG Creator
> >
> > > > ./alex
> > > > --
> > > > .w( the_mindstorm )p.
> > > >  TestNGco-founder
> > > > EclipseTestNG Creator
> >
> > > > > On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > > > > > Hi Cedric,
> >
> > > > > > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
> >
> > > > > > It compiles but at the runtime if fails to understand the JBoss container services.
> > > > > > Our application is tightly bound to container services(JMS, MDB, Datasource).
> >
> > > > > > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > > > > > ---------------------------------------------------------------------
> > > > > > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Functional testing with TestNG using JBoss

James-170

Sorry for the trouble, Alex. :)

I am new to TestNG and learning it everyday still....

Thanks very much for your help.

On Apr 18, 12:47 pm, "Alexandru Popescu ☀"
<[hidden email]> wrote:

> On 4/18/07, James <[hidden email]> wrote:
>
>
>
> > Thanks for the info, Alex.
>
> > I debug the code through andfoundout that TestNGClassFinder did try
> > to find theannotationsand did not find anything in theTestNG
> > class.  So I used a decompiler to view the actual class binary and
> > noticed that the Java doc type of annotation is not there.  Not sure
> > is the decompiler ignored the java doc or the compiled java class
> > binary will ignore the java doc.
>
> > Since I am using Java doc annotation based on JDK 1.4.2,  do you think
> > I will need always provide a source dir for TestNGClassFinder to find
> > the Java doc basedTestNGannotation?
>
> Oh man... are you kidding me? Please read the documentation: javadoc
> annotation will work ONLY IF the source is provided. There isno
> javadoc inside the bytecode. It has never been and it will never be.
>
> Also, it will be nice to provide all information at once:TestNG
> version, launch mode, JVM, etc. so that I am not loosing time to
> investigate problems that don't exist.
>
> ./alex
> --
> .w( the_mindstorm )p.
>  TestNGco-founder
> EclipseTestNG Creator
>
> > I am not use any security manager in my WebSphere container at all so
> > I don't think the permission will help and I will give it a try
> > anyway.
>
> > Thanks.
>
> > On Apr 18, 11:57 am, "Alexandru Popescu ☀"
> > <[hidden email]> wrote:
> > > On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
>
> > > > On 4/18/07, Alexandru Popescu ☀ <[hidden email]> wrote:
> > > > > On 4/18/07, James <[hidden email]> wrote:
>
> > > > > > I am having the exactly the same problem when I try to run myTestNG
> > > > > > on WebSphere Application Server.  When I run the sameTestNGclass
> > > > > > with similartestng.xml file using command line with Ant.  The test
> > > > > > will run fine.
>
> > > > > This is a very wild guess: is your contain configured to use some
> > > > > security manager? I know there are a couple of permissions defining
> > > > > access to classloaders, file readers, etc., so this may be the cause.
>
> > > > Darn: the previous should read:
>
> > > > "is your container configured...."
>
> > > Well trying to run a simple test in a VM where I set
> > > -Djava.security.manager=default resulted in a couple of errors. So, I
> > > suppose you have some try/catch block there that is not showing the
> > > root cause of the problem. Further investigating, I have created a
> > > policy file:
>
> > > grant {
> > >     permission java.util.PropertyPermission "file.encoding", "read";
> > >     permission java.util.PropertyPermission "user.dir", "read";
> > >     permission java.io.FilePermission
> > > "d:/workspace/java/cvsprojects/svn/testng/test-output",
> > > "read,delete,write";
> > >     permission java.io.FilePermission
> > > "d:/workspace/java/cvsprojects/svn/testng/test-output/-",
> > > "read,delete,write";
> > >     permission java.lang.RuntimePermission "accessDeclaredMembers";
>
> > > };
>
> > > and passed it to the VM using -Djava.security.policy=testng.policy and
> > > everything worked as expected. So, I am supposing this is the cause of
> > > the problems you are seeing.
>
> > > ./alex
> > > --
> > > .w( the_mindstorm )p.
> > >  TestNGco-founder
> > > EclipseTestNG Creator
>
> > > > ./alex
> > > > --
> > > > .w( the_mindstorm )p.
> > > >  TestNGco-founder
> > > > EclipseTestNG Creator
>
> > > > > ./alex
> > > > > --
> > > > > .w( the_mindstorm )p.
> > > > >  TestNGco-founder
> > > > > EclipseTestNG Creator
>
> > > > > > On Apr 18, 10:43 am, amits <[hidden email]> wrote:
> > > > > > > Hi Cedric,
>
> > > > > > > If I try to run my test class directly throughTestNG, I invokeTestNGwith ANT in my IDE Intellij IDEA 6.0.4.
>
> > > > > > > It compiles but at the runtime if fails to understand the JBoss container services.
> > > > > > > Our application is tightly bound to container services(JMS, MDB, Datasource).
>
> > > > > > > Hence, in order to do in-container testing usingTestNG, I have tried using the Programmatictestngrunning approach.
> > > > > > > ---------------------------------------------------------------------
> > > > > > > Posted via Jive Forumshttp://forums.opensymphony.com/thread.jspa?threadID=78133&messageID=1...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---