No interruption in a chain of dependent methods running

View: New views
18 Messages — Rating Filter:   Alert me  

No interruption in a chain of dependent methods running

by Rice Yeh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,
  I have 3 test classes, T1, T2, and T3. All the methods in each of
these test classes are sequentially dependent, where configuration
settings, which are mostly ThreadLocal variables, is set up in the
first method. I find the running of each chain of methods in these
test classes are interleaved to each other. This causes ThreadLocal
variables setting changed. Is there a way to make sure no interruption
in a chain of dependent methods running? The following is an
illustration for my problem.

T1.method1
T1.method2
T2.method1 <-- interrupting the running of methods in T1.
T2.method2
T1.method3
T3.method1
T3.method2

Regards,
Rice

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


Re: No interruption in a chain of dependent methods running

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Rice,

I don't quite follow, can you be more specific?  What order of execution are you seeing?  What do you think it should be?  Also, can you post your (trimmed down) source that would allow me to reproduce this?

--
Cédric



On Mon, Nov 2, 2009 at 12:45 AM, Rice <riceyeh@...> wrote:

Hi,
 I have 3 test classes, T1, T2, and T3. All the methods in each of
these test classes are sequentially dependent, where configuration
settings, which are mostly ThreadLocal variables, is set up in the
first method. I find the running of each chain of methods in these
test classes are interleaved to each other. This causes ThreadLocal
variables setting changed. Is there a way to make sure no interruption
in a chain of dependent methods running? The following is an
illustration for my problem.

T1.method1
T1.method2
T2.method1 <-- interrupting the running of methods in T1.
T2.method2
T1.method3
T3.method1
T3.method2

Regards,
Rice






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


Re: No interruption in a chain of dependent methods running

by Tomás Pollak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

this is similar to the problem I reported recently. See:
http://groups.google.com/group/testng-users/browse_thread/thread/12891791105a9a07
There's a test case attached there.

It's the same problem, except my tests interfere with each other through the database, while Rice's do through ThreadLocal variables.

Regards,
Tomás

2009/11/2 Cédric Beust ♔ <cbeust@...>
Hi Rice,

I don't quite follow, can you be more specific?  What order of execution are you seeing?  What do you think it should be?  Also, can you post your (trimmed down) source that would allow me to reproduce this?

--
Cédric




On Mon, Nov 2, 2009 at 12:45 AM, Rice <riceyeh@...> wrote:

Hi,
 I have 3 test classes, T1, T2, and T3. All the methods in each of
these test classes are sequentially dependent, where configuration
settings, which are mostly ThreadLocal variables, is set up in the
first method. I find the running of each chain of methods in these
test classes are interleaved to each other. This causes ThreadLocal
variables setting changed. Is there a way to make sure no interruption
in a chain of dependent methods running? The following is an
illustration for my problem.

T1.method1
T1.method2
T2.method1 <-- interrupting the running of methods in T1.
T2.method2
T1.method3
T3.method1
T3.method2

Regards,
Rice









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


Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


List,

Can somebody point me to some documentation/sample code .....on how to
change testcase name in report while running a @factory. right now i
have a factory which runs like 70-80 odd testcases, and in report they
have all same name, so its kindda tough to understand,  I can add some
specific log message to debug, and if nothing works out may be I will
have to create my own custom report , but was just wondering this should
be a common problem for most of @factory users, and there should be some
standard way to solve it. I tried but was unable to find anything on
this forum mail archive or on net . any help/suggestion will be
appreciated,

Best,
Pranav

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


Re: Reporting diff TestNames for @factory

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pranav,

Did you take a look at the ITest interface?

--
Cédric




On Mon, Nov 2, 2009 at 2:59 PM, Pranav <pranav.verma@...> wrote:

List,

Can somebody point me to some documentation/sample code .....on how to
change testcase name in report while running a @factory. right now i
have a factory which runs like 70-80 odd testcases, and in report they
have all same name, so its kindda tough to understand,  I can add some
specific log message to debug, and if nothing works out may be I will
have to create my own custom report , but was just wondering this should
be a common problem for most of @factory users, and there should be some
standard way to solve it. I tried but was unable to find anything on
this forum mail archive or on net . any help/suggestion will be
appreciated,

Best,
Pranav






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


Re: Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This looks intresteing, so I implemented ITest in my testcase class,
something like this


public class SuperTest implements Itest{

private String testName ;


public SuperTest (String name){

this.testName = name;
}


@Test
public void testSomething() {

<test code >
}


public String getTestName() {

return this.testName;
}

}


this had no impact on my test report,
Actually it never calls getTestName , am I doing somethign wrong here ?

Best,
Pranav


Cédric Beust ♔ wrote:

> Hi Pranav,
>
> Did you take a look at the ITest interface
> <http://testng.org/javadocs/org/testng/ITest.html>?
>
> --
> Cédric
>
>
>
>
> On Mon, Nov 2, 2009 at 2:59 PM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>
>     List,
>
>     Can somebody point me to some documentation/sample code .....on how to
>     change testcase name in report while running a @factory. right now i
>     have a factory which runs like 70-80 odd testcases, and in report they
>     have all same name, so its kindda tough to understand, I can add some
>     specific log message to debug, and if nothing works out may be I will
>     have to create my own custom report , but was just wondering this
>     should
>     be a common problem for most of @factory users, and there should
>     be some
>     standard way to solve it. I tried but was unable to find anything on
>     this forum mail archive or on net . any help/suggestion will be
>     appreciated,
>
>     Best,
>     Pranav
>
>
>
>
>
>
> >


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


Re: Reporting diff TestNames for @factory

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just tested and it's working for me:

public class A implements ITest {
  public String getTestName() {
    return "This is test A";
  }
}

and my HTML report says:

Test method Instance Time (seconds) Exception
g1
Test class:This is test A
test.tmp.A@46b6db0
g2
Test class:This is test A
test.tmp.A@46b6db0

Which report are you looking at?

--
Cédric





On Mon, Nov 2, 2009 at 4:12 PM, Pranav <pranav.verma@...> wrote:

This looks intresteing, so I implemented ITest in my testcase class,
something like this


public class SuperTest implements Itest{

private String testName ;


public SuperTest (String name){

this.testName = name;
}


@Test
public void testSomething() {

<test code >
}


public String getTestName() {

return this.testName;
}

}


this had no impact on my test report,
Actually it never calls getTestName , am I doing somethign wrong here ?

Best,
Pranav


Cédric Beust ♔ wrote:
> Hi Pranav,
>
> Did you take a look at the ITest interface
> <http://testng.org/javadocs/org/testng/ITest.html>?
>
> --
> Cédric
>
>
>
>
> On Mon, Nov 2, 2009 at 2:59 PM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>
>     List,
>
>     Can somebody point me to some documentation/sample code .....on how to
>     change testcase name in report while running a @factory. right now i
>     have a factory which runs like 70-80 odd testcases, and in report they
>     have all same name, so its kindda tough to understand, I can add some
>     specific log message to debug, and if nothing works out may be I will
>     have to create my own custom report , but was just wondering this
>     should
>     be a common problem for most of @factory users, and there should
>     be some
>     standard way to solve it. I tried but was unable to find anything on
>     this forum mail archive or on net . any help/suggestion will be
>     appreciated,
>
>     Best,
>     Pranav
>
>
>
>
>
>
> >







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


Re: Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Your report looks  perfect , just what i want.

I am using 5.8 jar, running it through eclipse ( right clicking
testng.xml , and click on "Run as testng suite"), and checking the
report in test-output/index.html

intrestingly, I dont see any instance column in my report.

any ideas?

Cédric Beust ♔ wrote:

> I just tested and it's working for me:
>
> public class A implements ITest {
>   public String getTestName() {
>     return "This is test A";
>   }
> }
>
> and my HTML report says:
>
> *Test method* *Instance* *Time (seconds)* *Exception*
> *g1*
> Test class:This is test A test.tmp.A@46b6db 0
> *g2*
> Test class:This is test A test.tmp.A@46b6db 0
>
>
> Which report are you looking at?
>
> --
> **/*Cédric*
> /
>
>
>
>
> On Mon, Nov 2, 2009 at 4:12 PM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>
>     This looks intresteing, so I implemented ITest in my testcase class,
>     something like this
>
>
>     public class SuperTest implements Itest{
>
>     private String testName ;
>
>
>     public SuperTest (String name){
>
>     this.testName = name;
>     }
>
>
>     @Test
>     public void testSomething() {
>
>     <test code >
>     }
>
>
>     public String getTestName() {
>
>     return this.testName;
>     }
>
>     }
>
>
>     this had no impact on my test report,
>     Actually it never calls getTestName , am I doing somethign wrong
>     here ?
>
>     Best,
>     Pranav
>
>
>     Cédric Beust ♔ wrote:
>     > Hi Pranav,
>     >
>     > Did you take a look at the ITest interface
>     > <http://testng.org/javadocs/org/testng/ITest.html>?
>     >
>     > --
>     > Cédric
>     >
>     >
>     >
>     >
>     > On Mon, Nov 2, 2009 at 2:59 PM, Pranav <pranav.verma@...
>     <mailto:pranav.verma@...>
>     > <mailto:pranav.verma@... <mailto:pranav.verma@...>>>
>     wrote:
>     >
>     >
>     >     List,
>     >
>     >     Can somebody point me to some documentation/sample code
>     .....on how to
>     >     change testcase name in report while running a @factory.
>     right now i
>     >     have a factory which runs like 70-80 odd testcases, and in
>     report they
>     >     have all same name, so its kindda tough to understand, I can
>     add some
>     >     specific log message to debug, and if nothing works out may
>     be I will
>     >     have to create my own custom report , but was just wondering
>     this
>     >     should
>     >     be a common problem for most of @factory users, and there should
>     >     be some
>     >     standard way to solve it. I tried but was unable to find
>     anything on
>     >     this forum mail archive or on net . any help/suggestion will be
>     >     appreciated,
>     >
>     >     Best,
>     >     Pranav
>     >
>     >
>     >
>     >
>     >
>     >
>     > >
>
>
>
>
>
>
>
> >


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


Parent Message unknown Re: Reporting diff TestNames for @factory

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is the right report, can you try 5.10?

On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...> wrote:



Your report looks  perfect , just what i want.

I am using 5.8 jar, running it through eclipse ( right clicking
testng.xml , and click on "Run as testng suite"), and checking the
report in test-output/index.html

intrestingly, I dont see any instance column in my report.

any ideas?

Cédric Beust ♔ wrote: > I just tested and it's working for me: > > public class A implements ITest ...

> <mailto:pranav.verma@...>> wrote: > > > This looks intresteing, so I implemented ITest i...

>     > <mailto:pranav.verma@... <mailto:pranav.verma@...>>>

> wrote: > > > > > > List, > > > > Can somebody point me to some doc...


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


Re: Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I just tried with 5.10

these are my classes

package com.factory;

import org.testng.annotations.Factory;

import com.test.MyTest;



public class MyFactory {
   

    @Factory
    public Object[] createTests(){
       
        int num = 5;
        Object[] result = new Object[num];
        for(int i=0;i<num;i++){
            MyTest obj  = new MyTest("Test" + i);
            result[i] = obj;
        }
        return result;
    }

}



package com.test;

import org.testng.Assert;
import org.testng.ITest;
import org.testng.annotations.Test;

public class MyTest implements ITest {

    private String name;
   
    public String getTestName() {
        // TODO Auto-generated method stub
        return this.name;
    }
   
    public MyTest(String name){
       
        this.name = name;
    }
   
    @Test
    public void someTest(){
       
        Assert.assertEquals(true, false);
    }
   
   

}


this is my testng.xml

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 
<suite name="testSuite" verbose="1" >
 
  <test verbose="2" name="ItestDemo">
 
    <classes>
        <class name="com.factory.MyFactory"/>

    </classes>
  </test>
</suite>

please find the html report (ItestDemo.html) attached with this mail.

( Btw if it matters I am on MAC, JRE 1.5 )

Best,
pranav




Cédric Beust ♔ wrote:

>
> This is the right report, can you try 5.10?
>
>> On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...
>> <mailto:pranav.verma@...>> wrote:
>>
>>
>>
>> Your report looks  perfect , just what i want.
>>
>> I am using 5.8 jar, running it through eclipse ( right clicking
>> testng.xml , and click on "Run as testng suite"), and checking the
>> report in test-output/index.html
>>
>> intrestingly, I dont see any instance column in my report.
>>
>> any ideas?
>>
>> Cédric Beust ♔ wrote: > I just tested and it's working for me: > >
>> public class A implements ITest ...
>>
>> > <mailto:pranav.verma@... <mailto:pranav.verma@...>>>
>> wrote: > > > This looks intresteing, so I implemented ITest i...
>>
>> >     > <mailto:pranav.verma@...
>> <mailto:pranav.verma@...> <mailto:pranav.verma@...
>> <mailto:pranav.verma@...>>>>
>>
>> > wrote: > > > > > > List, > > > > Can somebody point me to some doc...
>>
>
> >

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


TestNG: ItestDemo

ItestDemo

Tests passed/Failed/Skipped:0/5/0
Started on:Mon Nov 02 17:21:46 PST 2009
Total time:0 seconds (49 ms)
Included groups:
Excluded groups:

(Hover the method name to see the test class name)

FAILED TESTS
Test method Time (seconds) Exception
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)


Re: Reporting diff TestNames for @factory

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Can you try your code with TestNG on the command line?  (without Eclipse)

--
Cedric


On Mon, Nov 2, 2009 at 5:26 PM, Pranav <pranav.verma@...> wrote:
I just tried with 5.10

these are my classes

package com.factory;

import org.testng.annotations.Factory;

import com.test.MyTest;



public class MyFactory {


   @Factory
   public Object[] createTests(){

       int num = 5;
       Object[] result = new Object[num];
       for(int i=0;i<num;i++){
           MyTest obj  = new MyTest("Test" + i);
           result[i] = obj;
       }
       return result;
   }

}



package com.test;

import org.testng.Assert;
import org.testng.ITest;
import org.testng.annotations.Test;

public class MyTest implements ITest {

   private String name;

   public String getTestName() {
       // TODO Auto-generated method stub
       return this.name;
   }

   public MyTest(String name){

       this.name = name;
   }

   @Test
   public void someTest(){

       Assert.assertEquals(true, false);
   }



}


this is my testng.xml

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="testSuite" verbose="1" >

 <test verbose="2" name="ItestDemo">

   <classes>
       <class name="com.factory.MyFactory"/>

   </classes>
 </test>
</suite>

please find the html report (ItestDemo.html) attached with this mail.

( Btw if it matters I am on MAC, JRE 1.5 )

Best,
pranav




Cédric Beust ♔ wrote:
>
> This is the right report, can you try 5.10?
>
>> On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...
>> <mailto:pranav.verma@...>> wrote:
>>
>>
>>
>> Your report looks  perfect , just what i want.
>>
>> I am using 5.8 jar, running it through eclipse ( right clicking
>> testng.xml , and click on "Run as testng suite"), and checking the
>> report in test-output/index.html
>>
>> intrestingly, I dont see any instance column in my report.
>>
>> any ideas?
>>
>> Cédric Beust ♔ wrote: > I just tested and it's working for me: > >
>> public class A implements ITest ...
>>
>> > <mailto:pranav.verma@... <mailto:pranav.verma@...>>>
>> wrote: > > > This looks intresteing, so I implemented ITest i...
>>
>> >     > <mailto:pranav.verma@...
>> <mailto:pranav.verma@...> <mailto:pranav.verma@...
>> <mailto:pranav.verma@...>>>>
>>
>> > wrote: > > > > > > List, > > > > Can somebody point me to some doc...
>>
>
> >




ItestDemo

Tests passed/Failed/Skipped:0/5/0
Started on:Mon Nov 02 17:21:46 PST 2009
Total time:0 seconds (49 ms)
Included groups:
Excluded groups:

(Hover the method name to see the test class name)

FAILED TESTS
Test method Time (seconds) Exception
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
someTest 0
java.lang.AssertionError: expected:<false> but was:<true>
	at com.test.MyTest.someTest(MyTest.java:24)
... Removed 27 stack frames
Click to show all stack frames
java.lang.AssertionError: expected:<false> but was:<true>
	at org.testng.Assert.fail(Assert.java:86)
	at org.testng.Assert.failNotEquals(Assert.java:440)
	at org.testng.Assert.assertEquals(Assert.java:110)
	at org.testng.Assert.assertEquals(Assert.java:241)
	at org.testng.Assert.assertEquals(Assert.java:251)
	at com.test.MyTest.someTest(MyTest.java:24)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
	at org.testng.TestRunner.runWorkers(TestRunner.java:759)
	at org.testng.TestRunner.privateRun(TestRunner.java:592)
	at org.testng.TestRunner.run(TestRunner.java:486)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
	at org.testng.SuiteRunner.run(SuiteRunner.java:204)
	at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
	at org.testng.TestNG.run(TestNG.java:751)
	at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)





--
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 testng-users@...
To unsubscribe from this group, send email to testng-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: No interruption in a chain of dependent methods running

by Rice Yeh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Tomas,
  Yes, my problem is same as yours.

Regards,
Rice

On Nov 3, 2:26 am, Tomás Pollak <tpollak...@...> wrote:

> Hi,
>
> this is similar to the problem I reported recently. See:http://groups.google.com/group/testng-users/browse_thread/thread/1289...
> There's a test case attached there.
>
> It's the same problem, except my tests interfere with each other through the
> database, while Rice's do through ThreadLocal variables.
>
> Regards,
> Tomás
>
> 2009/11/2 Cédric Beust ♔ <cbe...@...>
>
> > Hi Rice,
>
> > I don't quite follow, can you be more specific?  What order of execution
> > are you seeing?  What do you think it should be?  Also, can you post your
> > (trimmed down) source that would allow me to reproduce this?
>
> > --
> > Cédric
>
> > On Mon, Nov 2, 2009 at 12:45 AM, Rice <rice...@...> wrote:
>
> >> Hi,
> >>  I have 3 test classes, T1, T2, and T3. All the methods in each of
> >> these test classes are sequentially dependent, where configuration
> >> settings, which are mostly ThreadLocal variables, is set up in the
> >> first method. I find the running of each chain of methods in these
> >> test classes are interleaved to each other. This causes ThreadLocal
> >> variables setting changed. Is there a way to make sure no interruption
> >> in a chain of dependent methods running? The following is an
> >> illustration for my problem.
>
> >> T1.method1
> >> T1.method2
> >> T2.method1 <-- interrupting the running of methods in T1.
> >> T2.method2
> >> T1.method3
> >> T3.method1
> >> T3.method2
>
> >> Regards,
> >> Rice
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng-users@...
To unsubscribe from this group, send email to testng-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Cedric,


testng through commandline creates perfect report. So the problem is
with eclipse TestNG plugin.

I tried maven surefire too, that also like eclipse plugin does not
create the intended report, and just ignores ITest implementation.

anybody any ideas to make it work on eclipse/maven ( specially for maven
surefire ) ?

Best,
Pranav

P.S : Cedric, I really appreciate your quick replies, thanks for all the
support.



Cédric Beust ♔ wrote:

> Can you try your code with TestNG on the command line?  (without Eclipse)
>
> --
> Cedric
>
>
> On Mon, Nov 2, 2009 at 5:26 PM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>     I just tried with 5.10
>
>     these are my classes
>
>     package com.factory;
>
>     import org.testng.annotations.Factory;
>
>     import com.test.MyTest;
>
>
>
>     public class MyFactory {
>
>
>        @Factory
>        public Object[] createTests(){
>
>            int num = 5;
>            Object[] result = new Object[num];
>            for(int i=0;i<num;i++){
>                MyTest obj  = new MyTest("Test" + i);
>                result[i] = obj;
>            }
>            return result;
>        }
>
>     }
>
>
>
>     package com.test;
>
>     import org.testng.Assert;
>     import org.testng.ITest;
>     import org.testng.annotations.Test;
>
>     public class MyTest implements ITest {
>
>        private String name;
>
>        public String getTestName() {
>            // TODO Auto-generated method stub
>            return this.name <http://this.name>;
>        }
>
>        public MyTest(String name){
>
>            this.name <http://this.name> = name;
>        }
>
>        @Test
>        public void someTest(){
>
>            Assert.assertEquals(true, false);
>        }
>
>
>
>     }
>
>
>     this is my testng.xml
>
>     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
>
>     <suite name="testSuite" verbose="1" >
>
>      <test verbose="2" name="ItestDemo">
>
>        <classes>
>            <class name="com.factory.MyFactory"/>
>
>        </classes>
>      </test>
>     </suite>
>
>     please find the html report (ItestDemo.html) attached with this mail.
>
>     ( Btw if it matters I am on MAC, JRE 1.5 )
>
>     Best,
>     pranav
>
>
>
>
>     Cédric Beust ♔ wrote:
>     >
>     > This is the right report, can you try 5.10?
>     >
>     >> On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...
>     <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>> wrote:
>     >>
>     >>
>     >>
>     >> Your report looks  perfect , just what i want.
>     >>
>     >> I am using 5.8 jar, running it through eclipse ( right clicking
>     >> testng.xml , and click on "Run as testng suite"), and checking the
>     >> report in test-output/index.html
>     >>
>     >> intrestingly, I dont see any instance column in my report.
>     >>
>     >> any ideas?
>     >>
>     >> Cédric Beust ♔ wrote: > I just tested and it's working for me: > >
>     >> public class A implements ITest ...
>     >>
>     >> > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>>
>     >> wrote: > > > This looks intresteing, so I implemented ITest i...
>     >>
>     >> >     > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@... <mailto:pranav.verma@...>>
>     <mailto:pranav.verma@... <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@... <mailto:pranav.verma@...>>>>>
>     >>
>     >> > wrote: > > > > > > List, > > > > Can somebody point me to
>     some doc...
>     >>
>     >
>     > >
>
>
>
>
>         ItestDemo
>
>     Tests passed/Failed/Skipped: 0/5/0
>     Started on: Mon Nov 02 17:21:46 PST 2009
>     Total time: 0 seconds (49 ms)
>     Included groups:
>     Excluded groups:
>
>     /(Hover the method name to see the test class name)/
>     *FAILED TESTS*
>     *Test method* *Time (seconds)* *Exception*
>     someTest 0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at org.testng.Assert.fail(Assert.java:86)
>     at org.testng.Assert.failNotEquals(Assert.java:440)
>     at org.testng.Assert.assertEquals(Assert.java:110)
>     at org.testng.Assert.assertEquals(Assert.java:241)
>     at org.testng.Assert.assertEquals(Assert.java:251)
>     at com.test.MyTest.someTest(MyTest.java:24)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:592)
>     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     at org.testng.TestRunner.run(TestRunner.java:486)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     at org.testng.TestNG.run(TestNG.java:751)
>     at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>              
>
>     someTest 0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at org.testng.Assert.fail(Assert.java:86)
>     at org.testng.Assert.failNotEquals(Assert.java:440)
>     at org.testng.Assert.assertEquals(Assert.java:110)
>     at org.testng.Assert.assertEquals(Assert.java:241)
>     at org.testng.Assert.assertEquals(Assert.java:251)
>     at com.test.MyTest.someTest(MyTest.java:24)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:592)
>     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     at org.testng.TestRunner.run(TestRunner.java:486)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     at org.testng.TestNG.run(TestNG.java:751)
>     at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>              
>
>     someTest 0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at org.testng.Assert.fail(Assert.java:86)
>     at org.testng.Assert.failNotEquals(Assert.java:440)
>     at org.testng.Assert.assertEquals(Assert.java:110)
>     at org.testng.Assert.assertEquals(Assert.java:241)
>     at org.testng.Assert.assertEquals(Assert.java:251)
>     at com.test.MyTest.someTest(MyTest.java:24)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:592)
>     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     at org.testng.TestRunner.run(TestRunner.java:486)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     at org.testng.TestNG.run(TestNG.java:751)
>     at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>              
>
>     someTest 0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at org.testng.Assert.fail(Assert.java:86)
>     at org.testng.Assert.failNotEquals(Assert.java:440)
>     at org.testng.Assert.assertEquals(Assert.java:110)
>     at org.testng.Assert.assertEquals(Assert.java:241)
>     at org.testng.Assert.assertEquals(Assert.java:251)
>     at com.test.MyTest.someTest(MyTest.java:24)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:592)
>     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     at org.testng.TestRunner.run(TestRunner.java:486)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     at org.testng.TestNG.run(TestNG.java:751)
>     at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>              
>
>     someTest 0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>     at org.testng.Assert.fail(Assert.java:86)
>     at org.testng.Assert.failNotEquals(Assert.java:440)
>     at org.testng.Assert.assertEquals(Assert.java:110)
>     at org.testng.Assert.assertEquals(Assert.java:241)
>     at org.testng.Assert.assertEquals(Assert.java:251)
>     at com.test.MyTest.someTest(MyTest.java:24)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:592)
>     at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     at org.testng.TestRunner.run(TestRunner.java:486)
>     at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     at org.testng.TestNG.run(TestNG.java:751)
>     at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>              
>
>
>
>
>
> --
> **/*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 testng-users@...
To unsubscribe from this group, send email to testng-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Reporting diff TestNames for @factory

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's really odd.  I would expect Maven/Eclipse to possibly remove the HTML reporter, but in this case, you wouldn't see any report at all.

Can you try to replace the Eclipse plugin's testng.jar with the 5.10 version?
 
--
Cédric




On Tue, Nov 3, 2009 at 12:08 AM, Pranav <pranav.verma@...> wrote:

Cedric,


testng through commandline creates perfect report. So the problem is
with eclipse TestNG plugin.

I tried maven surefire too, that also like eclipse plugin does not
create the intended report, and just ignores ITest implementation.

anybody any ideas to make it work on eclipse/maven ( specially for maven
surefire ) ?

Best,
Pranav

P.S : Cedric, I really appreciate your quick replies, thanks for all the
support.



Cédric Beust ♔ wrote:
> Can you try your code with TestNG on the command line?  (without Eclipse)
>
> --
> Cedric
>
>
> On Mon, Nov 2, 2009 at 5:26 PM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>     I just tried with 5.10
>
>     these are my classes
>
>     package com.factory;
>
>     import org.testng.annotations.Factory;
>
>     import com.test.MyTest;
>
>
>
>     public class MyFactory {
>
>
>        @Factory
>        public Object[] createTests(){
>
>            int num = 5;
>            Object[] result = new Object[num];
>            for(int i=0;i<num;i++){
>                MyTest obj  = new MyTest("Test" + i);
>                result[i] = obj;
>            }
>            return result;
>        }
>
>     }
>
>
>
>     package com.test;
>
>     import org.testng.Assert;
>     import org.testng.ITest;
>     import org.testng.annotations.Test;
>
>     public class MyTest implements ITest {
>
>        private String name;
>
>        public String getTestName() {
>            // TODO Auto-generated method stub
>            return this.name <http://this.name>;
>        }
>
>        public MyTest(String name){
>
>            this.name <http://this.name> = name;
>        }
>
>        @Test
>        public void someTest(){
>
>            Assert.assertEquals(true, false);
>        }
>
>
>
>     }
>
>
>     this is my testng.xml
>
>     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
>
>     <suite name="testSuite" verbose="1" >
>
>      <test verbose="2" name="ItestDemo">
>
>        <classes>
>            <class name="com.factory.MyFactory"/>
>
>        </classes>
>      </test>
>     </suite>
>
>     please find the html report (ItestDemo.html) attached with this mail.
>
>     ( Btw if it matters I am on MAC, JRE 1.5 )
>
>     Best,
>     pranav
>
>
>
>
>     Cédric Beust ♔ wrote:
>     >
>     > This is the right report, can you try 5.10?
>     >
>     >> On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...
>     <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>> wrote:
>     >>
>     >>
>     >>
>     >> Your report looks  perfect , just what i want.
>     >>
>     >> I am using 5.8 jar, running it through eclipse ( right clicking
>     >> testng.xml , and click on "Run as testng suite"), and checking the
>     >> report in test-output/index.html
>     >>
>     >> intrestingly, I dont see any instance column in my report.
>     >>
>     >> any ideas?
>     >>
>     >> Cédric Beust ♔ wrote: > I just tested and it's working for me: > >
>     >> public class A implements ITest ...
>     >>
>     >> > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>>
>     >> wrote: > > > This looks intresteing, so I implemented ITest i...
>     >>
>     >> >     > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@... <mailto:pranav.verma@...>>
>     <mailto:pranav.verma@... <mailto:pranav.verma@...>
>     >> <mailto:pranav.verma@... <mailto:pranav.verma@...>>>>>
>     >>
>     >> > wrote: > > > > > > List, > > > > Can somebody point me to
>     some doc...
>     >>
>     >
>     > >
>
>
>
>
>         ItestDemo
>
>     Tests passed/Failed/Skipped:      0/5/0
>     Started on:       Mon Nov 02 17:21:46 PST 2009
>     Total time:       0 seconds (49 ms)
>     Included groups:
>     Excluded groups:
>
>     /(Hover the method name to see the test class name)/
>     *FAILED TESTS*
>     *Test method*     *Time (seconds)*        *Exception*
>     someTest  0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at org.testng.Assert.fail(Assert.java:86)
>       at org.testng.Assert.failNotEquals(Assert.java:440)
>       at org.testng.Assert.assertEquals(Assert.java:110)
>       at org.testng.Assert.assertEquals(Assert.java:241)
>       at org.testng.Assert.assertEquals(Assert.java:251)
>       at com.test.MyTest.someTest(MyTest.java:24)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:592)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>       at org.testng.TestRunner.run(TestRunner.java:486)
>       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>       at org.testng.TestNG.run(TestNG.java:751)
>       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>
>
>     someTest  0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at org.testng.Assert.fail(Assert.java:86)
>       at org.testng.Assert.failNotEquals(Assert.java:440)
>       at org.testng.Assert.assertEquals(Assert.java:110)
>       at org.testng.Assert.assertEquals(Assert.java:241)
>       at org.testng.Assert.assertEquals(Assert.java:251)
>       at com.test.MyTest.someTest(MyTest.java:24)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:592)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>       at org.testng.TestRunner.run(TestRunner.java:486)
>       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>       at org.testng.TestNG.run(TestNG.java:751)
>       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>
>
>     someTest  0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at org.testng.Assert.fail(Assert.java:86)
>       at org.testng.Assert.failNotEquals(Assert.java:440)
>       at org.testng.Assert.assertEquals(Assert.java:110)
>       at org.testng.Assert.assertEquals(Assert.java:241)
>       at org.testng.Assert.assertEquals(Assert.java:251)
>       at com.test.MyTest.someTest(MyTest.java:24)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:592)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>       at org.testng.TestRunner.run(TestRunner.java:486)
>       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>       at org.testng.TestNG.run(TestNG.java:751)
>       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>
>
>     someTest  0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at org.testng.Assert.fail(Assert.java:86)
>       at org.testng.Assert.failNotEquals(Assert.java:440)
>       at org.testng.Assert.assertEquals(Assert.java:110)
>       at org.testng.Assert.assertEquals(Assert.java:241)
>       at org.testng.Assert.assertEquals(Assert.java:251)
>       at com.test.MyTest.someTest(MyTest.java:24)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:592)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>       at org.testng.TestRunner.run(TestRunner.java:486)
>       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>       at org.testng.TestNG.run(TestNG.java:751)
>       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>
>
>     someTest  0
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at com.test.MyTest.someTest(MyTest.java:24)
>     ... Removed 27 stack frames
>
>     Click to show all stack frames <#124b7a6f6da3b068_>
>
>     java.lang.AssertionError: expected:<false> but was:<true>
>       at org.testng.Assert.fail(Assert.java:86)
>       at org.testng.Assert.failNotEquals(Assert.java:440)
>       at org.testng.Assert.assertEquals(Assert.java:110)
>       at org.testng.Assert.assertEquals(Assert.java:241)
>       at org.testng.Assert.assertEquals(Assert.java:251)
>       at com.test.MyTest.someTest(MyTest.java:24)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:592)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>       at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>       at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>       at org.testng.TestRunner.run(TestRunner.java:486)
>       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>       at org.testng.TestNG.run(TestNG.java:751)
>       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>
>
>
>
>
>
> --
> **/*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 testng-users@...
To unsubscribe from this group, send email to testng-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Reporting diff TestNames for @factory

by Zaphod-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


This is exactly the same problem that I was having with 5.10 and
reported in my post,
Subject: ITest.getTestName() method from an @Factory => same name for
every test
on: 06-Oct-2009

Unfortunately nobody replied at the time :-(

Regards

Ed

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


Re: Reporting diff TestNames for @factory

by pranav-9 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


for eclipse currently I have testng 5.9 jar in my plugin folder, I dont
know where to get a testng-eclipse jar  v5.10, if you can gimme some
link, I can try it.

Btw one  more weird thing,  testng 5.10 jar does not show ITest testname
in report , if I call it through command line or surefire . It creates
the report but just ignores the getTestName method. I get proper report
if I use testng v5.8 or v5.9

Let me know if you want me to file a bug for v5.10?

Best,
Pranav

Cédric Beust ♔ wrote:

> That's really odd.  I would expect Maven/Eclipse to possibly remove
> the HTML reporter, but in this case, you wouldn't see any report at all.
>
> Can you try to replace the Eclipse plugin's testng.jar with the 5.10
> version?
>  
> --
> **/*Cédric*
> /
>
>
>
> On Tue, Nov 3, 2009 at 12:08 AM, Pranav <pranav.verma@...
> <mailto:pranav.verma@...>> wrote:
>
>
>     Cedric,
>
>
>     testng through commandline creates perfect report. So the problem is
>     with eclipse TestNG plugin.
>
>     I tried maven surefire too, that also like eclipse plugin does not
>     create the intended report, and just ignores ITest implementation.
>
>     anybody any ideas to make it work on eclipse/maven ( specially for
>     maven
>     surefire ) ?
>
>     Best,
>     Pranav
>
>     P.S : Cedric, I really appreciate your quick replies, thanks for
>     all the
>     support.
>
>
>
>     Cédric Beust ♔ wrote:
>     > Can you try your code with TestNG on the command line?  (without
>     Eclipse)
>     >
>     > --
>     > Cedric
>     >
>     >
>     > On Mon, Nov 2, 2009 at 5:26 PM, Pranav <pranav.verma@...
>     <mailto:pranav.verma@...>
>     > <mailto:pranav.verma@... <mailto:pranav.verma@...>>>
>     wrote:
>     >
>     >     I just tried with 5.10
>     >
>     >     these are my classes
>     >
>     >     package com.factory;
>     >
>     >     import org.testng.annotations.Factory;
>     >
>     >     import com.test.MyTest;
>     >
>     >
>     >
>     >     public class MyFactory {
>     >
>     >
>     >        @Factory
>     >        public Object[] createTests(){
>     >
>     >            int num = 5;
>     >            Object[] result = new Object[num];
>     >            for(int i=0;i<num;i++){
>     >                MyTest obj  = new MyTest("Test" + i);
>     >                result[i] = obj;
>     >            }
>     >            return result;
>     >        }
>     >
>     >     }
>     >
>     >
>     >
>     >     package com.test;
>     >
>     >     import org.testng.Assert;
>     >     import org.testng.ITest;
>     >     import org.testng.annotations.Test;
>     >
>     >     public class MyTest implements ITest {
>     >
>     >        private String name;
>     >
>     >        public String getTestName() {
>     >            // TODO Auto-generated method stub
>     >            return this.name <http://this.name> <http://this.name>;
>     >        }
>     >
>     >        public MyTest(String name){
>     >
>     >            this.name <http://this.name> <http://this.name> = name;
>     >        }
>     >
>     >        @Test
>     >        public void someTest(){
>     >
>     >            Assert.assertEquals(true, false);
>     >        }
>     >
>     >
>     >
>     >     }
>     >
>     >
>     >     this is my testng.xml
>     >
>     >     <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
>     >
>     >     <suite name="testSuite" verbose="1" >
>     >
>     >      <test verbose="2" name="ItestDemo">
>     >
>     >        <classes>
>     >            <class name="com.factory.MyFactory"/>
>     >
>     >        </classes>
>     >      </test>
>     >     </suite>
>     >
>     >     please find the html report (ItestDemo.html) attached with
>     this mail.
>     >
>     >     ( Btw if it matters I am on MAC, JRE 1.5 )
>     >
>     >     Best,
>     >     pranav
>     >
>     >
>     >
>     >
>     >     Cédric Beust ♔ wrote:
>     >     >
>     >     > This is the right report, can you try 5.10?
>     >     >
>     >     >> On Nov 2, 2009 4:43 PM, "Pranav" <pranav.verma@...
>     <mailto:pranav.verma@...>
>     >     <mailto:pranav.verma@... <mailto:pranav.verma@...>>
>     >     >> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >     <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>> wrote:
>     >     >>
>     >     >>
>     >     >>
>     >     >> Your report looks  perfect , just what i want.
>     >     >>
>     >     >> I am using 5.8 jar, running it through eclipse ( right
>     clicking
>     >     >> testng.xml , and click on "Run as testng suite"), and
>     checking the
>     >     >> report in test-output/index.html
>     >     >>
>     >     >> intrestingly, I dont see any instance column in my report.
>     >     >>
>     >     >> any ideas?
>     >     >>
>     >     >> Cédric Beust ♔ wrote: > I just tested and it's working
>     for me: > >
>     >     >> public class A implements ITest ...
>     >     >>
>     >     >> > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >     <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >     <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>>>
>     >     >> wrote: > > > This looks intresteing, so I implemented
>     ITest i...
>     >     >>
>     >     >> >     > <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>
>     >     <mailto:pranav.verma@... <mailto:pranav.verma@...>>
>     >     >> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>
>     >     <mailto:pranav.verma@...
>     <mailto:pranav.verma@...> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>
>     >     >> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...> <mailto:pranav.verma@...
>     <mailto:pranav.verma@...>>>>>>
>     >     >>
>     >     >> > wrote: > > > > > > List, > > > > Can somebody point me to
>     >     some doc...
>     >     >>
>     >     >
>     >     > >
>     >
>     >
>     >
>     >
>     >         ItestDemo
>     >
>     >     Tests passed/Failed/Skipped:      0/5/0
>     >     Started on:       Mon Nov 02 17:21:46 PST 2009
>     >     Total time:       0 seconds (49 ms)
>     >     Included groups:
>     >     Excluded groups:
>     >
>     >     /(Hover the method name to see the test class name)/
>     >     *FAILED TESTS*
>     >     *Test method*     *Time (seconds)*        *Exception*
>     >     someTest  0
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >     ... Removed 27 stack frames
>     >
>     >     Click to show all stack frames <#124b7a6f6da3b068_>
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at org.testng.Assert.fail(Assert.java:86)
>     >       at org.testng.Assert.failNotEquals(Assert.java:440)
>     >       at org.testng.Assert.assertEquals(Assert.java:110)
>     >       at org.testng.Assert.assertEquals(Assert.java:241)
>     >       at org.testng.Assert.assertEquals(Assert.java:251)
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     >       at java.lang.reflect.Method.invoke(Method.java:592)
>     >       at
>     org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     >       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     >       at
>     org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     >       at
>     org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     >       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     >       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     >       at org.testng.TestRunner.run(TestRunner.java:486)
>     >       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     >       at
>     org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     >       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     >       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     >       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     >       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     >       at org.testng.TestNG.run(TestNG.java:751)
>     >       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     >       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>     >
>     >
>     >     someTest  0
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >     ... Removed 27 stack frames
>     >
>     >     Click to show all stack frames <#124b7a6f6da3b068_>
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at org.testng.Assert.fail(Assert.java:86)
>     >       at org.testng.Assert.failNotEquals(Assert.java:440)
>     >       at org.testng.Assert.assertEquals(Assert.java:110)
>     >       at org.testng.Assert.assertEquals(Assert.java:241)
>     >       at org.testng.Assert.assertEquals(Assert.java:251)
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     >       at java.lang.reflect.Method.invoke(Method.java:592)
>     >       at
>     org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     >       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     >       at
>     org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     >       at
>     org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     >       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     >       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     >       at org.testng.TestRunner.run(TestRunner.java:486)
>     >       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     >       at
>     org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     >       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     >       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     >       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     >       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     >       at org.testng.TestNG.run(TestNG.java:751)
>     >       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     >       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>     >
>     >
>     >     someTest  0
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >     ... Removed 27 stack frames
>     >
>     >     Click to show all stack frames <#124b7a6f6da3b068_>
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at org.testng.Assert.fail(Assert.java:86)
>     >       at org.testng.Assert.failNotEquals(Assert.java:440)
>     >       at org.testng.Assert.assertEquals(Assert.java:110)
>     >       at org.testng.Assert.assertEquals(Assert.java:241)
>     >       at org.testng.Assert.assertEquals(Assert.java:251)
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     >       at java.lang.reflect.Method.invoke(Method.java:592)
>     >       at
>     org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     >       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     >       at
>     org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     >       at
>     org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     >       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     >       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     >       at org.testng.TestRunner.run(TestRunner.java:486)
>     >       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     >       at
>     org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     >       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     >       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     >       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     >       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     >       at org.testng.TestNG.run(TestNG.java:751)
>     >       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     >       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>     >
>     >
>     >     someTest  0
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >     ... Removed 27 stack frames
>     >
>     >     Click to show all stack frames <#124b7a6f6da3b068_>
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at org.testng.Assert.fail(Assert.java:86)
>     >       at org.testng.Assert.failNotEquals(Assert.java:440)
>     >       at org.testng.Assert.assertEquals(Assert.java:110)
>     >       at org.testng.Assert.assertEquals(Assert.java:241)
>     >       at org.testng.Assert.assertEquals(Assert.java:251)
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     >       at java.lang.reflect.Method.invoke(Method.java:592)
>     >       at
>     org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     >       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     >       at
>     org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     >       at
>     org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     >       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     >       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     >       at org.testng.TestRunner.run(TestRunner.java:486)
>     >       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     >       at
>     org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     >       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     >       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     >       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     >       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     >       at org.testng.TestNG.run(TestNG.java:751)
>     >       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     >       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>     >
>     >
>     >     someTest  0
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >     ... Removed 27 stack frames
>     >
>     >     Click to show all stack frames <#124b7a6f6da3b068_>
>     >
>     >     java.lang.AssertionError: expected:<false> but was:<true>
>     >       at org.testng.Assert.fail(Assert.java:86)
>     >       at org.testng.Assert.failNotEquals(Assert.java:440)
>     >       at org.testng.Assert.assertEquals(Assert.java:110)
>     >       at org.testng.Assert.assertEquals(Assert.java:241)
>     >       at org.testng.Assert.assertEquals(Assert.java:251)
>     >       at com.test.MyTest.someTest(MyTest.java:24)
>     >       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     >       at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     >       at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     >       at java.lang.reflect.Method.invoke(Method.java:592)
>     >       at
>     org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
>     >       at org.testng.internal.Invoker.invokeMethod(Invoker.java:517)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethod(Invoker.java:669)
>     >       at
>     org.testng.internal.Invoker.invokeTestMethods(Invoker.java:956)
>     >       at
>     org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
>     >       at
>     org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
>     >       at org.testng.TestRunner.runWorkers(TestRunner.java:759)
>     >       at org.testng.TestRunner.privateRun(TestRunner.java:592)
>     >       at org.testng.TestRunner.run(TestRunner.java:486)
>     >       at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
>     >       at
>     org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
>     >       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
>     >       at org.testng.SuiteRunner.run(SuiteRunner.java:204)
>     >       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:877)
>     >       at org.testng.TestNG.runSuitesLocally(TestNG.java:842)
>     >       at org.testng.TestNG.run(TestNG.java:751)
>     >       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
>     >       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
>     >
>     >
>     >
>     >
>     >
>     >
>     > --
>     > **/*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 testng-users@...
To unsubscribe from this group, send email to testng-users+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: No interruption in a chain of dependent methods running

by Cédric Beust ♔ :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tomás,

The order I get from the command line looks correct:

*********** INVOKED METHODS

    test.tmp.TestA.insertA() 12741398
        test.tmp.TestA.testGetA() 12741398
        test.tmp.TestA.testViewA_Details1() 12741398
        test.tmp.TestA.testViewA_Details2() 12741398
        test.tmp.TestA.testViewA_Details3() 12741398
        test.tmp.TestA.testViewA_Details4() 12741398
    test.tmp.TestB.insertB() 2592387
        test.tmp.TestB.testGetB() 2592387
        test.tmp.TestB.testViewB_Details1() 2592387
        test.tmp.TestB.testViewB_Details2() 2592387
        test.tmp.TestB.testViewB_Details3() 2592387
        test.tmp.TestB.testViewB_Details4() 2592387

The Eclipse screen shot you included does show a different order, though, so something is wrong.  Are you running Maven in Eclipse or was it just a pure Eclipse plug-in run?

Can you run your own example from the command line, just like I did?  And then can you try with Maven from the command line?

I'd like to narrow down the problem and I strongly suspect a problem with Maven/Surefire.

--
Cédric





On Mon, Nov 2, 2009 at 10:26 AM, Tomás Pollak <tpollak.ar@gmail.com> wrote:
Hi,

this is similar to the problem I reported recently. See:
http://groups.google.com/group/testng-users/browse_thread/thread/12891791105a9a07
There's a test case attached there.

It's the same problem, except my tests interfere with each other through the database, while Rice's do through ThreadLocal variables.

Regards,
Tomás

2009/11/2 Cédric Beust ♔ <cbeust@...>

Hi Rice,

I don't quite follow, can you be more specific?  What order of execution are you seeing?  What do you think it should be?  Also, can you post your (trimmed down) source that would allow me to reproduce this?

--
Cédric




On Mon, Nov 2, 2009 at 12:45 AM, Rice <riceyeh@...> wrote:

Hi,
 I have 3 test classes, T1, T2, and T3. All the methods in each of
these test classes are sequentially dependent, where configuration
settings, which are mostly ThreadLocal variables, is set up in the
first method. I find the running of each chain of methods in these
test classes are interleaved to each other. This causes ThreadLocal
variables setting changed. Is there a way to make sure no interruption
in a chain of dependent methods running? The following is an
illustration for my problem.

T1.method1
T1.method2
T2.method1 <-- interrupting the running of methods in T1.
T2.method2
T1.method3
T3.method1
T3.method2

Regards,
Rice














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


Re: No interruption in a chain of dependent methods running

by Tomás Pollak-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Cédric,

The problem was with the eclipse plugin. I have now tested running the tests from the command line and from maven, and they both execute the tests in the expected order. So apparently the problem is only with the eclipse plugin.

I'll try to do more tests, but it will take me some time.

Meanwhile, I am attaching the sample project again. This time I have shared 3 launchers that run the tests from the 3 tools (command-line, maven, eclipse plugin).

Cheers,
Tomás

2009/11/7 Cédric Beust ♔ <cbeust@...>
Hi Tomás,

The order I get from the command line looks correct:

*********** INVOKED METHODS

    test.tmp.TestA.insertA() 12741398
        test.tmp.TestA.testGetA() 12741398
        test.tmp.TestA.testViewA_Details1() 12741398
        test.tmp.TestA.testViewA_Details2() 12741398
        test.tmp.TestA.testViewA_Details3() 12741398
        test.tmp.TestA.testViewA_Details4() 12741398
    test.tmp.TestB.insertB() 2592387
        test.tmp.TestB.testGetB() 2592387
        test.tmp.TestB.testViewB_Details1() 2592387
        test.tmp.TestB.testViewB_Details2() 2592387
        test.tmp.TestB.testViewB_Details3() 2592387
        test.tmp.TestB.testViewB_Details4() 2592387

The Eclipse screen shot you included does show a different order, though, so something is wrong.  Are you running Maven in Eclipse or was it just a pure Eclipse plug-in run?

Can you run your own example from the command line, just like I did?  And then can you try with Maven from the command line?

I'd like to narrow down the problem and I strongly suspect a problem with Maven/Surefire.

--
Cédric





On Mon, Nov 2, 2009 at 10:26 AM, Tomás Pollak <tpollak.ar@gmail.com> wrote:
Hi,

this is similar to the problem I reported recently. See:
http://groups.google.com/group/testng-users/browse_thread/thread/12891791105a9a07
There's a test case attached there.

It's the same problem, except my tests interfere with each other through the database, while Rice's do through ThreadLocal variables.

Regards,
Tomás

2009/11/2 Cédric Beust ♔ <cbeust@...>

Hi Rice,

I don't quite follow, can you be more specific?  What order of execution are you seeing?  What do you think it should be?  Also, can you post your (trimmed down) source that would allow me to reproduce this?

--
Cédric




On Mon, Nov 2, 2009 at 12:45 AM, Rice <riceyeh@...> wrote:

Hi,
 I have 3 test classes, T1, T2, and T3. All the methods in each of
these test classes are sequentially dependent, where configuration
settings, which are mostly ThreadLocal variables, is set up in the
first method. I find the running of each chain of methods in these
test classes are interleaved to each other. This causes ThreadLocal
variables setting changed. Is there a way to make sure no interruption
in a chain of dependent methods running? The following is an
illustration for my problem.

T1.method1
T1.method2
T2.method1 <-- interrupting the running of methods in T1.
T2.method2
T1.method3
T3.method1
T3.method2

Regards,
Rice

















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



testng-run-order-with-launchers.zip (6K) Download Attachment