Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DEV-SNAPSHOT version #36

Closed
juherr opened this issue Aug 27, 2016 · 4 comments · Fixed by #37
Closed

Support DEV-SNAPSHOT version #36

juherr opened this issue Aug 27, 2016 · 4 comments · Fixed by #37

Comments

@juherr
Copy link
Member

juherr commented Aug 27, 2016

Since testng-team/testng#1124, DEV-SNAPSHOT was introduced.
Its support will be only usefull for people trying to work on testng.

Maybe we can imagine to support x.y.z-DEV-SNAPSHOT in case we need to branch testng a day.
Then DEV-SNAPSHOT is the latest available testng api and x.y.z-DEV-SNAPSHOT is the x.y.z testng api version.

@missedone
Copy link
Contributor

hi @juherr
there is no special steps required for handling DEV-SNAPSHOT version today, since the getTestNGVersion method first try to parse the version from org.testng.internal.Version, in this case it's DEV-SNAPSHOT, the parse will failed though, however, it will fall back to parsing pom.properties then.
so on my local, let's say run one TestNG test AssertTest, here is the output:

[RemoteTestNG] revisions:
    git.commit.id=2042ad22f5c1632e858b023f9e2dc5c80c2fa8fa
    git.branch=master
    git.build.version=1.0.1-SNAPSHOT
java.lang.IllegalArgumentException: invalid version "DEV": non-numeric "DEV"
    at org.osgi.framework.Version.parseInt(Version.java:170)
    at org.osgi.framework.Version.<init>(Version.java:126)
    at org.osgi.framework.Version.valueOf(Version.java:257)
    at org.osgi.framework.Version.parseVersion(Version.java:228)
    at org.testng.remote.RemoteTestNG.toVersion(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.getTestNGVersion(RemoteTestNG.java:98)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:45)
Caused by: java.lang.NumberFormatException: For input string: "DEV"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at org.osgi.framework.Version.parseInt(Version.java:168)
    ... 6 more
[RemoteTestNG] now trying to parse the version from pom.properties
[RemoteTestNG] detected TestNG version 6.9.12

@missedone
Copy link
Contributor

oh, I see.
I imported testng as maven project, the Maven Project Builder (of Maven Eclipse Plugin) auto execute some maven phases that generate the pom.properties.

this is not true if I import testng as Gradle project (with BuildShip Gradle Eclipse Plugin), the Gradle Project Builder does not trigger the build.gradle hence pom.properties not get generated. I think this will be same if using STS gradle plugin (deprecated now)

missedone added a commit that referenced this issue Aug 28, 2016
missedone added a commit that referenced this issue Aug 28, 2016
missedone added a commit that referenced this issue Aug 30, 2016
missedone added a commit that referenced this issue Aug 30, 2016
@missedone
Copy link
Contributor

hi @juherr
now the beta version of TestNG Eclipse plugin got updated with this change.

@juherr
Copy link
Member Author

juherr commented Aug 30, 2016

Thanks ! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants