Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 124398 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/wsi/internal/WSITestToolsEclipseProperties.java (-1 / +38 lines)
Lines 14-19 Link Here
14
import org.eclipse.core.resources.IProject;
14
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.ResourcesPlugin;
15
import org.eclipse.core.resources.ResourcesPlugin;
16
import org.eclipse.core.runtime.Path;
16
import org.eclipse.core.runtime.Path;
17
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
18
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
17
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
19
import org.eclipse.wst.ws.internal.plugin.WSPlugin;
18
import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext;
20
import org.eclipse.wst.ws.internal.preferences.PersistentWSIContext;
19
21
Lines 27-34 Link Here
27
  */
29
  */
28
  public static WSIPreferences checkWSIPreferences(String fileuri)
30
  public static WSIPreferences checkWSIPreferences(String fileuri)
29
  {
31
  {
32
	// Cache the WS-I tads.
33
	cacheTADFiles();
34
	
30
    WSIPreferences preferences = new WSIPreferences();
35
    WSIPreferences preferences = new WSIPreferences();
31
    
32
    // Remove file: and any slashes from the fileuri. 
36
    // Remove file: and any slashes from the fileuri. 
33
    // Eclipse's resolution mechanism needs to start with the drive.
37
    // Eclipse's resolution mechanism needs to start with the drive.
34
    String uriStr = trimURI(fileuri);
38
    String uriStr = trimURI(fileuri);
Lines 101-105 Link Here
101
    }
105
    }
102
    return preferences;
106
    return preferences;
103
  }
107
  }
108
  
109
  protected static void cacheTADFiles()
110
  {
111
	  String resultAP = cacheFile(AP_ASSERTION_FILE);
112
	  if(resultAP != null)
113
	  {
114
		  AP_ASSERTION_FILE = resultAP;
115
	  }
116
	  
117
	  String resultSSBP = cacheFile(SSBP_ASSERTION_FILE);
118
	  if(resultSSBP != null)
119
	  {
120
		  SSBP_ASSERTION_FILE = resultSSBP;
121
	  }
122
  }
123
  
124
  protected static String cacheFile(String uri)
125
  {
126
	  URIResolver resolver = getURIResolver();
127
	  String resolvedUri = resolver.resolve("", null, uri);
128
	  return resolver.resolvePhysicalLocation("", null, resolvedUri);
129
  }
130
  
131
  /**
132
   * Get the URI resolver to use for WS-I validaiton.
133
   * 
134
   * @return
135
   * 		The URI resolver to use for WS-I validation.
136
   */
137
  public static URIResolver getURIResolver()
138
  {
139
	  return URIResolverPlugin.createResolver();
140
  }
104
141
105
}
142
}
(-)src/org/eclipse/wst/wsi/internal/WSITestToolsProperties.java (-2 / +2 lines)
Lines 19-26 Link Here
19
  protected static String tadfile = "";
19
  protected static String tadfile = "";
20
20
21
  public final static String schemaDir = "common/schemas/";
21
  public final static String schemaDir = "common/schemas/";
22
  public final static String SSBP_ASSERTION_FILE = "http://www.ws-i.org/Testing/Tools/2005/01/SSBP10_BP11_TAD_1-0.xml";
22
  public static String SSBP_ASSERTION_FILE = "http://www.ws-i.org/Testing/Tools/2005/01/SSBP10_BP11_TAD_1-0.xml";
23
  public final static String AP_ASSERTION_FILE = "http://www.ws-i.org/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml";
23
  public static String AP_ASSERTION_FILE = "http://www.ws-i.org/Testing/Tools/2004/12/AP10_BP11_SSBP10_TAD.xml";
24
  public final static String DEFAULT_ASSERTION_FILE = AP_ASSERTION_FILE;
24
  public final static String DEFAULT_ASSERTION_FILE = AP_ASSERTION_FILE;
25
  
25
  
26
  public static final String STOP_NON_WSI = "0";
26
  public static final String STOP_NON_WSI = "0";
(-)src/org/eclipse/wst/wsi/internal/core/profile/impl/ProfileAssertionsReaderImpl.java (-3 / +44 lines)
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.wsi.internal.core.profile.impl;
11
package org.eclipse.wst.wsi.internal.core.profile.impl;
12
12
13
import java.io.IOException;
13
import java.io.Reader;
14
import java.io.Reader;
15
import java.net.URL;
14
import java.util.Iterator;
16
import java.util.Iterator;
15
import java.util.LinkedList;
17
import java.util.LinkedList;
16
import java.util.List;
18
import java.util.List;
17
import java.util.TreeMap;
19
import java.util.TreeMap;
18
20
21
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
22
import org.eclipse.wst.wsi.internal.WSITestToolsEclipseProperties;
23
import org.eclipse.wst.wsi.internal.WSITestToolsProperties;
19
import org.eclipse.wst.wsi.internal.core.WSIConstants;
24
import org.eclipse.wst.wsi.internal.core.WSIConstants;
20
import org.eclipse.wst.wsi.internal.core.WSIException;
25
import org.eclipse.wst.wsi.internal.core.WSIException;
21
import org.eclipse.wst.wsi.internal.core.profile.EntryTypeList;
26
import org.eclipse.wst.wsi.internal.core.profile.EntryTypeList;
Lines 27-33 Link Here
27
import org.eclipse.wst.wsi.internal.core.util.Utils;
32
import org.eclipse.wst.wsi.internal.core.util.Utils;
28
import org.eclipse.wst.wsi.internal.core.xml.XMLUtils;
33
import org.eclipse.wst.wsi.internal.core.xml.XMLUtils;
29
import org.xml.sax.Attributes;
34
import org.xml.sax.Attributes;
35
import org.xml.sax.EntityResolver;
30
import org.xml.sax.InputSource;
36
import org.xml.sax.InputSource;
37
import org.xml.sax.SAXException;
31
import org.xml.sax.XMLReader;
38
import org.xml.sax.XMLReader;
32
import org.xml.sax.helpers.DefaultHandler;
39
import org.xml.sax.helpers.DefaultHandler;
33
40
Lines 93-99 Link Here
93
100
94
      // Set content handler to inner class
101
      // Set content handler to inner class
95
      reader.setContentHandler(new ProfileAssertionsHandler());
102
      reader.setContentHandler(new ProfileAssertionsHandler());
103
      
104
      if(WSITestToolsProperties.getEclipseContext())
105
      {
106
    	  EntityResolver resolver = new EntityResolver(){
96
107
108
			public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
109
				URIResolver resolver = WSITestToolsEclipseProperties.getURIResolver();
110
				String uri = resolver.resolve("", publicId, systemId);
111
				String physicalLocation = resolver.resolvePhysicalLocation("", publicId, uri);
112
				InputSource is = null;
113
				try
114
				{
115
					URL url = new URL(physicalLocation);
116
					is = new InputSource(uri);
117
					is.setByteStream(url.openStream());
118
				}
119
				catch(Exception e)
120
				{
121
					// Do nothing if opening the stream fails.
122
				}
123
				return is;
124
			}
125
    		  
126
    	  };
127
    	  reader.setEntityResolver(resolver);
128
      }
97
      // Parse profile definition file
129
      // Parse profile definition file
98
      reader.parse(inputSource);
130
      reader.parse(inputSource);
99
    }
131
    }
Lines 107-121 Link Here
107
      //Check to see if the version of test asssertion document is supported
139
      //Check to see if the version of test asssertion document is supported
108
      if (!Utils.isValidProfileTADVersion(profileAssertions))
140
      if (!Utils.isValidProfileTADVersion(profileAssertions))
109
      {
141
      {
110
        throw new WSIException(
142
    	String tadVersion = profileAssertions.getTADVersion();
143
    	if(tadVersion != null)
144
    	{
145
    	  String tadName = profileAssertions.getTADName();
146
          throw new WSIException(
111
          "\nVersion "
147
          "\nVersion "
112
            + profileAssertions.getTADVersion()
148
            + tadVersion
113
            + " of the \""
149
            + " of the \""
114
            + profileAssertions.getTADName()
150
            + tadName
115
            + "\"\n"
151
            + "\"\n"
116
            + "document is not compatible with this version of"
152
            + "document is not compatible with this version of"
117
            + "\n"
153
            + "\n"
118
            + "the test tools.");
154
            + "the test tools.");
155
    	}
156
    	else
157
    	{
158
    	  throw new WSIException("WS-I validation was unable to run. Unable to read the test assertion document.");
159
    	}
119
      }
160
      }
120
    }
161
    }
121
162
(-)src/org/eclipse/wst/wsi/internal/validate/wsdl/WSDLValidator.java (-1 / +1 lines)
Lines 296-302 Link Here
296
	  catch (WSIAnalyzerException e)
296
	  catch (WSIAnalyzerException e)
297
	  {
297
	  {
298
		// TODO: Add code to log error 
298
		// TODO: Add code to log error 
299
		System.out.println("Unable to run WS-I WSDL conformance check.\n" + e);
299
		valInfo.addWarning(WSIConstants.WSI_PREFIX + "A problem occured while running the WS-I WSDL conformance check: " + e, 1, 0, valInfo.getFileURI());
300
	  }
300
	  }
301
    }
301
    }
302
  }
302
  }

Return to bug 124398