Issue Type: Improvement Improvement
Assignee: Nalin Makar
Components: testng-plugin
Created: 31/Mar/15 4:27 PM
Description:

Profiling Jenkins startup, with jobs using testng plugin, I found parsing returning null, and cod generating Illegal Argument exceptions when using that with Enum class.

Added System.out.println debugging load time of testng and discovered that every other call in ResultsParser.java to xmlPullParser.nextToken() returns 'null':

parse: name(testng-results) tag(TESTNG_RESULTS) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(reporter-output) tag(REPORTER_OUTPUT) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(reporter-output) tag(REPORTER_OUTPUT) event(3)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(suite) tag(SUITE) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(groups) tag(GROUPS) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(groups) tag(GROUPS) event(3)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(test) tag(TEST) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(class) tag(CLASS) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(test-method) tag(TEST_METHOD) event(2)
parse: name(null) tag(UNKNOWN) event(4)
parse: name(params) tag(PARAMS) event(2)
parse: name(null) tag(UNKNOWN) event(4)

using code snippet:

TAGS tag = TAGS.fromString(tagName);
int eventType = xmlPullParser.getEventType();
System.out.println( "parse: name(" + xmlPullParser.getName() + ") tag(" + tag + ") event(" + eventType + ")" );

The TAGS.fromString, with null causes a Java Illegal argument exception.

The question is why does xmlPullParser.nextToken() return null every other call, and can the code short circuit on this being null instead of causing the Illegal Argument exception, and overhead?

Environment: Jenkins LTS 1.596.1, Testng-plugin 1.9.1, Redhat RHEL 6.5, Hotspot JDK 1.8
Project: Jenkins
Priority: Minor Minor
Reporter: Daryl Spartz
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to