Issue 9: Question - running testng in eclipse w/ tptp's profile
Status:  New
Owner: ----
Reported by ian.hami...@citigroup.com, Apr 17, 2007
What steps will reproduce the problem?
1. Start Eclipse. Make sure you have the eclipse testing platform (TPTP)
and testng eclipse plugin installed.
2. Try and create a new profile executable

What is the expected output? What do you see instead?
The profile config dialog comes up (see attached).
I cannot locate the testng run type in the tree on the left like I can when
I create a normal or debug run profile.

What version of the product are you using? On what operating system?
TestNG 5.4.0.0
TPTP platform project 4.3.1v200701291655
Eclipse 3.2.2
Windows XP sp2

Please provide any additional information below.


profileconfig.gif
81.8 KB   Download
Aug 14, 2007
#1 danapsi...@gmail.com
The same situation occurs when using JProfiler for profiling.
May 7, 2008
#2 sham...@gmail.com
I'm facing similar issue. Just wondering if there's a solution to this issue.
May 7, 2008
#3 ian.hami...@citigroup.com
No one has replied, and I haven't found a way to do it myself.

I just create plain JUnit tests for the things I absolutely want to profile.

-Ian

May 29, 2008
#4 adej...@gmail.com
I also looking forward to a solution to profile testng tests :)
Jan 15, 2009
#5 post2edb...@gmail.com
I also would like to profile my testng suites :(
Any news on when this would be available would be nice
May 14, 2009
#6 chad.r...@gmail.com
TPTP only supports certain launch configurations, one of which is not TestNG. I just
made a class like so and executed it as a java app:


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.TestNG;

public class TestNGCommandLine {
    private static final Logger logger =
LoggerFactory.getLogger(TestNGCommandLine.class);

    public static void main(String[] args) {
        logger.debug("Beginning testng w/: " + TestNGCommandLine.class.getResource(
                "/AllTests.tng.xml").getPath());
        TestNG.main(new String[] { TestNGCommandLine.class.getResource(
                "/AllTests.tng.xml").getPath() });
    }
}


Now you can profile the java application itself. Granted, this is just a workaround...
Dec 7, 2009
#7 makki.m...@gmail.com
A single testcase can be started from within its class by adding a main-methode like
this:

public static final void main(final String... args) {

	TestNG testng = new TestNG();
	testng.setTestClasses(new Class[]{TestCase.class});
	testng.run();
	logger.info("TestNG status: " + testng.getStatus());
}

where TestCase.class is the TestCase class you wanted to profile.

Start TPTP profiling with the contextmenu "Profile As - Java Application" in the
eclipse package explorer.

You do not have to create the xml file.