blob: 78eeb195f9d7572f33b064acca3cee1a8ad7fc59 [file] [log] [blame]
/**********************************************************************
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved.   This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
 *
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.eclipse.wst.wsdl.tests.performance;
import java.net.URL;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.test.performance.PerformanceTestCase;
import org.eclipse.wst.ws.internal.ui.plugin.WSUIPlugin;
import org.eclipse.wst.ws.internal.ui.wsi.preferences.PersistentWSIContext;
import org.eclipse.wst.wsdl.validation.internal.IValidationReport;
import org.eclipse.wst.wsdl.validation.internal.ui.eclipse.WSDLValidator;
public class ValidateStockQuoteWSDLTestCase extends PerformanceTestCase
{
private WSDLValidator validator;
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception
{
super.setUp();
// Set the WS-I preference to ignore so only WSDL errors will be tested.
WSUIPlugin wsui = WSUIPlugin.getInstance();
PersistentWSIContext wsicontext = wsui.getWSISSBPContext();
wsicontext.updateWSICompliances(PersistentWSIContext.IGNORE_NON_WSI);
wsicontext = wsui.getWSIAPContext();
wsicontext.updateWSICompliances(PersistentWSIContext.IGNORE_NON_WSI);
}
public static Test suite()
{
return new TestSuite(ValidateStockQuoteWSDLTestCase.class, "ValidateStockQuoteWSDLTestCase");
}
public void testValidateStockQuoteWSDL() throws Exception
{
validator = WSDLValidator.getInstance();
URL wsdl = PerformancePlugin.getDefault().getBundle().getEntry("data/StockQuote/StockQuote.wsdl");
String path = wsdl.toString();
startMeasuring();
IValidationReport valreport = validator.validate(path);
stopMeasuring();
commitMeasurements();
assertPerformance();
}
}