Bug 233764 - Top down EJB preference not respected
Summary: Top down EJB preference not respected
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.0 RC3   Edit
Assignee: Andrew Mak CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard: PMC_approved
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-05-23 17:20 EDT by Andrew Mak CLA
Modified: 2008-06-06 09:55 EDT (History)
2 users (show)

See Also:
david_williams: pmc_approved+
kathy: pmc_approved? (raghunathan.srinivasan)
kathy: pmc_approved? (naci.dai)
deboer: pmc_approved+
kathy: pmc_approved? (neil.hauge)
kathy: pmc_approved? (kaloyan)


Attachments
patch (5.07 KB, patch)
2008-05-23 17:47 EDT, Andrew Mak CLA
makandre: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Mak CLA 2008-05-23 17:20:25 EDT
After setting the Web service scenario preference to Top down EJB, I right-click on a wsdl file and select Web Services > Generate Java bean skeleton.  However, the wizard still comes up with Top down Java as the scenario type rather than Top down EJB.
Comment 1 Andrew Mak CLA 2008-05-23 17:47:07 EDT
Created attachment 101824 [details]
patch

A proposed fix for this issue.  I will be doing some more testing with this patch.
Comment 2 Andrew Mak CLA 2008-05-26 10:39:26 EDT
Problem Summary
===============

The scenario type preference setting is not respected when it is set to TDEJB, TDJAVA is always selected when launching the Web service wizards on a WSDL file.

In the course of debugging, I've also discovered an additional symptom, which is when the preference setting is set to TDJAVA/TDEJB, in the case that when an IType is selected, the scenario type is defaulted to TDJAVA/TDEJB instead of BUJAVA type.

Fix
===

I found TDJAVA type was hard coded in a couple of places:

In TypeSelectionFilter2.getWebServiceTypeByInitialSelection() method, the valid scenario types are determined based on the initial selection.  When the selection is a WSDL, it originally returns only TDJAVA as the valid scenario type.  This is incorrect; it should return both TDJAVA and TDEJB since both are valid scenario types.  Also changed in this method is catching of IType selection and returning BUJAVA as a valid type.

In ServerWizardWidgetDefaultingCommnand.execute() method, there are 2 cases to consider.  In the first case the result from getWebServiceTypeByInitialSelection() is matched up with the peferred scenario type defined in preferences, such that the preferred scenario type is chosen if it determined to be valid given the selection.  In the second case, if the initial selection can be adapted to a WSDL url, the preferred scneario type is used if it is a TD typed scenario, otherwise, it is defaulted to TDJAVA.

Testing
=======

We have ran through 30+ JUnits which covers the initial selection and defaulting logic and all test cases have passed.

Review
======

This patch has been reviewed by Kathy.
Comment 3 Kathy Chan CLA 2008-05-26 11:42:30 EDT
This fix was requested by an adopter in order to be able to run top down EJB in a JUnit. Without this fix, they would not have a way to select top down EJB at all in the JUnit.

This code has been well reviewed and tested.

PMC, please approve for WTP 3.0 RC3.
Comment 4 Tim deBoer CLA 2008-05-26 14:43:29 EDT
Approved.
Comment 5 Kathy Chan CLA 2008-05-27 12:35:37 EDT
Patch committed and released as v200805271634.
Comment 6 Kathy Chan CLA 2008-05-28 11:38:30 EDT
I had to revert the release yesterday since we were still building for RC2.  I've just re-released to HEAD as v200805281530.
Comment 7 Andrew Mak CLA 2008-06-06 09:55:27 EDT
Verified on adopter product.