Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl')
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigImpl.java1060
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigReaderImpl.java559
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AssertionResultsOptionImpl.java200
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/UDDIReferenceImpl.java197
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLElementImpl.java202
-rw-r--r--bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLReferenceImpl.java163
6 files changed, 0 insertions, 2381 deletions
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigImpl.java
deleted file mode 100644
index 95ee74a0d..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigImpl.java
+++ /dev/null
@@ -1,1060 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.WSIException;
-import org.eclipse.wst.wsi.internal.core.analyzer.Analyzer;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfig;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfigReader;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultType;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultsOption;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLElement;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference;
-import org.eclipse.wst.wsi.internal.core.common.AddStyleSheet;
-import org.eclipse.wst.wsi.internal.core.common.impl.AddStyleSheetImpl;
-import org.eclipse.wst.wsi.internal.core.util.MessageList;
-import org.eclipse.wst.wsi.internal.core.util.Utils;
-
-/**
- * This class is an implementation of the analyzer configuration file interface.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class AnalyzerConfigImpl implements AnalyzerConfig
-{
- /**
- * Message list reference.
- */
- protected MessageList messageList = null;
-
- /**
- * Analyzer configuration file URI.
- */
- protected String configURI = null;
-
- /**
- * Optional description.
- */
- protected String description = null;
-
- /**
- * Verbose option.
- */
- protected boolean verbose = false;
-
- /**
- * Assertion results option.
- */
- protected AssertionResultsOption assertionResultsOption =
- new AssertionResultsOptionImpl();
-
- /**
- * Report location.
- */
- protected String reportURI = WSIConstants.DEFAULT_REPORT_URI;
-
- /**
- * Replace report indicator.
- */
- protected boolean replaceReport = false;
-
- /**
- * Add style sheet.
- */
- protected AddStyleSheet addStyleSheet;
-
- /**
- * Profile test assertions document location.
- */
- protected String testAssertionsDocumentURI =
- WSIConstants.DEFAULT_TEST_ASSERTIONS_DOCUMENT_URI;
-
- /**
- * Message log location.
- */
- protected String logURI = null;
-
- /**
- * Message correlation type.
- */
- protected String correlationType =
- WSIConstants.ATTRVAL_CORRELATION_TYPE_OPERATION;
-
- /**
- * WSDL reference.
- */
- protected WSDLReference wsdlReference = null;
-
- /**
- * UDDI reference.
- */
- protected UDDIReference uddiReference = null;
-
- /**
- * Default constructor.
- */
- public AnalyzerConfigImpl()
- {
- }
-
- /**
- * Constructor with all settings.
- * @param description an optional description.
- * @param verbose the verbose option.
- * @param assertionResultsOption an assertion results option.
- * @param reportURI report location.
- * @param replaceReport a replace report indicator.
- * @param addStyleSheet add style sheet.
- * @param testAssertionsDocumentURI profile test assertions document location.
- * @param logURI message log location.
- * @param correlationType message correlation type.
- * @param wsdlReference a WSDL reference..
- * @param uddiReference a UUDDI reference.
- */
- public AnalyzerConfigImpl(
- String description,
- boolean verbose,
- AssertionResultsOption assertionResultsOption,
- String reportURI,
- boolean replaceReport,
- AddStyleSheet addStyleSheet,
- String testAssertionsDocumentURI,
- String logURI,
- String correlationType,
- WSDLReference wsdlReference,
- UDDIReference uddiReference)
- {
- this.description = description;
- this.verbose = verbose;
- this.assertionResultsOption = assertionResultsOption;
- this.reportURI = reportURI;
- this.replaceReport = replaceReport;
- this.addStyleSheet = addStyleSheet;
- this.testAssertionsDocumentURI = testAssertionsDocumentURI;
- this.logURI = logURI;
- this.correlationType = correlationType;
- this.wsdlReference = wsdlReference;
- this.uddiReference = uddiReference;
- }
-
- /**
- * Initialize analyzer config.
- */
- public void init(MessageList messageList)
- {
- this.messageList = messageList;
- }
-
- /**
- * Get optional description.
- * @see #setDescription
- */
- public String getDescription()
- {
- return this.description;
- }
-
- /**
- * Set optional description.
- * @see #getDescription
- */
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- /**
- * @see #setVerboseOption
- */
- public boolean getVerboseOption()
- {
- return this.verbose;
- }
-
- /**
- * @see #getVerboseOption
- */
- public void setVerboseOption(boolean verbose)
- {
- this.verbose = verbose;
- }
-
- /**
- * Get assertion results option.
- * @see #setAssertionResultsOption
- */
- public AssertionResultsOption getAssertionResultsOption()
- {
- return this.assertionResultsOption;
- }
-
- /**
- * Set assertion results option.
- * @see #getAssertionResultsOption
- */
- public void setAssertionResultsOption(AssertionResultsOption assertionResultsOption)
- {
- this.assertionResultsOption = assertionResultsOption;
- }
-
- /**
- * @see #setReportLocation
- */
- public String getReportLocation()
- {
- return this.reportURI;
- }
-
- /**
- * @see #getReportLocation
- */
- public void setReportLocation(String reportURI)
- {
- this.reportURI = reportURI;
- }
-
- /**
- * Get replace report file option.
- * @see #setReplaceReport
- */
- public boolean getReplaceReport()
- {
- return this.replaceReport;
- }
-
- /**
- * Set report file location.
- * @see #getReplaceReport
- */
- public void setReplaceReport(boolean replaceReport)
- {
- this.replaceReport = replaceReport;
- }
-
- /**
- * Get add style sheet.
- * @see #setAddStyleSheet
- */
- public AddStyleSheet getAddStyleSheet()
- {
- return this.addStyleSheet;
- }
-
- /**
- * Set replace report file option.
- * @see #getAddStyleSheet
- */
- public void setAddStyleSheet(AddStyleSheet addStyleSheet)
- {
- this.addStyleSheet = addStyleSheet;
- }
-
- /**
- * @see #setTestAssertionDocumentLocation
- */
- public String getTestAssertionsDocumentLocation()
- {
- return this.testAssertionsDocumentURI;
- }
-
- /**
- * @see #getTestAssertionDocumentLocation
- */
- public void setTestAssertionsDocumentLocation(String testAssertionsDocumentURI)
- {
- this.testAssertionsDocumentURI = testAssertionsDocumentURI;
- }
-
- /**
- * @see #setLogLocation
- */
- public String getLogLocation()
- {
- return logURI;
- }
-
- /**
- * @see #getLogLocation
- */
- public void setLogLocation(String logURI)
- {
- this.logURI = logURI;
- }
-
- public boolean isLogSet()
- {
- return (logURI != null);
- }
-
- /**
- * Get correlation type.
- * @see #setCorrelationType
- */
- public String getCorrelationType()
- {
- return this.correlationType;
- }
-
- /**
- * Set correlation type.
- * @see #getCorrelationType
- *
- */
- public void setCorrelationType(String correlationType)
- {
- this.correlationType = correlationType;
- }
-
- /**
- * Is WSDL reference set.
- */
- public boolean isWSDLReferenceSet()
- {
- return (this.wsdlReference == null ? false : true);
- }
-
- /**
- * Get WSDL reference.
- * @see #setWSDLReference
- */
- public WSDLReference getWSDLReference()
- {
- return this.wsdlReference;
- }
-
- /**
- * Set WSDL reference.
- * @see #getWSDLReference
- */
- public void setWSDLReference(WSDLReference wsdlReference)
- {
- this.wsdlReference = wsdlReference;
- }
-
- /**
- * Get WSDL element.
- *
- */
- public WSDLElement getWSDLElement()
- {
- return (this.wsdlReference == null)
- ? null
- : this.wsdlReference.getWSDLElement();
- }
-
- /**
- * Get service location.
- */
- public String getServiceLocation()
- {
- return (this.wsdlReference == null)
- ? null
- : this.wsdlReference.getServiceLocation();
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfig#getWSDLLocation()
- */
- public String getWSDLLocation()
- {
- return (this.wsdlReference == null)
- ? null
- : this.wsdlReference.getWSDLLocation();
- }
-
- /**
- * @see org.wsi.test.analyzer.config.AnalyzerConfig#isUddiReferenceSet)
- */
- public boolean isUDDIReferenceSet()
- {
- return (this.uddiReference == null ? false : true);
- }
-
- /**
- * Get UDDI reference.
- * @see #setUDDIReference
- */
- public UDDIReference getUDDIReference()
- {
- return this.uddiReference;
- }
-
- /**
- * Set UDDI reference.
- * @see #getUDDIReference
- */
- public void setUDDIReference(UDDIReference uddiReference)
- {
- this.uddiReference = uddiReference;
- }
-
- /**
- * @see #setLocation
- */
- public String getLocation()
- {
- return configURI;
- }
-
- /**
- * @see getLocation
- */
- public void setLocation(String configURI)
- {
- this.configURI = configURI;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.document.WSIDocument#toXMLString()
- */
- public String toXMLString(String namespaceName)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String nsName = namespaceName;
- if ((!nsName.equals("") && (!nsName.endsWith(":"))))
- nsName += ":";
-
- // Start element
- pw.println(" <" + nsName + ELEM_NAME + ">");
-
- // Verbose option
- pw.print(" <" + nsName + WSIConstants.ELEM_VERBOSE + ">");
- pw.print(getVerboseOption());
- pw.println("</" + nsName + WSIConstants.ELEM_VERBOSE + ">");
-
- // Get assertion results option
- pw.print(assertionResultsOption.toXMLString(nsName));
-
- // report file
- pw.print(" <" + nsName + WSIConstants.ELEM_REPORT_FILE + " ");
- pw.print(WSIConstants.ATTR_REPLACE + "=\"" + getReplaceReport() + "\" ");
- pw.println(
- WSIConstants.ATTR_LOCATION + "=\"" + getReportLocation() + "\">");
- pw.print(getAddStyleSheet().toXMLString(namespaceName));
- pw.println(" </" + nsName + WSIConstants.ELEM_REPORT_FILE + ">");
-
- // test assertion file
- pw.print(
- " <" + nsName + WSIConstants.ELEM_TEST_ASSERTIONS_FILE + ">");
- pw.print(getTestAssertionsDocumentLocation());
- pw.println("</" + nsName + WSIConstants.ELEM_TEST_ASSERTIONS_FILE + ">");
-
- // log file
- pw.print(" <" + nsName + WSIConstants.ELEM_LOG_FILE);
- pw.print(
- " "
- + WSIConstants.ATTR_CORRELATION_TYPE
- + "=\""
- + this.correlationType
- + "\">");
- pw.print(getLogLocation());
- pw.println("</" + nsName + WSIConstants.ELEM_LOG_FILE + ">");
-
- // WSDL reference
- if (this.wsdlReference != null)
- {
- pw.print(getWSDLReference().toXMLString(nsName));
- }
-
- // UDDI Reference
- if (this.uddiReference != null)
- {
- pw.print(getUDDIReference().toXMLString(nsName));
- }
-
- // End element
- pw.println(" </" + nsName + ELEM_NAME + ">");
-
- return sw.toString();
- }
-
- /**
- * Get string representation of this object.
- */
- public String toString()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- // verbose option
- pw.println(" verbose .................... " + this.verbose);
-
- // assertionResults options
- pw.print(this.assertionResultsOption.toString());
-
- // reportFile options
- pw.println(" Report File:");
- pw.println(" replace .................. " + this.replaceReport);
- pw.println(" location ................. " + this.reportURI);
- if (this.addStyleSheet != null)
- {
- pw.println(" Style Sheet:");
- if (this.addStyleSheet.getHref() != null)
- pw.println(
- " href ................... " + this.addStyleSheet.getHref());
- if (this.addStyleSheet.getType() != null)
- pw.println(
- " type ................... " + this.addStyleSheet.getType());
- if (this.addStyleSheet.getTitle() != null)
- pw.println(
- " title .................. " + this.addStyleSheet.getTitle());
- if (this.addStyleSheet.getMedia() != null)
- pw.println(
- " media .................. " + this.addStyleSheet.getMedia());
- if (this.addStyleSheet.getCharset() != null)
- pw.println(
- " charset ................ " + this.addStyleSheet.getCharset());
- if (this.addStyleSheet.getAlternate() != null)
- pw.println(
- " alternate .............. "
- + this.addStyleSheet.getAlternate());
- }
-
- // testAssertionsFile parameter
- pw.println(
- " testAssertionsFile ......... " + this.testAssertionsDocumentURI);
-
- // logFile options
- if (this.logURI != null)
- {
- pw.println(" Message Log File:");
- pw.println(" location ................. " + this.logURI);
- pw.println(" correlationType .......... " + this.correlationType);
- }
-
- // wsdlReference options
- if (this.isWSDLReferenceSet())
- {
- pw.print(this.wsdlReference.toString());
- }
-
- // uddiReference options
- if (this.isUDDIReferenceSet())
- {
- pw.print(this.uddiReference.toString());
- }
-
- // description parameter
- if (this.description != null)
- {
- pw.println(" description ................ " + this.description);
- }
-
- return sw.toString();
- }
-
- /**
- * Set config values from another analyzer config object.
- */
- private void setConfig(AnalyzerConfig analyzerConfig)
- {
- this.configURI = analyzerConfig.getLocation();
- this.description = analyzerConfig.getDescription();
- this.verbose = analyzerConfig.getVerboseOption();
- this.assertionResultsOption = analyzerConfig.getAssertionResultsOption();
- this.reportURI = analyzerConfig.getReportLocation();
- this.replaceReport = analyzerConfig.getReplaceReport();
- this.logURI = analyzerConfig.getLogLocation();
- this.correlationType = analyzerConfig.getCorrelationType();
- this.testAssertionsDocumentURI =
- analyzerConfig.getTestAssertionsDocumentLocation();
- this.addStyleSheet = analyzerConfig.getAddStyleSheet();
- this.wsdlReference = analyzerConfig.getWSDLReference();
- this.uddiReference = analyzerConfig.getUDDIReference();
- }
-
- /**
- * Parse command line arguments.
- */
- public void parseArgs(String[] args, boolean validate) throws WSIException
- {
- WSDLReference wsdlReference = null;
- UDDIReference uddiReference = null;
-
- // Get new config reader
- AnalyzerConfigReader analyzerConfigReader = new AnalyzerConfigReaderImpl();
- analyzerConfigReader.init(this.messageList);
-
- // Analyzer config object which will be merged after all of the input parms are processed
- AnalyzerConfig analyzerConfigFromArgs = null;
-
- // Assertion results option
- AssertionResultsOption assertionResultsOption = null;
-
- // If no input arguments, then throw exception
- if (args.length == 0)
- {
- // ADD:
- throw new IllegalArgumentException(
- getMessage("usage01", Analyzer.USAGE_MESSAGE));
- }
-
- // Parse the command line arguments to locate the config file option (if it was specified)
- for (int argCount = 0; argCount < args.length; argCount++)
- {
- // -config
- if ((args[argCount].equalsIgnoreCase("-config"))
- || (args[argCount].equals("-c")))
- {
- argCount++;
- analyzerConfigFromArgs =
- analyzerConfigReader.readAnalyzerConfig(
- getOptionValue(args, argCount));
- }
- }
-
- // If config file was not specified, then create analyzer config object
- if (analyzerConfigFromArgs == null)
- {
- analyzerConfigFromArgs = new AnalyzerConfigImpl();
- analyzerConfigFromArgs.init(this.messageList);
- }
-
- // Get assertion results option
- if ((assertionResultsOption =
- analyzerConfigFromArgs.getAssertionResultsOption())
- == null)
- {
- assertionResultsOption = new AssertionResultsOptionImpl();
- analyzerConfigFromArgs.setAssertionResultsOption(assertionResultsOption);
- }
-
- // Parse all of the command line arguments
- for (int argCount = 0; argCount < args.length; argCount++)
- {
- // -config
- if ((args[argCount].equalsIgnoreCase("-config"))
- || (args[argCount].equals("-c")))
- {
- // Skip this option since it was already processed
- argCount++;
- }
-
- // -verbose
- else if (
- (args[argCount].equalsIgnoreCase("-verbose"))
- || (args[argCount].equals("-v")))
- {
- argCount++;
- analyzerConfigFromArgs.setVerboseOption(
- Boolean.valueOf(getOptionValue(args, argCount)).booleanValue());
- }
-
- // -assertionResults
- else if (
- (args[argCount].equalsIgnoreCase("-assertionResults"))
- || (args[argCount].equals("-a")))
- {
- argCount++;
- assertionResultsOption.setAssertionResultType(
- AssertionResultType.newInstance(getOptionValue(args, argCount)));
- }
-
- // -messageEntry
- else if (
- (args[argCount].equalsIgnoreCase("-messageEntry"))
- || (args[argCount].equals("-M")))
- {
- argCount++;
- assertionResultsOption.setShowMessageEntry(
- Boolean.valueOf(getOptionValue(args, argCount)).booleanValue());
- }
-
- // -assertionDescription
- else if (
- (args[argCount].equalsIgnoreCase("-assertionDescription"))
- || (args[argCount].equals("-A")))
- {
- argCount++;
- assertionResultsOption.setShowAssertionDescription(
- Boolean.valueOf(args[argCount]).booleanValue());
- }
-
- // -failureMessage
- else if (
- (args[argCount].equalsIgnoreCase("-failureMessage"))
- || (args[argCount].equals("-F")))
- {
- argCount++;
- assertionResultsOption.setShowFailureMessage(
- Boolean.valueOf(getOptionValue(args, argCount)).booleanValue());
- }
-
- // -failureDetail
- else if (
- (args[argCount].equalsIgnoreCase("-failureDetail"))
- || (args[argCount].equals("-D")))
- {
- argCount++;
- assertionResultsOption.setShowFailureDetail(
- Boolean.valueOf(getOptionValue(args, argCount)).booleanValue());
- }
-
- // -logFile
- else if (
- (args[argCount].equalsIgnoreCase("-logFile"))
- || (args[argCount].equals("-l")))
- {
- argCount++;
- analyzerConfigFromArgs.setLogLocation(getOptionValue(args, argCount));
- }
-
- // -testAssertionFile
- else if (
- (args[argCount].equalsIgnoreCase("-testAssertionFile"))
- || (args[argCount].equals("-t")))
- {
- argCount++;
- analyzerConfigFromArgs.setTestAssertionsDocumentLocation(
- getOptionValue(args, argCount));
- }
-
- // -reportFile
- else if (
- (args[argCount].equalsIgnoreCase("-reportFile"))
- || (args[argCount].equals("-r")))
- {
- argCount++;
- analyzerConfigFromArgs.setReportLocation(
- getOptionValue(args, argCount));
- }
-
- // -replace
- else if (
- (args[argCount].equalsIgnoreCase("-replace"))
- || (args[argCount].equals("-R")))
- {
- argCount++;
- analyzerConfigFromArgs.setReplaceReport(
- Boolean.valueOf(getOptionValue(args, argCount)).booleanValue());
- }
-
- // -correlationType
- else if (
- (args[argCount].equalsIgnoreCase("-correlationType"))
- || (args[argCount].equals("-C")))
- {
- argCount++;
- analyzerConfigFromArgs.setCorrelationType(
- getOptionValue(args, argCount));
- }
-
- // -wsdlElement
- else if (
- (args[argCount].equalsIgnoreCase("-wsdlElement"))
- || (args[argCount].equals("-W")))
- {
- String optionName = args[argCount];
- argCount++;
-
- WSDLElement wsdlElement = new WSDLElementImpl();
- wsdlElement.setName(getOptionValue(args, argCount, optionName));
- argCount++;
- wsdlElement.setType(getOptionValue(args, argCount, optionName));
- argCount++;
- wsdlElement.setNamespace(getOptionValue(args, argCount, optionName));
- if (!args[argCount].startsWith("-"))
- {
- argCount++;
- wsdlElement.setParentElementName(
- getOptionValue(args, argCount, optionName));
- }
-
- if (wsdlReference != null)
- {
- wsdlReference.setWSDLElement(wsdlElement);
- }
- else if (uddiReference != null)
- {
- uddiReference.setWSDLElement(wsdlElement);
- }
- else
- {
- throw new IllegalArgumentException(
- getMessage(
- "config10",
- "The -wsdlElement option must appear after the -wsdlURI or -uddiKey options."));
- }
-
- analyzerConfigFromArgs.setWSDLReference(wsdlReference);
- }
-
- // -serviceLocation
- else if (
- (args[argCount].equalsIgnoreCase("-serviceLocation"))
- || (args[argCount].equals("-S")))
- {
- argCount++;
-
- if (wsdlReference != null)
- {
- wsdlReference.setServiceLocation(getOptionValue(args, argCount));
- }
- else if (uddiReference != null)
- {
- uddiReference.setServiceLocation(getOptionValue(args, argCount));
- }
- else
- {
- throw new IllegalArgumentException(
- getMessage(
- "config11",
- "The -serviceLocation option must appear after the -wsdlURI or -uddiKey options."));
- }
- }
-
- // -wsdlURI
- else if (
- (args[argCount].equalsIgnoreCase("-wsdlURI"))
- || (args[argCount].equals("-W")))
- {
- argCount++;
- if (wsdlReference == null)
- wsdlReference = new WSDLReferenceImpl();
- wsdlReference.setWSDLLocation(getOptionValue(args, argCount));
- analyzerConfigFromArgs.setWSDLReference(wsdlReference);
- }
-
- // -uddiKeyType
- else if (
- (args[argCount].equalsIgnoreCase("-uddiKeyType"))
- || (args[argCount].equals("-K")))
- {
- argCount++;
- if (uddiReference == null)
- uddiReference = new UDDIReferenceImpl();
- uddiReference.setKeyType(getOptionValue(args, argCount));
- analyzerConfigFromArgs.setUDDIReference(uddiReference);
- }
-
- // -uddiKey
- else if (
- (args[argCount].equalsIgnoreCase("-uddiKey"))
- || (args[argCount].equals("-k")))
- {
- argCount++;
- if (uddiReference == null)
- uddiReference = new UDDIReferenceImpl();
- uddiReference.setKey(getOptionValue(args, argCount));
- analyzerConfigFromArgs.setUDDIReference(uddiReference);
- }
-
- // -inquiryURL
- else if (
- (args[argCount].equalsIgnoreCase("-inquiryURL"))
- || (args[argCount].equals("-i")))
- {
- argCount++;
- if (uddiReference == null)
- uddiReference = new UDDIReferenceImpl();
- uddiReference.setInquiryURL(getOptionValue(args, argCount));
- analyzerConfigFromArgs.setUDDIReference(uddiReference);
- }
-
- // ADD: Need to add support for other options (-config, -binding, etc.)
- else
- {
- throw new IllegalArgumentException(
- getMessage(
- "config12",
- args[argCount],
- "The specified option is not supported:"));
- }
- }
-
- // If addStyleSheet was not specified, then create a comment version of it
- if (analyzerConfigFromArgs.getAddStyleSheet() == null)
- {
- AddStyleSheet addStyleSheet = new AddStyleSheetImpl();
- addStyleSheet.setHref(WSIConstants.DEFAULT_REPORT_XSL);
- addStyleSheet.setType(WSIConstants.DEFAULT_XSL_TYPE);
- addStyleSheet.setComment(true);
- analyzerConfigFromArgs.setAddStyleSheet(addStyleSheet);
- }
-
- // Merge config info into this object
- setConfig(analyzerConfigFromArgs);
-
- if (validate)
- {
- // Verify that all required options were specified and
- // that the specified ones were correct
- checkConfigOptions();
- }
- }
-
- /**
- * Verify config options.
- */
- private void checkConfigOptions() throws WSIException
- {
- String fileLocation;
-
- // If wsdlReference and uddiReference specified, then throw exception
- if ((this.isWSDLReferenceSet()) && (this.isUDDIReferenceSet()))
- {
- throw new IllegalArgumentException(
- getMessage(
- "config04",
- "Can not specify both the WSDL reference and UDDI reference options"));
- }
-
- // Check if test assertion file exists
- if ((fileLocation = this.getTestAssertionsDocumentLocation()) == null)
- {
- throw new IllegalArgumentException(
- getMessage(
- "config16",
- "Test assertion document location must be specified."));
- }
-
- else if (!Utils.fileExists(fileLocation))
- {
- throw new IllegalArgumentException(
- getMessage(
- "config14",
- fileLocation,
- "Could not find test assertion document. Specified file location:"));
- }
-
- // Check if log file exists
- if ((fileLocation = this.getLogLocation()) != null)
- {
- if (!Utils.fileExists(fileLocation))
- throw new IllegalArgumentException(
- messageList.getMessage(
- "config02",
- fileLocation,
- "Could not find log file:"));
- }
-
- // Check if WSDL file exists
- if ((this.getWSDLReference() != null)
- && (fileLocation = this.getWSDLReference().getWSDLLocation()) != null)
- {
- if (!Utils.fileExists(fileLocation))
- throw new IllegalArgumentException(
- messageList.getMessage(
- "config03",
- fileLocation,
- "Could not find WSDL file:"));
- }
-
- File file = null;
- try
- {
- // Get file object for report file
- file = new File(this.getReportLocation());
- }
-
- catch (Exception e)
- {
- throw new IllegalArgumentException(
- messageList.getMessage(
- "config17",
- "Could not get report file location."));
- }
-
- // If replace flag is false and file exists, then throw exception
- if (file.exists() && !this.getReplaceReport())
- {
- throw new IllegalArgumentException(
- messageList.getMessage(
- "config15",
- "Report file already exists and replace option was not specified."));
- }
-
- if (correlationType != null
- && !this.correlationType.equals(
- WSIConstants.ATTRVAL_CORRELATION_TYPE_ENDPOINT)
- && !this.correlationType.equals(
- WSIConstants.ATTRVAL_CORRELATION_TYPE_NAMESPACE)
- && !this.correlationType.equals(
- WSIConstants.ATTRVAL_CORRELATION_TYPE_OPERATION))
- {
- throw new IllegalArgumentException(
- messageList.getMessage(
- "config18",
- "Invalid correlation type specified."));
- }
- }
-
- /**
- * Get option value.
- */
- private String getOptionValue(String[] args, int index) throws WSIException
- {
- return getOptionValue(args, index, args[index - 1]);
- }
-
- /**
- * Get option value.
- */
- private String getOptionValue(String[] args, int index, String optionName)
- throws WSIException
- {
- // If index greater than array length, then throw exception
- if (index >= args.length)
- {
- throw new IllegalArgumentException(
- getMessage(
- "config13",
- optionName,
- "Option did not contain a value. Specified option:"));
- }
-
- // If the value is an option (i.e. starts with a "-"), then throw exception
- if (args[index].startsWith("-"))
- {
- throw new IllegalArgumentException(
- getMessage(
- "config13",
- optionName,
- "Option did not contain a value. Specified option:"));
- }
-
- return (args[index]);
- }
-
- /**
- * Get message from resource bundle.
- */
- private String getMessage(String messageID, String defaultMessage)
- {
- return getMessage(messageID, null, defaultMessage);
- }
-
- /**
- * Get message from resource bundle.
- */
- private String getMessage(
- String messageID,
- String messageData,
- String defaultMessage)
- {
- String message = defaultMessage;
- if (messageList != null)
- message = messageList.getMessage(messageID, messageData, defaultMessage);
- else if (messageData != null)
- message += " " + messageData + ".";
-
- return message;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigReaderImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigReaderImpl.java
deleted file mode 100644
index 1a4de8679..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AnalyzerConfigReaderImpl.java
+++ /dev/null
@@ -1,559 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.Reader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.WSIException;
-import org.eclipse.wst.wsi.internal.core.WSIFileNotFoundException;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfig;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfigReader;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultType;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultsOption;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLElement;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference;
-import org.eclipse.wst.wsi.internal.core.common.AddStyleSheet;
-import org.eclipse.wst.wsi.internal.core.common.impl.AddStyleSheetImpl;
-import org.eclipse.wst.wsi.internal.core.util.EntryType;
-import org.eclipse.wst.wsi.internal.core.util.MessageList;
-import org.eclipse.wst.wsi.internal.core.util.TestUtils;
-import org.eclipse.wst.wsi.internal.core.xml.XMLUtils;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-
-/**
- * This class is the implementation used to read the analyzer config documents.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class AnalyzerConfigReaderImpl implements AnalyzerConfigReader
-{
- /**
- * Message list.
- */
- protected MessageList messageList;
-
- /**
- * Document location.
- */
- protected String documentURI;
-
- /**
- * Initialize analyzer config reader.
- */
- public void init(MessageList messageList)
- {
- this.messageList = messageList;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfigReader#readAnalyzerConfig(String)
- */
- public AnalyzerConfig readAnalyzerConfig(String analyzerConfigURI)
- throws WSIException
- {
- FileReader fileReader = null;
- try
- {
- fileReader = new FileReader(analyzerConfigURI);
- }
-
- catch (FileNotFoundException fnfe)
- {
- throw new WSIFileNotFoundException(
- getMessage(
- "config01",
- analyzerConfigURI,
- "Could not find analyzer config file: "),
- fnfe);
- }
-
- catch (Exception e)
- {
- throw new WSIException(
- getMessage(
- "config08",
- analyzerConfigURI,
- "Could not read analyzer config file: "),
- e);
- }
-
- return readAnalyzerConfig(fileReader);
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.AnalyzerConfigReader#readAnalyzerConfig(Reader)
- */
- public AnalyzerConfig readAnalyzerConfig(Reader reader) throws WSIException
- {
- AnalyzerConfig analyzerConfig = new AnalyzerConfigImpl();
-
- // Parse XML
- Document doc = XMLUtils.parseXML(reader);
-
- // Parse elements in the config document
- parseConfigElement(analyzerConfig, doc.getDocumentElement());
-
- return analyzerConfig;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.document.DocumentReader#getLocation()
- */
- public String getLocation()
- {
- return this.documentURI;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.document.DocumentReader#setLocation(String)
- */
- public void setLocation(String documentURI)
- {
- this.documentURI = documentURI;
- }
-
- /**
- * Parse config element.
- */
- private void parseConfigElement(
- AnalyzerConfig analyzerConfig,
- Element element)
- throws WSIException
- {
- // ADD: Get name and version
-
- // ADD: Verify that this is the config element
-
- // Get first child element
- Element nextElement = XMLUtils.getFirstChild(element);
-
- // DEBUG:
- //System.out.println("Element name: " + nextElement.getClass().getName());
-
- // Process each child element
- while (nextElement != null)
- {
- // <description>
- if (isElement(nextElement, WSIConstants.ELEM_DESCRIPTION))
- {
- analyzerConfig.setDescription(XMLUtils.getText(nextElement));
- }
-
- // <verbose>
- else if (isElement(nextElement, WSIConstants.ELEM_VERBOSE))
- {
- analyzerConfig.setVerboseOption(
- XMLUtils.getBooleanValue(nextElement, false));
- }
-
- // <assertionResults>
- else if (isElement(nextElement, WSIConstants.ELEM_ASSERTION_RESULTS))
- {
- // Create assertion results option object
- AssertionResultsOption assertionResultsOption =
- new AssertionResultsOptionImpl();
- analyzerConfig.setAssertionResultsOption(assertionResultsOption);
-
- // Set result type
- String resultType =
- XMLUtils.getAttributeValue(nextElement, WSIConstants.ATTR_TYPE);
- assertionResultsOption.setAssertionResultType(
- AssertionResultType.newInstance(resultType));
-
- // Set show log entry
- assertionResultsOption.setShowMessageEntry(
- XMLUtils.getBooleanValue(
- nextElement,
- WSIConstants.ATTR_MESSAGE_ENTRY,
- assertionResultsOption.getShowMessageEntry()));
-
- // Set show failure message
- assertionResultsOption.setShowFailureMessage(
- XMLUtils.getBooleanValue(
- nextElement,
- WSIConstants.ATTR_FAILURE_MESSAGE,
- assertionResultsOption.getShowFailureMessage()));
-
- // Set show failure detail
- assertionResultsOption.setShowFailureDetail(
- XMLUtils.getBooleanValue(
- nextElement,
- WSIConstants.ATTR_FAILURE_DETAIL,
- assertionResultsOption.getShowFailureDetail()));
-
- // REMOVE: Set show warning message
- //assertionResultsOption.setShowWarningMessage(XMLUtils.getBooleanValue(nextElement,
- // WSIConstants.ATTR_WARNING_MESSAGE, assertionResultsOption.getShowWarningMessage()));
- }
-
- // <reportFile>
- else if (isElement(nextElement, WSIConstants.ELEM_REPORT_FILE))
- {
- parseReportFileElement(analyzerConfig, nextElement);
- }
-
- // <testAssertionFile>
- else if (isElement(nextElement, WSIConstants.ELEM_TEST_ASSERTIONS_FILE))
- {
- analyzerConfig.setTestAssertionsDocumentLocation(
- XMLUtils.getText(nextElement));
- }
-
- // <logFile>
- else if (isElement(nextElement, WSIConstants.ELEM_LOG_FILE))
- {
- String correlationType =
- XMLUtils.getAttributeValue(
- nextElement,
- WSIConstants.ATTR_CORRELATION_TYPE);
- analyzerConfig.setCorrelationType(
- correlationType == null ? "operation" : correlationType);
- analyzerConfig.setLogLocation(XMLUtils.getText(nextElement));
- }
-
- // <wsdlReference>
- else if (isElement(nextElement, WSIConstants.ELEM_WSDL_REFERENCE))
- {
- parseWsdlReference(analyzerConfig, nextElement);
- }
-
- // <uddiReference>
- else if (isElement(nextElement, WSIConstants.ELEM_UDDI_REFERENCE))
- {
- parseUddiReference(analyzerConfig, nextElement);
- }
-
- else
- {
- // Throw exception
- throw new IllegalArgumentException(
- getMessage(
- "config06",
- nextElement.getLocalName(),
- "Invalid analyzer config element:"));
- }
-
- // Get next element
- nextElement = XMLUtils.getNextSibling(nextElement);
- }
- }
-
- /**
- * Parse reportFile element.
- */
- private void parseReportFileElement(
- AnalyzerConfig analyzerConfig,
- Element element)
- throws WSIException
- {
- // Get report location and replace indicator
- analyzerConfig.setReplaceReport(
- XMLUtils.getBooleanValue(element, WSIConstants.ATTR_REPLACE, false));
- analyzerConfig.setReportLocation(
- XMLUtils.getAttributeValue(
- element,
- WSIConstants.ATTR_LOCATION,
- WSIConstants.DEFAULT_REPORT_URI));
-
- // ADD: If the report location wasn't specified, then throw an exception
- //if (analyzerConfig.getReportLocation() == null)
- // throw new WSIException("The analyzer configuration file must contain the report file location.");
-
- // Get first child element
- Element nextElement = XMLUtils.getFirstChild(element);
-
- // Process each child element
- while (nextElement != null)
- {
- // <addStyleSheet>
- if (isElement(nextElement, WSIConstants.ELEM_ADD_STYLE_SHEET))
- {
- AddStyleSheet addStyleSheet = new AddStyleSheetImpl();
-
- // Parse the element
- TestUtils.parseAddStyleSheet(
- nextElement,
- addStyleSheet,
- WSIConstants.DEFAULT_REPORT_XSL);
-
- // Set add style sheet
- analyzerConfig.setAddStyleSheet(addStyleSheet);
- }
-
- else
- {
- // Throw exception
- throw new IllegalArgumentException(
- getMessage(
- "config06",
- nextElement.getLocalName(),
- "Invalid analyzer config element:"));
- }
-
- // Get next element
- nextElement = XMLUtils.getNextSibling(nextElement);
- }
- }
-
- /**
- * Parse wsdl reference element.
- */
- private void parseWsdlReference(
- AnalyzerConfig analyzerConfig,
- Element element)
- throws WSIException
- {
- // Create UDDI reference
- WSDLReference wsdlReference = new WSDLReferenceImpl();
-
- // Set WSDL reference
- analyzerConfig.setWSDLReference(wsdlReference);
-
- // Get first child element
- Element nextElement = XMLUtils.getFirstChild(element);
-
- // Process each child element
- while (nextElement != null)
- {
- // <wsdlURI>
- if (isElement(nextElement, WSIConstants.ELEM_WSDL_URI))
- {
- // Set WSDL location
- wsdlReference.setWSDLLocation(XMLUtils.getText(nextElement));
- }
-
- // <serviceLocation>
- else if (isElement(nextElement, WSIConstants.ELEM_SERVICE_LOCATION))
- {
- // Set service location
- wsdlReference.setServiceLocation(XMLUtils.getText(nextElement));
- }
-
- // <wsdlElement>
- else if (isElement(nextElement, WSIConstants.ELEM_WSDL_ELEMENT))
- {
- // Set WSDL element
- wsdlReference.setWSDLElement(parseWsdlElement(nextElement));
- }
-
- else
- {
- // Throw exception
- throw new IllegalArgumentException(
- getMessage(
- "config06",
- nextElement.getLocalName(),
- "Invalid analyzer config element:"));
- }
-
- // Get next element
- nextElement = XMLUtils.getNextSibling(nextElement);
- }
-
- // If WSDL element or WSL URI not specified, then throw exception
- if ((wsdlReference.getWSDLElement() == null)
- || (wsdlReference.getWSDLLocation() == null))
- {
- throw new IllegalArgumentException(
- getMessage(
- "config07",
- "Both the <wsdlElement> and <wsdlURI> elements must be specified."));
- }
-
- // If type is port or operation, then parent element name must be specified
- if (((wsdlReference
- .getWSDLElement()
- .getType()
- .equalsIgnoreCase(EntryType.TYPE_DESCRIPTION_PORT))
- || (wsdlReference
- .getWSDLElement()
- .getType()
- .equalsIgnoreCase(EntryType.TYPE_DESCRIPTION_OPERATION)))
- && (wsdlReference.getWSDLElement().getParentElementName() == null))
- {
- throw new IllegalArgumentException(
- getMessage(
- "config09",
- "The parentElementName attribute must be specified with a WSDL type of "
- + EntryType.TYPE_DESCRIPTION_PORT
- + " or "
- + EntryType.TYPE_DESCRIPTION_OPERATION
- + "."));
- }
- }
-
- /**
- * Parse uddi reference.
- */
- private void parseUddiReference(
- AnalyzerConfig analyzerConfig,
- Element element)
- throws WSIException
- {
- // Create UDDI reference
- UDDIReference uddiReference = new UDDIReferenceImpl();
-
- // Set UDDI reference
- analyzerConfig.setUDDIReference(uddiReference);
-
- // Get first child element
- Element nextElement = XMLUtils.getFirstChild(element);
-
- // Process each child element
- while (nextElement != null)
- {
- // <inquiryURL>
- if (isElement(nextElement, WSIConstants.ELEM_INQUIRY_URL))
- {
- // Set inquiry URL
- uddiReference.setInquiryURL(XMLUtils.getText(nextElement));
- }
-
- // <uddiKey>
- else if (isElement(nextElement, WSIConstants.ELEM_UDDI_KEY))
- {
- // Set UDDI key and key type
- uddiReference.setKey(XMLUtils.getText(nextElement));
- uddiReference.setKeyType(
- XMLUtils.getAttributeValue(nextElement, WSIConstants.ATTR_TYPE));
- }
-
- // <wsdlElement>
- else if (isElement(nextElement, WSIConstants.ELEM_WSDL_ELEMENT))
- {
- // Set WSDL element
- uddiReference.setWSDLElement(parseWsdlElement(nextElement));
- }
-
- // <serviceLocation>
- else if (isElement(nextElement, WSIConstants.ELEM_SERVICE_LOCATION))
- {
- // Set service location
- uddiReference.setServiceLocation(XMLUtils.getText(nextElement));
- }
-
- /* REMOVE:
- // <wsdlElement>
- else if (isElement(nextElement, WSIConstants.ELEM_WSDL_ELEMENT)) {
- // Set service location
- parseWsdlElement(analyzerConfig, nextElement);
- }
- */
-
- else
- {
- // Throw exception
- throw new IllegalArgumentException(
- getMessage(
- "config06",
- nextElement.getLocalName(),
- "Invalid analyzer config element:"));
- }
-
- // Get next element
- nextElement = XMLUtils.getNextSibling(nextElement);
- }
- }
-
- /**
- * Parse WSDL element.
- */
- private WSDLElement parseWsdlElement(Element element) throws WSIException
- {
- WSDLElement wsdlElement = new WSDLElementImpl();
-
- // Set type, namespace, parent element name and name
- wsdlElement.setType(
- XMLUtils.getAttributeValue(element, WSIConstants.ATTR_TYPE));
- wsdlElement.setNamespace(
- XMLUtils.getAttributeValue(element, WSIConstants.ATTR_NAMESPACE));
- wsdlElement.setParentElementName(
- XMLUtils.getAttributeValue(
- element,
- WSIConstants.ATTR_PARENT_ELEMENT_NAME));
-
- String wsdlElementName = XMLUtils.getText(element);
- if (wsdlElementName.equals(""))
- {
- // Throw exception
- throw new IllegalArgumentException(
- getMessage("config19", "The WSDL element name must be specified."));
- }
- wsdlElement.setName(wsdlElementName);
-
- return wsdlElement;
- }
-
- /**
- * Determine if this element matches specified local name in the analyzer config namespace.
- */
- private boolean isElement(Element element, String localName)
- {
- return isElement(
- element,
- getValidWSIAnalyzerConfigNamespaces(),
- localName);
- }
-
-
- static public List getValidWSIAnalyzerConfigNamespaces()
- {
- ArrayList list = new ArrayList();
- list.add(WSIConstants.NS_URI_WSI_ANALYZER_CONFIG_2003);
- list.add(WSIConstants.NS_URI_WSI_ANALYZER_CONFIG);
- return list;
- }
-
- /**
- * Determine if this element matches specified local name in the analyzer config namespace.
- */
- private boolean isElement(
- Element element,
- List namespaces,
- String localName)
- {
- return XMLUtils.isElement(element, namespaces, localName);
- }
-
- /**
- * Get message from resource bundle.
- */
- private String getMessage(String messageID, String defaultMessage)
- {
- return getMessage(messageID, null, defaultMessage);
- }
-
- /**
- * Get message from resource bundle.
- */
- private String getMessage(
- String messageID,
- String messageData,
- String defaultMessage)
- {
- String message = defaultMessage;
- if (messageList != null)
- message = messageList.getMessage(messageID, messageData, defaultMessage);
- else
- message += " " + messageData + ".";
-
- return message;
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AssertionResultsOptionImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AssertionResultsOptionImpl.java
deleted file mode 100644
index fbe3d0f74..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/AssertionResultsOptionImpl.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2003 IBM Corporation, Parasoft and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- * Parasoft - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultType;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.AssertionResultsOption;
-
-/**
- * This class contains the assertion results option definition.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class AssertionResultsOptionImpl implements AssertionResultsOption
-{
- /**
- * Assertion result type.
- */
- protected AssertionResultType resultType = AssertionResultType.ALL;
-
- /**
- * Show message entry indicator.
- */
- protected boolean showMessageEntry = true;
-
- /**
- * Show assertion description indicator.
- */
- protected boolean showAssertionDescription = false;
-
- /**
- * Show failure message indicator.
- */
- protected boolean showFailureMessage = true;
-
- /**
- * Show failure detail indicator.
- */
- protected boolean showFailureDetail = true;
-
- /**
- * Get assertion result type.
- * @see #setAssertionResultType
- */
- public AssertionResultType getAssertionResultType()
- {
- return resultType;
- }
-
- /**
- * Set assertion result type.
- * @see #getAssertionResultType
- */
- public void setAssertionResultType(AssertionResultType resultType)
- {
- this.resultType = resultType;
- }
-
- /**
- * Get show message entry indicator.
- * @see #setShowMessageEntry
- */
- public boolean getShowMessageEntry()
- {
- return this.showMessageEntry;
- }
-
- /**
- * Set show message entry indictor.
- * @see #getShowMessageEntry
- */
- public void setShowMessageEntry(boolean showMessageEntry)
- {
- this.showMessageEntry = showMessageEntry;
- }
-
- /**
- * Get show assertion description indicator.
- * @see #setShowAssertionDescription
- */
- public boolean getShowAssertionDescription()
- {
- return this.showAssertionDescription;
- }
-
- /**
- * Set show assertion description indictor.
- * @see #getShowAssertionDescription
- */
- public void setShowAssertionDescription(boolean showAssertionDescription)
- {
- this.showAssertionDescription = showAssertionDescription;
- }
-
- /**
- * Get show failure message indicator.
- * @see #setShowFailureMessage
- */
- public boolean getShowFailureMessage()
- {
- return this.showFailureMessage;
- }
-
- /**
- * Set show failure mesage indicator.
- * @see #getShowFailureMessage
- */
- public void setShowFailureMessage(boolean showFailureMessage)
- {
- this.showFailureMessage = showFailureMessage;
- }
-
- /**
- * Get show failure detail indicator.
- * @see #setShowFailureDetail
- */
- public boolean getShowFailureDetail()
- {
- return this.showFailureDetail;
- }
-
- /**
- * Set show failure detail indicator.
- * @see #getShowFailureDetail
- */
- public void setShowFailureDetail(boolean showFailureDetail)
- {
- this.showFailureDetail = showFailureDetail;
- }
-
- /**
- * Get string representation of this object.
- */
- public String toString()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println(" Assertion Results:");
- pw.println(" type ..................... " + this.resultType);
- pw.println(" messageEntry ............. " + this.showMessageEntry);
- pw.println(
- " assertionDescription ..... " + this.showAssertionDescription);
- pw.println(" failureMessage ........... " + this.showFailureMessage);
- pw.println(" failureDetail ............ " + this.showFailureDetail);
-
- return sw.toString();
- }
-
- /**
- * Get representation of this object as an XML string.
- */
- public String toXMLString(String namespaceName)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String nsName = namespaceName;
- if ((!nsName.equals("") && (!nsName.endsWith(":"))))
- nsName += ":";
-
- // Config options
- pw.print(" <" + nsName + WSIConstants.ELEM_ASSERTION_RESULTS + " ");
- pw.print(WSIConstants.ATTR_TYPE + "=\"" + getAssertionResultType() + "\" ");
- pw.print(
- WSIConstants.ATTR_MESSAGE_ENTRY + "=\"" + getShowMessageEntry() + "\" ");
- pw.print(
- WSIConstants.ATTR_ASSERTION_DESCRIPTION
- + "=\""
- + getShowAssertionDescription()
- + "\" ");
- pw.print(
- WSIConstants.ATTR_FAILURE_MESSAGE
- + "=\""
- + getShowFailureMessage()
- + "\" ");
- pw.println(
- WSIConstants.ATTR_FAILURE_DETAIL
- + "=\""
- + getShowFailureDetail()
- + "\"/>");
- // REMOVE:
- //pw.println(WSIConstants.ATTR_WARNING_MESSAGE + "=\"" + getShowWarningMessage() + "\"/>");
-
- return sw.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/UDDIReferenceImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/UDDIReferenceImpl.java
deleted file mode 100644
index 8dc7b6c72..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/UDDIReferenceImpl.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- *
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLElement;
-
-/**
- * The iimplementation for a reference to a discovery artifact.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class UDDIReferenceImpl implements UDDIReference
-{
- /**
- * UDDI key type.
- */
- protected String keyType = null;
-
- /**
- * UDDI key.
- */
- protected String key = null;
-
- /**
- * UDDI inquiry URL.
- */
- protected String inquiryURL = null;
-
- /**
- * WSDL element.
- */
- protected WSDLElement wsdlElement = null;
-
- /**
- * Service location.
- */
- protected String serviceLocation = null;
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#getKeyType()
- */
- public String getKeyType()
- {
- return this.keyType;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#setKeyType(String)
- */
- public void setKeyType(String keyType)
- {
- if (keyType.equals(BINDING_KEY) || keyType.equals(TMODEL_KEY))
- this.keyType = keyType;
- else
- throw new IllegalArgumentException(
- "Invalid UDDI key type: [" + keyType + "].");
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#getKey()
- */
- public String getKey()
- {
- return this.key;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#setKey(String)
- */
- public void setKey(String key)
- {
- this.key = key;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#getInquiryURL()
- */
- public String getInquiryURL()
- {
- return this.inquiryURL;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.UDDIReference#setInquiryURL(String)
- */
- public void setInquiryURL(String inquiryURL)
- {
- this.inquiryURL = inquiryURL;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#getWSDLElement()
- */
- public WSDLElement getWSDLElement()
- {
- return this.wsdlElement;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#setWSDLElement(WSDLElement)
- */
- public void setWSDLElement(WSDLElement wsdlElement)
- {
- this.wsdlElement = wsdlElement;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#getServiceLocation()
- */
- public String getServiceLocation()
- {
- return this.serviceLocation;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#setServiceLocation()
- */
- public void setServiceLocation(String serviceLocation)
- {
- this.serviceLocation = serviceLocation;
- }
-
- /**
- * Get string representation of this object.
- */
- public String toString()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println(" UDDI Reference: ");
- pw.println(" UDDI Key: ");
- pw.println(" type ................... " + this.keyType);
- pw.println(" key .................... " + this.key);
- pw.println(" inquiryURL ............... " + this.inquiryURL);
- if (this.serviceLocation != null)
- pw.println(" serviceLocation .......... " + this.serviceLocation);
- if (this.wsdlElement != null)
- pw.print(this.wsdlElement.toString());
-
- return sw.toString();
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.document.DocumentElement#toXMLString(String)
- */
- public String toXMLString(String namespaceName)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String nsName = namespaceName;
- if ((!nsName.equals("") && (!nsName.endsWith(":"))))
- nsName += ":";
-
- // Element
- pw.println(" <" + nsName + ELEM_NAME + ">");
- pw.print(" <" + nsName + WSIConstants.ELEM_UDDI_KEY + " ");
- pw.print(WSIConstants.ATTR_TYPE + "=\"" + getKeyType() + "\">");
- pw.print(getKey());
- pw.println("</" + nsName + WSIConstants.ELEM_UDDI_KEY + ">");
- pw.print(" <" + nsName + WSIConstants.ELEM_INQUIRY_URL + ">");
- pw.print(getInquiryURL());
- pw.println("</" + nsName + WSIConstants.ELEM_INQUIRY_URL + ">");
-
- if (this.wsdlElement != null)
- pw.print(getWSDLElement().toXMLString(nsName));
-
- if (this.serviceLocation != null)
- {
- pw.print(" <" + nsName + WSIConstants.ELEM_SERVICE_LOCATION + ">");
- pw.print(getServiceLocation());
- pw.println(
- " </" + nsName + WSIConstants.ELEM_SERVICE_LOCATION + ">");
- }
-
- pw.println(" </" + nsName + ELEM_NAME + ">");
-
- return sw.toString();
- }
-
-}
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLElementImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLElementImpl.java
deleted file mode 100644
index ff14b85d9..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLElementImpl.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLElement;
-import org.eclipse.wst.wsi.internal.core.util.EntryType;
-
-/**
- * The implementation for WSDL definitions.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class WSDLElementImpl implements WSDLElement
-{
- protected String type;
- protected String namespace;
- protected String name;
- protected String parentElementName;
-
- /**
- * @see #setType
- */
- public String getType()
- {
- return this.type;
- }
-
- /**
- * @see #getType
- */
- public void setType(String type)
- {
- this.type = type;
- }
-
- /**
- * @see #setNamespace
- */
- public String getNamespace()
- {
- return this.namespace;
- }
-
- /**
- * @see #getNamespace
- */
- public void setNamespace(String namespace)
- {
- this.namespace = namespace;
- }
-
- /**
- * @see #setName
- */
- public String getName()
- {
- return this.name;
- }
-
- /**
- * @see #getName
- */
- public void setName(String name)
- {
- this.name = name;
- }
-
- public QName getQName()
- {
- return new QName(this.namespace, this.name);
- }
-
- /**
- * Get WSDL parent element name.
- * @see #setParentElementName
-
- */
- public String getParentElementName()
- {
- return this.parentElementName;
- }
-
- /**
- * Set WSDL parent element name.
- * @see #getParentElementName
- */
- public void setParentElementName(String parentElementName)
- {
- this.parentElementName = parentElementName;
- }
-
- /**
- * @see org.eclipse.wst.wsi.test.analyzer.config.WSDLElement#getParentElementQName()
- */
- public QName getParentElementQName()
- {
- return new QName(this.namespace, this.parentElementName);
- }
-
- /**
- * Is port element.
- */
- public boolean isPort()
- {
- return type.equals(EntryType.TYPE_DESCRIPTION_PORT);
- }
-
- /**
- * Is binding element.
- */
- public boolean isBinding()
- {
- return type.equals(EntryType.TYPE_DESCRIPTION_BINDING);
- }
-
- /**
- * Is portType element.
- */
- public boolean isPortType()
- {
- return type.equals(EntryType.TYPE_DESCRIPTION_PORTTYPE);
- }
-
- /**
- * Is operation element.
- */
- public boolean isOperation()
- {
- return type.equals(EntryType.TYPE_DESCRIPTION_OPERATION);
- }
-
- /**
- * Is message element.
- */
- public boolean isMessage()
- {
- return type.equals(EntryType.TYPE_DESCRIPTION_MESSAGE);
- }
-
- /**
- * Get string representation of this object.
- */
- public String toString()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println(" WSDL Element: ");
- pw.println(" type ................... " + this.type);
- pw.println(" namespace .............. " + this.namespace);
- pw.println(" name ................... " + this.name);
-
- if (this.parentElementName != null)
- pw.println(" parentElementName ...... " + this.parentElementName);
-
- return sw.toString();
- }
-
- /**
- * Get representation of this object as an XML string.
- */
- public String toXMLString(String namespaceName)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String nsName = namespaceName;
- if ((!nsName.equals("") && (!nsName.endsWith(":"))))
- nsName += ":";
-
- // Config options
- pw.print(" <" + nsName + ELEM_NAME + " ");
- pw.print(WSIConstants.ATTR_TYPE + "=\"" + getType() + "\" ");
- pw.print(WSIConstants.ATTR_NAMESPACE + "=\"" + getNamespace() + "\" ");
- if (this.parentElementName != null)
- pw.print(
- WSIConstants.ATTR_PARENT_ELEMENT_NAME
- + "=\""
- + getParentElementName()
- + "\"");
- pw.print(">");
- pw.print(getName());
- pw.println("</" + nsName + ELEM_NAME + ">");
-
- return sw.toString();
- }
-}
diff --git a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLReferenceImpl.java b/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLReferenceImpl.java
deleted file mode 100644
index 64bff4363..000000000
--- a/bundles/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/analyzer/config/impl/WSDLReferenceImpl.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2002-2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.wsi.internal.core.analyzer.config.impl;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import org.eclipse.wst.wsi.internal.core.WSIConstants;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLElement;
-import org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference;
-import org.eclipse.wst.wsi.internal.core.xml.XMLUtils;
-
-/**
- * The implementation for a reference to a description artifact.
- *
- * @version 1.0.1
- * @author Peter Brittenham (peterbr@us.ibm.com)
- */
-public class WSDLReferenceImpl implements WSDLReference
-{
- /**
- * WSDL element.
- */
- protected WSDLElement wsdlElement = null;
-
- /**
- * Service location.
- */
- protected String serviceLocation = null;
-
- /**
- * WSDL document location.
- */
- protected String wsdlLocation = null;
-
- /**
- * Default constructor.
- */
- public WSDLReferenceImpl()
- {
- }
-
- /**
- * Constructor with all settings.
- * @param wsdlElement a WSDL element.
- * @param wsdlLocation a WSDL document location.
- * @param serviceLocation a service location.
- */
- public WSDLReferenceImpl(
- WSDLElement wsdlElement,
- String wsdlLocation,
- String serviceLocation)
- {
- this.wsdlElement = wsdlElement;
- this.wsdlLocation = wsdlLocation;
- this.serviceLocation = serviceLocation;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#getWSDLElement()
- */
- public WSDLElement getWSDLElement()
- {
- return this.wsdlElement;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#setWSDLElement(WSDLElement)
- */
- public void setWSDLElement(WSDLElement wsdlElement)
- {
- this.wsdlElement = wsdlElement;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#getWSDLLocation()
- */
- public String getWSDLLocation()
- {
- return this.wsdlLocation;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#setWSDLLocation()
- */
- public void setWSDLLocation(String wsdlLocation)
- {
- this.wsdlLocation = wsdlLocation;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#getServiceLocation()
- */
- public String getServiceLocation()
- {
- return this.serviceLocation;
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.analyzer.config.WSDLReference#setServiceLocation()
- */
- public void setServiceLocation(String serviceLocation)
- {
- this.serviceLocation = serviceLocation;
- }
-
- /**
- * Get string representation of this object.
- */
- public String toString()
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- pw.println(" WSDL Reference:");
- pw.print(this.wsdlElement.toString());
- pw.println(" wsdlURI .................. " + this.wsdlLocation);
- if (this.serviceLocation != null)
- pw.println(" serviceLocation .......... " + this.serviceLocation);
-
- return sw.toString();
- }
-
- /**
- * @see org.eclipse.wst.wsi.internal.core.document.DocumentElement#toXMLString(String)
- */
- public String toXMLString(String namespaceName)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
-
- String nsName = namespaceName;
- if ((!nsName.equals("") && (!nsName.endsWith(":"))))
- nsName += ":";
-
- // Element
- pw.println(" <" + nsName + ELEM_NAME + ">");
- pw.print(getWSDLElement().toXMLString(nsName));
- pw.print(" <" + nsName + WSIConstants.ELEM_WSDL_URI + ">");
- pw.print(getWSDLLocation());
- pw.println("</" + nsName + WSIConstants.ELEM_WSDL_URI + ">");
-
- if (this.serviceLocation != null)
- {
- pw.print(" <" + nsName + WSIConstants.ELEM_SERVICE_LOCATION + ">");
- pw.print(XMLUtils.xmlEscapedString(getServiceLocation()));
- pw.println("</" + nsName + WSIConstants.ELEM_SERVICE_LOCATION + ">");
- }
-
- pw.println(" </" + nsName + ELEM_NAME + ">");
-
- return sw.toString();
- }
-
-}

Back to the top