Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartabatch-dev] CDITests.testCDIInjectContexts and DependentScopedBatchletContexts batchlet
  • From: Scott Kurz <skurz@xxxxxxxxxx>
  • Date: Wed, 18 May 2022 16:02:41 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=us.ibm.com; dmarc=pass action=none header.from=us.ibm.com; dkim=pass header.d=us.ibm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dz5ZTj1WJcBz5AX6iwPzcMgLgJ/D/AWOl7+fq7K2qkM=; b=n+ImGxY4m4+lrQ92Z9hQzL0Vq1Sz+bN8J3YVyHtQ0oCAcUVlGEoGjIIG/x7W8EA2pmhbKwpwIwQsDaiVEEqzdNMr29cdVS96NGQ7DuKZ43T46Oie7qTUnhrdsk9BNzMotz8mM/vSlqS6wzdJt5IY3d/J5Rd6xdGK6jweuB0ZQlb50egPJjZSV2LvTo1d4a03vxX8Rd4iot3lbu22TMHUOSaftM5bJAdFp8lMQGDJAaDwJQmBGmijk4EvJvmoYdRP2BofAbmNLZFvFRQ8IHxPFCzs0Rq0SLm6OT3ghuDdOJB6BjHtyFtBi4t68MyV4R3YSXFqBMPL1lkYdpv0elW10A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UyBobuNiAJM56yq5crLZYii/1sNPxMZarcDIhcosqFEvkbvYV3fxQXPC1eayrQkTI9v0Wl3/NlnGBvolptTR3Jl3pUpw5EA/wL51B/a6l8FqNsW2U0qpc/GJL1jhkQ3iR8J3Lx+twpSoHmxNgr+CPy98AILkhCG5VaAXFvtEMMIHbiGjQKPo1LDSCLNu7mUwSVCIIYvcXRB/C9oHdme8Gqs9obnSg9007UrVvO3KzGX1sf+WvaX19K7EinHhteEQ3bZs5BIuopmNiptHo8pEpMjh9bP80Ae74WRlA1Yk0gqKzuKsoEQigxEORK+LeUErewFgpbFt5LFSvxEbvmPDYQ==
  • Delivered-to: jakartabatch-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/jakartabatch-dev/>
  • List-help: <mailto:jakartabatch-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/jakartabatch-dev>, <mailto:jakartabatch-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/jakartabatch-dev>, <mailto:jakartabatch-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHYasT95lrkiSjTrUSpj5Tfe5vp060kyCeQ
  • Thread-topic: [EXTERNAL] [jakartabatch-dev] CDITests.testCDIInjectContexts and DependentScopedBatchletContexts batchlet

Cheng,

 

1 - That looks like an oversight, and I think the fields should not include `@Inject`.

 

2 - Now that you mention this, I fear we have been through this exact scenario before.    Having moved Git repos, issues, & ML, I’m not going to bother trying to confirm, though.

But I vaguely remember discussing this and I noticed if I change the jbatch behavior all the other tests pass.     

 

So does JBeret have the Batchlet return value take precedence over a StepContext.setExitStatus() value set elsewhere? 

 

If I’m remembering correctly, it was an embarrassing thing to have noticed then, but perhaps we already felt it was too late to fix then.   Or maybe this is a new issue and we’ve diverged in behavior all these years.

 

In any case, it seems like we would ideally then go through the processes for updating the TCK (possibly including the challenge process) as defined:

https://jakarta.ee/committees/specification/tckprocess/

 

Maybe we could see what else you find though.

 

Thanks,
Scott

 

 

 

From: jakartabatch-dev <jakartabatch-dev-bounces@xxxxxxxxxxx> On Behalf Of Cheng Fang
Sent: Wednesday, May 18, 2022 10:39 AM
To: jakartabatch developer discussions <jakartabatch-dev@xxxxxxxxxxx>
Subject: [EXTERNAL] [jakartabatch-dev] CDITests.testCDIInjectContexts and DependentScopedBatchletContexts batchlet

 

I have 2 questions about the TCK test CDITests.testCDIInjectContexts: 1, this test uses a batchlet DependentScopedBatchletContexts which injects JobContext and StepContext in various ways (field, constructor, and method injections). But all

ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

I have 2 questions about the TCK test CDITests.testCDIInjectContexts:

 

1, this test uses a batchlet DependentScopedBatchletContexts  which injects JobContext and StepContext in various ways (field, constructor, and method injections). But all fields are already annotated with @Inject, which means they are already field-injected. So even if one implementation does not support method or constructor injection, the target field already contains the expected value. Is this an oversight or specific reason?

 

2, step exit status from process() method return value, or StepContext.setExitStatus(...)? 

 

A batchlet step can get its exit status from either process() method return value, or StepContext.setExitStatus(), but which takes precedence? The test assumes setExitStatus(...) wins and ignore the return value. I couldn't find a clear language in the spec.

 

One may argue that setExitStatus() call is more explicit so it should win. But return value from process() is equally strong in this regard, since this is exactly the purpose of this return value, and no other use of this return value exists.

 

If we allow the last call to win, then the return value happens last after all setExitStatus(...) calls.  From a user's point of view, after calling setExitStatus(...), more processing happens, which may produce more up-to-date exit status, presented as the return value.

 

What do you think?

 

 


Back to the top