Sorce code for released versions

6 views
Skip to first unread message

Mats

unread,
Nov 9, 2009, 3:39:22 AM11/9/09
to testng-dev
Is it possible to get the source code for a released version of this
plugin? From what I can tell it is only possible to check out the
trunk.

Cédric Beust ♔

unread,
Nov 9, 2009, 11:10:22 AM11/9/09
to testn...@googlegroups.com
Hi Mats,


You are right, I haven't been very good at using tags for the Eclipse plug-in repository, sorry about that.

What are you trying to do?

--
Cédric

Mats Nilsson

unread,
Nov 9, 2009, 11:42:34 AM11/9/09
to testn...@googlegroups.com
I want to add a button/action/command that automatically creates a test configuration with customizable JVM-arguments. I dont want to change the behaviour of the current "Run as test" but to add this possibility. I checked out the trunk but get an error when I run testng. It complains about not finding a suite or something like that. I dont know if it is the plugin or testng that fails. 

//Mats

Cédric Beust ♔

unread,
Nov 9, 2009, 11:46:00 AM11/9/09
to testn...@googlegroups.com
On Mon, Nov 9, 2009 at 8:42 AM, Mats Nilsson <man...@gmail.com> wrote:
I want to add a button/action/command that automatically creates a test configuration with customizable JVM-arguments. I dont want to change the behaviour of the current "Run as test" but to add this possibility. I checked out the trunk but get an error when I run testng. It complains about not finding a suite or something like that. I dont know if it is the plugin or testng that fails. 

So why do you think you need to check out a specific version of the plug-in?  Why not get the latest trunk?

--
Cédric

Mats Nilsson

unread,
Nov 9, 2009, 3:13:17 PM11/9/09
to testn...@googlegroups.com
Because I cant get the trunk to work. It complains about not finding a suite file. I get that behaviour straight out of the checked out trunk(without modification) and independent if I choose "Run as test" or creates a suite file and "Run suite".
I guess it can be because of TestNG and not because of the plugin but I'm not sure.

2009/11/9 Cédric Beust ♔ <cbe...@google.com>

Cédric Beust ♔

unread,
Nov 9, 2009, 3:41:25 PM11/9/09
to testn...@googlegroups.com
On Mon, Nov 9, 2009 at 12:13 PM, Mats Nilsson <man...@gmail.com> wrote:
Because I cant get the trunk to work. It complains about not finding a suite file. I get that behaviour straight out of the checked out trunk(without modification) and independent if I choose "Run as test" or creates a suite file and "Run suite".
I guess it can be because of TestNG and not because of the plugin but I'm not sure.

Can you be more specific and explain your steps to reproduce this problem?  I'm not sure if you are talking about building the plug-in, or running it in PDE, or...

--
Cédric 

Mats Nilsson

unread,
Nov 10, 2009, 2:30:35 AM11/10/09
to testn...@googlegroups.com
Ok I will try to explain what I'm trying to do, step by step.

* Check out the trunk
* Import project in eclipse
* Testing plugin by launching a separate application
* Create a project with a class and corresponding test class
* Right-click on test class and choose "Run as->TestNg Test"

This results in this warning:

WARNING: No test suite found.  Nothing to run

2009/11/9 Cédric Beust ♔ <cbe...@google.com>

alex

unread,
Nov 19, 2009, 10:31:49 AM11/19/09
to testng-dev
Looks like TestNG plug-in does not support testng.jar newer then 5.9.1
To reproduce this issue:
1) Prepare lib directory with two versions of testng-jdk15.jar
- one with version from plugin lib directory: eclipse\plugins
\org.testng.eclipse_5.9.0.5\lib\testng-jdk15.jar.
rename it to: testng-5.9.1beta-jdk15.jar
- second one from testng-5.10: testng-5.10-jdk15.jar
2) Add testng-5.9.1beta-jdk15.jar to project build path.
3) Set use project TestNG check box in project properties
4) Run any test. Should be PASSED
5) change project build path from testng-5.9.1beta-jdk15.jar to
testng-5.10-jdk15.jar
6) Rerun the same test. Should be FAIL

Alex

alex

unread,
Nov 19, 2009, 3:52:18 PM11/19/09
to testng-dev
testng_eclipse plugin 5.9.0.5 can work only with testng-jdk15.jar till
714 revision.
Below is changes with 715 revision: ( the first revision which does
not work with eclipse plugin )

Index: trunk/src/main/org/testng/TestNG.java
===================================================================
--- trunk/src/main/org/testng/TestNG.java (revision 714)
+++ trunk/src/main/org/testng/TestNG.java (revision 715)
@@ -162,6 +162,10 @@
= new ArrayList<IInvokedMethodListener>();

private Integer m_dataProviderThreadCount = null;
+
+ private String m_jarPath;
+
+ private List<String> m_stringSuites = new ArrayList<String>();

/**
* Default constructor. Setting also usage of default listeners/
reporters.
@@ -315,13 +319,56 @@
* @param jarPath
*/
public void setTestJar(String jarPath) {
- if ((null == jarPath) || "".equals(jarPath)) {
+ m_jarPath = jarPath;
+ }
+
+ public void initializeSuitesAndJarFile() {
+ //
+ // Parse the suites that were passed on the command line
+ //
+ for (String suiteXmlPath : m_stringSuites) {
+ if(LOGGER.isDebugEnabled()) {
+ LOGGER.debug("suiteXmlPath: \"" + suiteXmlPath + "\"");
+ }
+ try {
+ Collection<XmlSuite> allSuites = new Parser
(suiteXmlPath).parse();
+ for (XmlSuite s : allSuites) {
+ m_suites.add(s);
+ }
+ }
+ catch(FileNotFoundException e) {
+ e.printStackTrace(System.out);
+ }
+ catch(IOException e) {
+ e.printStackTrace(System.out);
+ }
+ catch(ParserConfigurationException e) {
+ e.printStackTrace(System.out);
+ }
+ catch(SAXException e) {
+ e.printStackTrace(System.out);
+ }
+ }
+
+ //
+ // jar path
+ //
+ // If suites were passed on the command line, they take
precedence over the suite file
+ // inside that jar path
+ if (m_jarPath != null && m_stringSuites.size() > 0) {
+ StringBuilder suites = new StringBuilder();
+ for (String s : m_stringSuites) {
+ suites.append(s);
+ }
+ Utils.log("TestNG", 2, "Ignoring the XML file inside " +
m_jarPath + " and using "
+ + suites + " instead");
return;
}
+ if ((null == m_jarPath) || "".equals(m_jarPath)) return;

- File jarFile = new File(jarPath);
+ // We have a jar file and no XML file was specified: try to find
an XML file inside the jar
+ File jarFile = new File(m_jarPath);

-
try {
URL jarfileUrl = jarFile.getCanonicalFile().toURI().toURL();
URLClassLoader jarLoader = new URLClassLoader(new URL[]
{ jarfileUrl });
@@ -505,29 +552,7 @@
* </pre>
*/
public void setTestSuites(List<String> suites) {
- for (String suiteXmlPath : suites) {
- if(LOGGER.isDebugEnabled()) {
- LOGGER.debug("suiteXmlPath: \"" + suiteXmlPath + "\"");
- }
- try {
- Collection<XmlSuite> allSuites = new Parser
(suiteXmlPath).parse();
- for (XmlSuite s : allSuites) {
- m_suites.add(s);
- }
- }
- catch(FileNotFoundException e) {
- e.printStackTrace(System.out);
- }
- catch(IOException e) {
- e.printStackTrace(System.out);
- }
- catch(ParserConfigurationException e) {
- e.printStackTrace(System.out);
- }
- catch(SAXException e) {
- e.printStackTrace(System.out);
- }
- }
+ m_stringSuites = suites;
}

/**
@@ -736,6 +761,7 @@
* Run TestNG.
*/
public void run() {
+ initializeSuitesAndJarFile();
initializeListeners();
initializeCommandLineSuites();
initializeCommandLineSuitesParams();
Reply all
Reply to author
Forward
0 new messages