Bug 137763 - Refactor WS-I analyzer to remove hardcoded artifact types
Summary: Refactor WS-I analyzer to remove hardcoded artifact types
Status: ASSIGNED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: wst.wsi (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard: enablement, Extensibility
Keywords: helpwanted
Depends on:
Blocks: 138379
  Show dependency tree
 
Reported: 2006-04-20 11:49 EDT by Craig Chaney CLA
Modified: 2010-07-20 11:34 EDT (History)
2 users (show)

See Also:


Attachments
proposed refactoring (70.93 KB, patch)
2006-04-20 11:51 EDT, Craig Chaney CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Chaney CLA 2006-04-20 11:49:52 EDT
In BasicProfileAnalyzer.validateConformance(), the current WS-I analyzer is hardcoded to examine each of the four artifact types specified in the Basic Profile test assertion document (TAD).  As the analyzer is expanded to handle other profiles (such as the Basic Security Profile), the set of artifact types that the tool must cover will expand.

It would be better if this method could just dynamically read the artifact types from the TAD and proceed based on that.
Comment 1 Craig Chaney CLA 2006-04-20 11:51:40 EDT
Created attachment 39054 [details]
proposed refactoring

This patch that contains a proposed refactoring does the following:

Normalize the init, validate, and runTest methods among the different
validators:
  - Passing the wsdlDocument only makes sense for some of the validators (for
    example, it does not make sense for the UDDI validator).  I removed this
    parameter from the init functions that had it.  Instead, I added the WSDL
    document to the AnalyzerContext class and extracted it in the init
    functions for the validators that needed it.
  - added/moved the normalized methods in the validator interfaces
  - Moved the message/envelope validation logic out of BasicProfileAnalyzer
    and into BaseMessageValidator.  This required defining some operations for
    the message and envelope validators which aren't appropriate for the other
    validators.  I added a new interface (LogValidator) to hold these
    operations.
  - Added the runTests() function to the validators that returns whether or
    not the validator should be run (according to what is set in the analyzer
    config).

Eliminate testcase interdependencies and side effects:
  - Collect the wsdlDocument and portions to test up front rather than as side
    effects of the UDDI and WSDL test cases.  Remove the side effects from
    BP3001 and BP3003.
  - Move some of the generic UDDI functionality out of the UDDI validator and
    into UDDIUtils so that it can be used by BasicProfileAnalyzer
  - Add logic to the BasicProfileAnalyzer to scan the UDDI artifacts for a
    WSDL document to validate before starting to run the tests.

Call the validators as encountered in the TAD, rather than hardcoding each
validator:
  - Add an interface to the ProfileValidatorFactory that returns a validator
    depending on the given artifact name.  Implemented in
    ProfileValidatorFactoryImpl.  Other packages/projects will be able to
    register their validators here.
Comment 2 Valentin Baciu CLA 2007-11-08 13:20:30 EST
I will try too look at this for 3.0.
Comment 3 David Carver CLA 2008-07-24 10:46:03 EDT
This is definitely something that would be nice to have, particularly since the WS-Basic Security Profile 1.0 is now out, as well as the WS Relibably and Secure Profile being in Draft Mode.   If you want Valentin I can take a look at the patch and if necessary update it for 3.1?
Comment 4 Valentin Baciu CLA 2008-10-30 12:26:49 EDT
Sorry for the late reply Dave and thank you for offering to help out. I'll add this enhancement to the plan tentatively.
Comment 5 Keith Chong CLA 2009-10-08 11:41:00 EDT
This is not in the WTP 3.2 plan