Bug 5490

Summary: Clarify JobContext/StepContext properties; fix TCK to not depend on writable Properties
Product: jbatch Reporter: ScottKurz
Component: SPECAssignee: ScottKurz
Status: RESOLVED FIXED    
Severity: major CC: issues, mminella
Priority: P5    
Version: 1   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Whiteboard:

Description ScottKurz 2013-10-24 18:50:45 UTC
This is mainly a TCK bug... (see public ML discussion with subject "...Should StepContext.getProperties() be allowed to hold application data?".

However I'm listing it in 'spec' category since it would only help to clarify the expectations here, namely:

1) the Properties are not necessarily writable.
2) the runtime may provide additional properties in addition to the ones corresponding to JSL elements.  

We might debate whether 2) is really worth saying, but it is here noted.
Comment 1 ScottKurz 2013-11-05 19:06:53 UTC
Note the 2013-11-06 update of the SE TCK has resolved this issue from the TCK perspective (by switching to use transient user data).

Leaving the bug open to track a spec clarification.
Comment 2 ScottKurz 2014-01-07 18:54:10 UTC
*** Bug 4710 has been marked as a duplicate of this bug. ***
Comment 3 ScottKurz 2014-01-07 20:36:36 UTC
Javadoc updated as follows:

JobContext:
----------------------------------------

java.util.Properties getProperties()

The getProperties method returns the job level properties specified in a job definition.

A couple notes:

    There is no guarantee that the same Properties object instance is always returned in the same (job) scope.
    Besides the properties which are defined in JSL within a child <properties> element of a <job> element, the batch runtime implementation may choose to include additional, implementation-defined properties. 

Returns:
    job level properties
----------------------------------------

StepContext:
----------------------------------------
java.util.Properties getProperties()

The getProperties method returns the step level properties specified in a job definition.

A couple notes:

    There is no guarantee that the same Properties object instance is always returned in the same (step) scope.
    Besides the properties which are defined in JSL within a child <properties> element of a <step> element, the batch runtime implementation may choose to include additional, implementation-defined properties. 

Returns:
    step level properties
----------------------------------------
Comment 4 ScottKurz 2015-09-03 21:22:51 UTC
Not sure what we could test here in the TCK so closing.