Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 146678 - <tptp:interrogation> and <tptp:publication> tasks throw NullPointerException if "tptp.test.project" property is not set
Summary: <tptp:interrogation> and <tptp:publication> tasks throw NullPointerException ...
Status: CLOSED DUPLICATE of bug 194503
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Paul Slauenwhite CLA
QA Contact:
URL:
Whiteboard: bvt
Keywords:
Depends on:
Blocks: 163402 211751
  Show dependency tree
 
Reported: 2006-06-12 15:30 EDT by John O'Shea CLA
Modified: 2016-05-05 11:06 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John O'Shea CLA 2006-06-12 15:30:20 EDT
If the "tptp.test.project" property is not set, then the <tptp:interrogation> and <tptp:publication> Ant tasks throw a NullPointerException.  Here's some example output

Collected results: 'org.eclipse.hyades.models.common.testprofile.impl.TPFExecutionResultImpl@67ed13 (eProxyURI: platform
:/resource/com.capeclear.ui.test/SampleTest_1150139206812.execution#F2329345811AD1EA0CE77310F6FB11DA)'
Test '\testsuites\SampleTest.testsuite' completed
Test completed!
     [echo] Interrogating test suite results...
[condition] adding file SampleTest_1150139206812.execution
[condition] Interrogation started!
[condition] Interrogation started!
[condition] java.lang.NullPointerException
[condition]     at org.eclipse.hyades.test.core.services.AbstractTestResultsInterrogationService.interrogate(AbstractTes
tResultsInterrogationService.java:179)
[condition]     at org.eclipse.hyades.test.core.services.AbstractTestResultsInterrogationService.execute(AbstractTestRes
ultsInterrogationService.java:99)
[condition]     at org.eclipse.hyades.automation.server.AbstractService.execute(AbstractService.java:43)
[condition]     at org.eclipse.hyades.automation.server.ServiceProxy$1.run(ServiceProxy.java:140)
[condition]     at org.eclipse.hyades.automation.core.utils.ReusableThread.run(ReusableThread.java:131)
[condition]     at java.lang.Thread.run(Thread.java:534)

this is from running the following Ant script:

    <!-- ======================= -->
    <!-- Execute ALL test suites -->
    <!-- ======================= -->
	<target name="test-execution-all">
		<echo message="Executing test suite..." />		
                
		<!-- ADD ONE OF THESE FOR EACH SUITE -->
		<tptp:execution resultsrefid="sample.test.results"
		    project="com.capeclear.ui.test"
		    suite="testsuites/SampleTest.testsuite"
		    deployment="testsuites/AutoUiDeployment.deploy">
		</tptp:execution>
        
        <echo message="Interrogating test suite results..." />
		<condition property="tptp.test.success">
			<tptp:interrogation verdictproperty="tptp.test.verdict">
			    <!-- ADD AN ENTRY HERE FOR EACH TEST PLUGIN -->
			    <filelist refid="sample.test.results"/>
			</tptp:interrogation>
		</condition>

Changing the script to define the tptp.test.project property works around the problem.

    <!-- ======================= -->
    <!-- Execute ALL test suites -->
    <!-- ======================= -->
	<target name="test-execution-all">
		<echo message="Executing test suite..." />		
        
        <property name="tptp.test.project" value="com.capeclear.ui.test"/>
        
		<!-- ADD ONE OF THESE FOR EACH SUITE -->
		<tptp:execution resultsrefid="sample.test.results"
		    project="${tptp.test.project}"
		    suite="testsuites/SampleTest.testsuite"
		    deployment="testsuites/AutoUiDeployment.deploy">
		</tptp:execution>
        
        <echo message="Interrogating test suite results..." />
		<condition property="tptp.test.success">
			<tptp:interrogation verdictproperty="tptp.test.verdict">
			    <!-- ADD AN ENTRY HERE FOR EACH TEST PLUGIN -->
			    <filelist refid="sample.test.results"/>
			</tptp:interrogation>
		</condition>

Should this strictly speaking be necessary?  If this issue was resolved then the tptp:interrogation task could scan test execution results from suites contained in multiple projects (using multiple filelists) which would be a big plus.

On a related note, is there any way to pass in more than one suite into a single call to the tptp:execution task? If I have multiple suites in a single project, it would be great to be able to tell tptp:execution to just exec them all (perhaps using a filelist or fileset) element...
Comment 1 John O'Shea CLA 2006-06-12 15:32:14 EDT
Sorry, wrong component first time around...
Comment 2 John O'Shea CLA 2006-06-12 15:34:05 EDT
Adding Scott to cc as I cannot change the Assigned To field 
Comment 3 DuWayne Morris CLA 2006-07-28 12:17:31 EDT
Setting milestone to 4.3 since 4.2.1 has been changed to only major approved
defect fixes.
Comment 4 DuWayne Morris CLA 2006-10-23 11:09:20 EDT
Changing target to 4.4 since 4.3 is now closed except for blocking or critical defects.
Comment 5 DuWayne Morris CLA 2007-01-16 16:32:09 EST
Adding estimate.  Target should be 4.4i1, Target Milestone not available for setting at the moment.  This estimate is only to provide an error message.  It does not provide an enhancement to run the Ant script without specifying a project.
Comment 6 DuWayne Morris CLA 2007-01-18 09:48:02 EST
Setting Target Milestone to 4.4i1.
Comment 7 Paul Slauenwhite CLA 2007-01-26 08:25:22 EST
Targeting to future since not containable in 4.4.
Comment 8 Paul Slauenwhite CLA 2007-01-26 08:59:27 EST
As discussed on this week's Test Project call (January 22, 2007), the Test Project will focus on existing P1 - P2/Blocker - Major and P1/Normal and test creation/automation defects (omitting defects dependant on outstanding features) in TPTP 4.4.  All other Test Project defects have been targeted to future.

If this defect has been targeted to future and you/originator feel it should be completed in 4.4, please provide the necessary reason as a reply to this comment or a post to the Test Project mailing list (tptp-test-tooling-dev@eclipse.org).  We will collectively triage and assess our resources to determine a case-by-case decision. 
Comment 9 Paul Slauenwhite CLA 2007-01-26 09:01:05 EST
As discussed on this week's Test Project call (January 22, 2007), the Test Project will focus on existing P1 - P2/Blocker - Major and P1/Normal and test creation/automation defects (omitting defects dependant on outstanding features) in TPTP 4.4.  All other Test Project defects have been targeted to future.

If this defect has been targeted to future and you/originator feel it should be completed in 4.4, please provide the necessary reason as a reply to this comment or a post to the Test Project mailing list (tptp-test-tooling-dev@eclipse.org).  We will collectively triage and assess our resources to determine a case-by-case decision. 
Comment 10 Paul Slauenwhite CLA 2007-01-26 09:03:23 EST
Correction:  The Test Project mailing list is tptp-testing-tools-dev@eclipse.org.
Comment 11 Paul Slauenwhite CLA 2009-06-30 06:56:31 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. Since this defect is more than 2 years old, it may be no longer relevant. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this defect is resolved as WONTFIX. If this defect is still relevant and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 12 Ben Chen CLA 2009-06-30 18:32:11 EDT
I believe "tptp.test.project" has to be set in order to use the ASF. Such NPE will be thrown if not, this is not restricted to <tptp:interrogation> and <tptp:publication>.

Paul, please advise. Thank you.
Comment 13 Paul Slauenwhite CLA 2009-07-01 06:53:00 EDT
(In reply to comment #12)
> I believe "tptp.test.project" has to be set in order to use the ASF. Such NPE
> will be thrown if not, this is not restricted to <tptp:interrogation> and
> <tptp:publication>.
> 
> Paul, please advise. Thank you.
> 

Although the project is required for the tptp:execution task, it should not be required for the tptp:interrogation task when using a reference to a results set.  As such, reopening.
Comment 14 Paul Slauenwhite CLA 2009-11-26 14:33:51 EST
(In reply to comment #13)
> (In reply to comment #12)
> > I believe "tptp.test.project" has to be set in order to use the ASF. Such NPE
> > will be thrown if not, this is not restricted to <tptp:interrogation> and
> > <tptp:publication>.
> > 
> > Paul, please advise. Thank you.
> > 
> 
> Although the project is required for the tptp:execution task, it should not be
> required for the tptp:interrogation task when using a reference to a results
> set.  As such, reopening.

Correction, the tptp:interrogation and tptp:publication tasks do require the tptp.test.project to be set since these service implementations extend
org.eclipse.hyades.automation.server.AbstractProjectSensitiveService.  

This defect will be covered under https://bugs.eclipse.org/bugs/show_bug.cgi?id=194503.

*** This bug has been marked as a duplicate of bug 194503 ***