You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2016/12/23 15:56:43 UTC
[2/3] cxf git commit: [CXF-7195] Removing rt-databindings-xmlbeans
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java b/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
deleted file mode 100644
index 3bbedcf..0000000
--- a/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.xmlbeans.tools;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-
-import org.apache.cxf.common.jaxb.JAXBUtils;
-import org.apache.cxf.helpers.IOUtils;
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.cxf.tools.common.ToolConstants;
-import org.apache.cxf.tools.common.ToolContext;
-import org.apache.cxf.tools.common.ToolException;
-import org.apache.cxf.tools.common.model.DefaultValueWriter;
-import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
-import org.apache.ws.commons.schema.constants.Constants;
-import org.apache.xmlbeans.SchemaGlobalElement;
-import org.apache.xmlbeans.SchemaProperty;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.SchemaTypeLoader;
-import org.apache.xmlbeans.SchemaTypeSystem;
-import org.apache.xmlbeans.SimpleValue;
-import org.apache.xmlbeans.XmlBeans;
-import org.apache.xmlbeans.XmlError;
-import org.apache.xmlbeans.XmlErrorCodes;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.impl.common.ResolverUtil;
-import org.apache.xmlbeans.impl.common.XmlErrorWatcher;
-import org.apache.xmlbeans.impl.config.BindingConfigImpl;
-import org.apache.xmlbeans.impl.schema.PathResourceLoader;
-import org.apache.xmlbeans.impl.schema.SchemaTypeLoaderImpl;
-import org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler;
-import org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl;
-import org.apache.xmlbeans.impl.schema.StscState;
-import org.apache.xmlbeans.impl.tool.CodeGenUtil;
-import org.apache.xmlbeans.impl.util.FilerImpl;
-import org.apache.xmlbeans.impl.xb.substwsdl.TImport;
-import org.apache.xmlbeans.impl.xb.xmlconfig.ConfigDocument;
-import org.apache.xmlbeans.impl.xb.xmlconfig.Extensionconfig;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
-import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument.Schema;
-
-/**
- *
- */
-public class XMLBeansToolingDataBinding implements DataBindingProfile {
- private static final String CONFIG_URI = "http://xml.apache.org/xmlbeans/2004/02/xbean/config";
- private static final String COMPATIBILITY_CONFIG_URI = "http://www.bea.com/2002/09/xbean/config";
- private static final Map<String, String> MAP_COMPATIBILITY_CONFIG_URIS;
- static {
- MAP_COMPATIBILITY_CONFIG_URIS = new HashMap<String, String>();
- MAP_COMPATIBILITY_CONFIG_URIS.put(COMPATIBILITY_CONFIG_URI, CONFIG_URI);
- }
-
- SchemaTypeSystem typeSystem;
- SchemaTypeLoader typeLoader;
- Map<String, String> sourcesToCopyMap = new HashMap<String, String>();
- List<XmlError> errors = new LinkedList<XmlError>();
- XmlErrorWatcher errorListener = new XmlErrorWatcher(errors);
- PathResourceLoader cpResourceLoader = new PathResourceLoader(CodeGenUtil.systemClasspath());
- StscState state;
-
-
- public void initialize(ToolContext context) throws ToolException {
- context.put(ToolConstants.RUNTIME_DATABINDING_CLASS,
- "org.apache.cxf.xmlbeans.XmlBeansDataBinding.class");
-
- String wsdl = (String)context.get(ToolConstants.CFG_WSDLURL);
- String catalog = (String)context.get(ToolConstants.CFG_CATALOG);
-
- Object o = context.get(ToolConstants.CFG_BINDING);
- String bindingFiles[];
- if (o instanceof String) {
- bindingFiles = new String[] {o.toString()};
- } else {
- bindingFiles = (String[])o;
- }
-
- // build the in-memory type system
- state = StscState.start();
- // construct the state (have to initialize early in case of errors)
- state.setErrorListener(errorListener);
-
- EntityResolver cmdLineEntRes = ResolverUtil.resolverForCatalog(catalog);
- typeSystem = loadTypeSystem(wsdl,
- bindingFiles,
- null,
- null,
- null,
- cmdLineEntRes);
- StscState.end();
- }
-
- public DefaultValueWriter createDefaultValueWriter(QName qn, boolean element) {
- return null;
- }
-
- public DefaultValueWriter createDefaultValueWriterForWrappedElement(QName wrapperElement, QName qn) {
- return null;
- }
-
- public String getType(QName qn, boolean element) {
- String ret;
- if (element) {
- SchemaType type = typeSystem.findDocumentType(qn);
- if (type == null) {
- type = typeLoader.findDocumentType(qn);
- }
- if (type == null) {
- return null;
- }
-
- ret = type.getFullJavaName();
- if (ret.contains("$")) {
- ret = ret.substring(0, ret.indexOf('$'));
- }
- return ret;
- }
-
- SchemaType type = typeSystem.findType(qn);
- if (type == null) {
- type = typeLoader.findType(qn);
- }
-
- if (type == null
- && Constants.URI_2001_SCHEMA_XSD.equals(qn.getNamespaceURI())) {
- return JAXBUtils.builtInTypeToJavaType(qn.getLocalPart());
- }
- if (type == null) {
- return null;
- }
- ret = type.getFullJavaName();
- return ret.replace('$', '.');
- }
-
- public String getWrappedElementType(QName wrapperElement, QName item) {
- SchemaGlobalElement elem = typeSystem.findElement(wrapperElement);
-
- if (elem == null) {
- elem = typeLoader.findElement(wrapperElement);
- }
-
- SchemaType st = elem.getType();
- SchemaProperty prop = st.getElementProperty(item);
- SchemaType partType = prop.getType();
- String s = XMLBeansSchemaTypeUtils.getNaturalJavaClassName(partType);
- if (prop.extendsJavaArray()) {
- s += "[]";
- }
- return s;
- }
-
- public void generate(ToolContext context) throws ToolException {
- String srcd = (String)context.get(ToolConstants.CFG_OUTPUTDIR);
- String classesd = (String)context.get(ToolConstants.CFG_CLASSDIR);
- boolean verbose = context.optionSet(ToolConstants.CFG_VERBOSE);
-
- boolean result = true;
- if (errorListener.hasError()) {
- result = false;
- }
-
- File srcDir;
- File classesDir;
- if (srcd == null) {
- String wsdl = (String)context.get(ToolConstants.CFG_WSDLLOCATION);
- try {
- srcd = new File(new URI(wsdl)).getAbsolutePath();
- } catch (URISyntaxException e) {
- srcd = new File(".").getAbsolutePath();
- }
- }
- srcDir = new File(srcd);
- srcDir.mkdirs();
-
- if (classesd == null) {
- classesDir = srcDir;
- } else {
- classesDir = new File(classesd);
- classesDir.mkdirs();
- }
-
- // now code generate and compile the JAR
- if (result) {
- // filer implementation writes binary .xsd and generated source to disk
- final ClassCollector classCollector = context.get(ClassCollector.class);
-
- FilerImpl filer = new FilerImpl(classesDir, srcDir,
- null, verbose, false) {
-
- public Writer createSourceFile(String typename) throws IOException {
- String tn = typename;
- if (tn.contains("$")) {
- tn = tn.substring(0, tn.indexOf('$'));
- }
- String pkg = tn.substring(0, tn.lastIndexOf('.'));
- tn = tn.substring(tn.lastIndexOf('.') + 1);
- classCollector.addTypesClassName(pkg, tn, pkg + "." + tn);
- return super.createSourceFile(typename);
- }
- };
-
- // currently just for schemaCodePrinter
- XmlOptions options = new XmlOptions();
- /*
- if (codePrinter != null) {
- options.setSchemaCodePrinter(codePrinter);
- }
- */
- options.setGenerateJavaVersion("1.5");
- options.setCharacterEncoding((String)context.get(ToolConstants.CFG_ENCODING));
-
- // save .xsb files
- typeSystem.save(filer);
-
- // gen source files
- result &= SchemaTypeSystemCompiler.generateTypes(typeSystem, filer, options);
- /*
- for (String s : classCollector.getGeneratedFileInfo()) {
- System.out.println(s);
- }
- */
- for (Map.Entry<String, String> ent : sourcesToCopyMap.entrySet()) {
- try {
- OutputStream out = filer.createBinaryFile("schema"
- + SchemaTypeSystemImpl.METADATA_PACKAGE_GEN
- + "/src/" + ent.getValue());
- URL url = new URL(ent.getKey());
- InputStream in = url.openStream();
- IOUtils.copy(in, out);
- out.close();
- in.close();
- } catch (Exception e) {
- //probably not an issue
- }
- }
- }
-
- if (!result) {
- if (verbose) {
- System.out.println("BUILD FAILED");
- }
- StringBuilder sb = new StringBuilder("Error generating XMLBeans types\n");
- for (XmlError err : errors) {
- if (err.getSeverity() != XmlError.SEVERITY_INFO) {
- sb.append(err.toString());
- if (err.getLine() != -1) {
- sb.append(": ").append(err.getSourceName());
- sb.append('[').append(Integer.toString(err.getLine()))
- .append(',').append(Integer.toString(err.getColumn()))
- .append(']');
- }
- sb.append('\n');
- }
- }
- throw new ToolException(sb.toString());
- }
-
- if (cpResourceLoader != null) {
- cpResourceLoader.close();
- }
- }
-
-
- private SchemaTypeSystem loadTypeSystem(String wsdlFile,
- String[] configFiles,
- Set<?> mdefNamespaces,
- File baseDir,
- File schemasDir,
- EntityResolver entResolver) {
-
-
- SchemaTypeLoader loader = XmlBeans.typeLoaderForClassLoader(SchemaDocument.class.getClassLoader());
-
- // parse all the XSD files.
- List<SchemaDocument.Schema> scontentlist = new ArrayList<SchemaDocument.Schema>();
- try {
- URL url = new URL(wsdlFile);
- XmlOptions options = new XmlOptions();
- options.setLoadLineNumbers();
- options.setLoadSubstituteNamespaces(Collections
- .singletonMap("http://schemas.xmlsoap.org/wsdl/",
- "http://www.apache.org/internal/xmlbeans/wsdlsubst"));
- options.setEntityResolver(entResolver);
- options.setGenerateJavaVersion(XmlOptions.GENERATE_JAVA_15);
-
- state.addSourceUri(wsdlFile, null);
- loadWSDLDoc(loader, url, options, scontentlist, errorListener);
-
-
- } catch (XmlException e) {
- errorListener.add(e.getError());
- } catch (Exception e) {
- StscState.addError(errorListener, XmlErrorCodes.CANNOT_LOAD_FILE, new Object[] {
- "url", wsdlFile, e.getMessage()
- }, (URL)null);
- }
-
- SchemaDocument.Schema[] sdocs = (SchemaDocument.Schema[])scontentlist
- .toArray(new SchemaDocument.Schema[scontentlist.size()]);
-
- // now the config files.
- List<ConfigDocument.Config> cdoclist = new ArrayList<ConfigDocument.Config>();
- List<File> javaFiles = new ArrayList<File>();
- if (configFiles != null) {
- for (int i = 0; i < configFiles.length; i++) {
- if (configFiles[i].endsWith(".java")) {
- javaFiles.add(new File(configFiles[i]));
- continue;
- }
- if (!configFiles[i].endsWith(".xsdconfig")) {
- //jaxws/jaxb customization file or something else
- continue;
- }
- try {
- XmlOptions options = new XmlOptions();
- options.put(XmlOptions.LOAD_LINE_NUMBERS);
- options.setEntityResolver(entResolver);
- options.setLoadSubstituteNamespaces(MAP_COMPATIBILITY_CONFIG_URIS);
-
- URI uri = new URI(configFiles[i]);
- XmlObject configdoc = null;
- if ("file".equals(uri.getRawSchemeSpecificPart())) {
- configdoc = loader.parse(new File(uri), null, options);
- } else {
- InputSource source = new InputSource(configFiles[i]);
- Document doc = StaxUtils.read(source);
- configdoc = loader.parse(doc, null, options);
- }
-
- if (!(configdoc instanceof ConfigDocument)) {
- StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
- configFiles[i], "xsd config"
- }, configdoc);
- } else {
- StscState.addInfo(errorListener, "Loading config file " + configFiles[i]);
- if (configdoc.validate(new XmlOptions().setErrorListener(errorListener))) {
- ConfigDocument.Config config = ((ConfigDocument)configdoc).getConfig();
- cdoclist.add(config);
- config.setExtensionArray(new Extensionconfig[] {});
- }
- }
- } catch (XmlException e) {
- errorListener.add(e.getError());
- } catch (Exception e) {
- StscState.addError(errorListener, XmlErrorCodes.CANNOT_LOAD_FILE, new Object[] {
- "xsd config", configFiles[i], e.getMessage()
- }, new File(configFiles[i]));
- }
- }
- }
- ConfigDocument.Config[] cdocs = (ConfigDocument.Config[])cdoclist
- .toArray(new ConfigDocument.Config[cdoclist.size()]);
-
-
- SchemaTypeLoader linkTo = SchemaTypeLoaderImpl.build(null, cpResourceLoader, null);
-
- URI baseURI = null;
- if (baseDir != null) {
- baseURI = baseDir.toURI();
- }
-
- XmlOptions opts = new XmlOptions();
- opts.setCompileDownloadUrls();
-
-
- if (mdefNamespaces != null) {
- opts.setCompileMdefNamespaces(mdefNamespaces);
- }
- opts.setCompileNoValidation(); // already validated here
- opts.setEntityResolver(entResolver);
- opts.setGenerateJavaVersion("1.5");
-
- // now pass it to the main compile function
- SchemaTypeSystemCompiler.Parameters params = new SchemaTypeSystemCompiler.Parameters();
- params.setSchemas(sdocs);
- params.setConfig(BindingConfigImpl.forConfigDocuments(cdocs,
- javaFiles.toArray(new File[javaFiles.size()]),
- CodeGenUtil.systemClasspath()));
-
- typeLoader = loader;
-
- params.setLinkTo(linkTo);
- params.setOptions(opts);
- params.setErrorListener(errorListener);
- params.setJavaize(true);
- params.setBaseURI(baseURI);
- params.setSourcesToCopyMap(sourcesToCopyMap);
- //params.setSchemasDir(schemasDir);
- return SchemaTypeSystemCompiler.compile(params);
- }
-
-
- private static void loadWSDLDoc(SchemaTypeLoader loader, URL url,
- XmlOptions options,
- List<Schema> scontentlist,
- XmlErrorWatcher errorListener)
- throws XmlException, IOException {
- XmlObject urldoc = loader.parse(url, null, options);
-
- if (urldoc instanceof org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument) {
- org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc =
- (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc;
-
- addWsdlSchemas(url.toString(),
- wsdldoc,
- errorListener,
- scontentlist);
-
- for (TImport imp : wsdldoc.getDefinitions().getImportArray()) {
- URL url1 = new URL(url, imp.getLocation());
- if (imp.getLocation().toLowerCase().endsWith(".xsd")) {
- XmlObject urldoc2 = loader.parse(url1, null, options);
- addSchema(url1.toString(), (SchemaDocument)urldoc2,
- errorListener, false,
- scontentlist);
- } else {
- loadWSDLDoc(loader, url1, options, scontentlist, errorListener);
- }
- }
-
- } else if (urldoc instanceof SchemaDocument) {
- addSchema(url.toString(), (SchemaDocument)urldoc, errorListener, false,
- scontentlist);
- } else {
- StscState.addError(errorListener, XmlErrorCodes.INVALID_DOCUMENT_TYPE, new Object[] {
- url, "wsdl or schema"
- }, urldoc);
- }
- }
-
-
- private static void addSchema(String name, SchemaDocument schemadoc, XmlErrorWatcher errorListener,
- boolean noVDoc, List<SchemaDocument.Schema> scontentlist) {
- StscState.addInfo(errorListener, "Loading schema file " + name);
- XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
- if (noVDoc) {
- opts.setValidateTreatLaxAsSkip();
- }
- if (schemadoc.validate(opts)) {
- scontentlist.add(schemadoc.getSchema());
- }
- }
-
- private static void addWsdlSchemas(String name,
- org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc,
- XmlErrorWatcher errorListener,
- List<SchemaDocument.Schema> scontentlist) {
- if (wsdlContainsEncoded(wsdldoc)) {
- StscState
- .addWarning(
- errorListener,
- "The WSDL "
- + name
- + " uses SOAP encoding. SOAP encoding "
- + "is not compatible with literal XML Schema.",
- XmlErrorCodes.GENERIC_ERROR, wsdldoc);
- }
- StscState.addInfo(errorListener, "Loading wsdl file " + name);
- XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
- XmlObject[] types = wsdldoc.getDefinitions().getTypesArray();
-
- int count = 0;
- for (int j = 0; j < types.length; j++) {
- XmlObject[] schemas = types[j]
- .selectPath("declare namespace xs=\"http://www.w3.org/2001/XMLSchema\" xs:schema");
- if (schemas.length == 0) {
- StscState
- .addWarning(
- errorListener,
- "The WSDL "
- + name
- + " did not have any schema documents in "
- + "namespace 'http://www.w3.org/2001/XMLSchema'",
- XmlErrorCodes.GENERIC_ERROR, wsdldoc);
- continue;
- }
-
- for (int k = 0; k < schemas.length; k++) {
- if (schemas[k] instanceof SchemaDocument.Schema && schemas[k].validate(opts)) {
- count++;
- scontentlist.add((SchemaDocument.Schema)schemas[k]);
- }
- }
- }
- StscState.addInfo(errorListener, "Processing " + count + " schema(s) in " + name);
- }
-
-
-
- private static boolean wsdlContainsEncoded(XmlObject wsdldoc) {
- // search for any <soap:body use="encoded"/> etc.
- XmlObject[] useAttrs = wsdldoc
- .selectPath("declare namespace soap='http://schemas.xmlsoap.org/wsdl/soap/' "
- + ".//soap:body/@use|.//soap:header/@use|.//soap:fault/@use");
- for (int i = 0; i < useAttrs.length; i++) {
- if ("encoded".equals(((SimpleValue)useAttrs[i]).getStringValue())) {
- return true;
- }
- }
- return false;
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml b/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
deleted file mode 100644
index f5f8103..0000000
--- a/rt/databinding/xmlbeans/src/main/resources/META-INF/cxf/java2wsbeans.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd">
- <bean id="XmlbeansDatabindingBean" class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" scope="prototype"/>
-</beans>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml b/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
deleted file mode 100644
index 029dd06..0000000
--- a/rt/databinding/xmlbeans/src/main/resources/META-INF/tools-plugin.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<plugin xmlns="http://cxf.apache.org/tools/plugin" name="xmlbeans" version="" provider="cxf.apache.org">
- <databinding name="xmlbeans" package="org.apache.cxf.xmlbeans.tools" profile="XMLBeansToolingDataBinding"/>
-</plugin>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
deleted file mode 100644
index 60b15a9..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/AbstractXmlBeansTest.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.wsdl.Definition;
-import javax.wsdl.Import;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLWriter;
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusException;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.binding.BindingFactoryManager;
-import org.apache.cxf.binding.soap.SoapBindingFactory;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.bus.extension.ExtensionManagerBus;
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory;
-import org.apache.cxf.frontend.ServerFactoryBean;
-import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
-import org.apache.cxf.service.Service;
-import org.apache.cxf.test.AbstractCXFTest;
-import org.apache.cxf.tools.wsdlto.core.WSDLDefinitionBuilder;
-import org.apache.cxf.transport.ConduitInitiatorManager;
-import org.apache.cxf.transport.DestinationFactoryManager;
-import org.apache.cxf.transport.local.LocalTransportFactory;
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.cxf.wsdl.WSDLManager;
-import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
-import org.apache.cxf.wsdl11.WSDLManagerImpl;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-
-public abstract class AbstractXmlBeansTest extends AbstractCXFTest {
- protected LocalTransportFactory localTransport;
-
-
- @Before
- public void setUp() throws Exception {
- super.setUpBus();
-
- SoapBindingFactory bindingFactory = new SoapBindingFactory();
- bindingFactory.setBus(bus);
-
- bus.getExtension(BindingFactoryManager.class)
- .registerBindingFactory("http://schemas.xmlsoap.org/wsdl/soap/", bindingFactory);
-
- DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
-
- SoapTransportFactory soapDF = new SoapTransportFactory();
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/", soapDF);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/", soapDF);
- dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", soapDF);
-
- localTransport = new LocalTransportFactory();
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/soap/http", localTransport);
- dfm.registerDestinationFactory("http://schemas.xmlsoap.org/wsdl/soap/http", localTransport);
- dfm.registerDestinationFactory("http://cxf.apache.org/bindings/xformat", localTransport);
- dfm.registerDestinationFactory("http://cxf.apache.org/transports/local", localTransport);
-
- ConduitInitiatorManager extension = bus.getExtension(ConduitInitiatorManager.class);
- extension.registerConduitInitiator(LocalTransportFactory.TRANSPORT_ID, localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/wsdl/soap/", localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
- extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/", localTransport);
-
- bus.setExtension(new WSDLManagerImpl(), WSDLManager.class);
-
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", WSDLConstants.NS_SCHEMA_XSD);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
-
- }
-
- @Override
- protected Bus createBus() throws BusException {
- ExtensionManagerBus bus = new ExtensionManagerBus();
- BusFactory.setDefaultBus(bus);
- return bus;
- }
-
- protected Node invoke(String service, String message) throws Exception {
- return invoke("local://" + service, LocalTransportFactory.TRANSPORT_ID, message);
- }
- protected Node invoke(String service, byte[] message) throws Exception {
- return invoke("local://" + service, LocalTransportFactory.TRANSPORT_ID, message);
- }
-
- public Server createService(Class<?> serviceClass, QName name) {
- return createService(serviceClass, null, name);
- }
-
- public Server createService(Class<?> serviceClass, Object serviceBean, QName name) {
- return createService(serviceClass, serviceBean, serviceClass.getSimpleName(), name);
- }
-
- protected Server createService(Class<?> serviceClass, QName name, XmlBeansDataBinding binding) {
- return createService(serviceClass, serviceClass.getSimpleName(), name, binding);
- }
-
- protected Server createService(Class<?> serviceClass,
- String address, QName name,
- XmlBeansDataBinding binding) {
- ServerFactoryBean sf = createServiceFactory(serviceClass, null, address, name, binding);
- return sf.create();
- }
-
- public Server createService(Class<?> serviceClass,
- Object serviceBean,
- String address,
- QName name) {
- ServerFactoryBean sf = createServiceFactory(serviceClass, serviceBean, address, name, null);
- return sf.create();
- }
-
- protected ServerFactoryBean createServiceFactory(Class<?> serviceClass,
- Object serviceBean,
- String address,
- QName name,
- XmlBeansDataBinding binding) {
- JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
- sf.setServiceClass(serviceClass);
- if (serviceBean != null) {
- sf.setServiceBean(serviceBean);
- }
- sf.getServiceFactory().setServiceName(name);
- sf.setAddress("local://" + address);
- sf.getServiceFactory().setQualifyWrapperSchema(true);
- setupXmlBeans(sf, binding);
- return sf;
- }
- protected void setupXmlBeans(AbstractWSDLBasedEndpointFactory sf) {
- setupXmlBeans(sf, null);
- }
- protected void setupXmlBeans(AbstractWSDLBasedEndpointFactory sf, XmlBeansDataBinding binding) {
- if (binding == null) {
- binding = new XmlBeansDataBinding();
- }
- sf.getServiceFactory().setDataBinding(binding);
- }
-
- protected Collection<Document> getWSDLDocuments(String string) throws WSDLException {
- WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
-
- Collection<Document> docs = new ArrayList<Document>();
- Definition definition = getWSDLDefinition(string);
- if (definition == null) {
- return null;
- }
- docs.add(writer.getDocument(definition));
-
- for (Import wsdlImport : WSDLDefinitionBuilder.getImports(definition)) {
- docs.add(writer.getDocument(wsdlImport.getDefinition()));
- }
- return docs;
- }
-
- protected Definition getWSDLDefinition(String string) throws WSDLException {
- ServerRegistry svrMan = getBus().getExtension(ServerRegistry.class);
- for (Server s : svrMan.getServers()) {
- Service svc = s.getEndpoint().getService();
- if (svc.getName().getLocalPart().equals(string)) {
- ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
- return builder.build();
- }
- }
- String localString = "local://" + string;
- for (Server s : svrMan.getServers()) {
- String s2 = s.getDestination().getAddress().getAddress().getValue();
- if (localString.equals(s2)) {
- Service svc = s.getEndpoint().getService();
- ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
- return builder.build();
- }
- }
- return null;
-
- }
-
- protected Document getWSDLDocument(String string) throws WSDLException {
- Definition definition = getWSDLDefinition(string);
- if (definition == null) {
- return null;
- }
- WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
- return writer.getDocument(definition);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
deleted file mode 100644
index 3ddc1fb..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.aegis.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0"?>
-<mappings xmlns:ex="http://cxf.apache.org/xmlbeans/exception">
- <mapping name="ex:CustomFault">
- <property name="extraInfo" style="attribute"/>
- </mapping>
-</mappings>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
deleted file mode 100644
index 6a0d802..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/CustomFault.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.ws.WebFault;
-
-@WebFault
-public class CustomFault extends Exception {
- private static final long serialVersionUID = 7752898855112831690L;
- private String extraInfo;
-
- public CustomFault() {
- super("custom fault");
- }
-
- public String getFaultInfo() {
- return extraInfo;
- }
-
- public void setFaultInfo(String e) {
- this.extraInfo = e;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
deleted file mode 100644
index 89f60a8..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <mixedRequest>
- <string>foo</string>
- <request xmlns="http://cxf.apache.org/xmlbeans">
- <sessionId>foo</sessionId>
- </request>
- </mixedRequest>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
deleted file mode 100644
index 5464854..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/DocumentStyleTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-import org.apache.cxf.endpoint.Server;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class DocumentStyleTest extends AbstractXmlBeansTest {
- String ns = "urn:TestService";
- Server server;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- server = createService(TestService.class, new TestService(),
- "TestService",
- new QName(ns, "TestService"));
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- addNamespace("y", "urn:TestService");
- assertValid("//s:Body/y:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testInvokeWithHack() throws Exception {
- server.getEndpoint().put(XmlBeansDataBinding.XMLBEANS_NAMESPACE_HACK, Boolean.TRUE);
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/DocumentStyleRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- addNamespace("y", "urn:TestService");
- assertValid("//s:Body/y:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Document wsdl = getWSDLDocument("TestService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "/xsd:sequence/xsd:element[@name='string'][@type='xsd:string']",
- wsdl);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
deleted file mode 100644
index 8b36df3..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/FaultRequest.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <ThrowFault/>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
deleted file mode 100644
index 639a3ba..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetForecasts.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Body xmlns="http://www.webservicex.net"/>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
deleted file mode 100644
index 9337933..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GetWeatherByZip.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="http://www.webservicex.net">
- <GetWeatherByZipCode>
- <ZipCode>49506</ZipCode>
- </GetWeatherByZipCode>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
deleted file mode 100644
index cc67eb0..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/GreeterMineImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebService;
-import javax.xml.ws.BindingType;
-
-import org.apache.cxf.xmlbeans.wsdltest.GreeterMine;
-import org.apache.cxf.xmlbeans.wsdltest.SayHi2MessageDocument;
-
-@WebService(endpointInterface = "org.apache.cxf.xmlbeans.wsdltest.GreeterMine",
- targetNamespace = "http://cxf.apache.org/xmlbeans/wsdltest",
- portName = "SoapPort",
- serviceName = "SOAPMineService",
- name = "GreeterMine")
-@BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
-public class GreeterMineImpl implements GreeterMine {
-
-/*
- public String sayHi() {
- System.out.println("****** Executing the operation sayHi *****");
- return "Bonjour";
- }
-*/
- public void sayHi2(SayHi2MessageDocument in) {
- /*System.out.println("****** Executing the operation sayHi2 *****");*/
- }
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
deleted file mode 100644
index 64a564d..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefRequest.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:xfire:idref">
- <getSampleElement>
-
- </getSampleElement>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
deleted file mode 100644
index 9ac69db..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import com.alservices.xsd.sample.SampleElementDocument;
-
-public class IDRefService {
-
- /**
- * This method "gets" a sample Document.
- *
- * @param inSampleElementDocument
- */
- public void getSampleMethod(SampleElementDocument inSampleElementDocument) {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
deleted file mode 100644
index a6d2d48..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/IDRefServiceTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import org.w3c.dom.Node;
-import org.junit.Before;
-import org.junit.Test;
-
-
-public class IDRefServiceTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- createService(IDRefService.class, new IDRefService(), "IDRefService", null);
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = getWSDLDocument("IDRefService");
- assertNotNull(response);
-
- /*
- *
- * SampleElementDocument doc =
- * SampleElementDocument.Factory.newInstance(); SampleElement
- * sampleElement = doc.addNewSampleElement(); SampleUserInformation
- * information = sampleElement.addNewSampleUserInformation();
- * addNamespace("t", "urn:TestService"); addNamespace("x",
- * "http://cxf.apache.org/xmlbeans");
- * assertValid("//t:mixedRequestResponse/x:response/x:form", response);
- */
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
deleted file mode 100644
index f0895c4..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaInNSTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-import org.apache.cxf.staxutils.StaxUtils;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * Tests that we can handle multiple schemas within the same namespace.
- */
-public class MultipleSchemaInNSTest extends AbstractXmlBeansTest {
- String ns = "urn:xfire:xmlbeans:nstest";
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(MultipleSchemaService.class,
- new MultipleSchemaService(),
- "MultipleSchemaService",
- new QName("http://xmlbeans.cxf.apache.org/", "MultipleSchemaService"));
- }
-
- @Test
- public void testWSDL() throws Exception {
- Document wsdl = getWSDLDocument("MultipleSchemaService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- NodeList list = assertValid("//xsd:schema[@targetNamespace='" + ns + "']", wsdl);
- assertEquals(StaxUtils.toString(wsdl), 3, list.getLength());
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(0));
- assertValid("//xsd:import[@namespace='" + ns + "']", list.item(0));
-
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(1));
- assertValid("//xsd:import[@namespace='" + ns + "']",
- list.item(2));
- assertInvalid("//xsd:import[@namespace='" + ns + "']/@schemaLocation",
- list.item(1));
- assertInvalid("//xsd:import[@namespace='" + ns + "']/@schemaLocation",
- list.item(2));
- /*
- endpoint.setProperty(AbstractWSDL.REMOVE_ALL_IMPORTS, "True");
-
- wsdl = getWSDLDocument("MultipleSchemaService");
-
- assertValid("//xsd:schema[@targetNamespace='" + ns + "'][1]", wsdl);
- assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][1]" + "/xsd:import[@namespace='" + ns
- + "']", wsdl);
- assertValid("//xsd:schema[@targetNamespace='" + ns + "'][3]", wsdl);
- assertInvalid("//xsd:schema[@targetNamespace='" + ns + "'][3]" + "/xsd:import[@namespace='" + ns
- + "']", wsdl);
- */
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
deleted file mode 100644
index 62a5041..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/MultipleSchemaService.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.soap.SOAPBinding;
-
-import xfireXmlbeansNstest.RequestTextDocument;
-import xfireXmlbeansNstest.ResponseTextDocument;
-
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class MultipleSchemaService {
- @WebMethod
- public ResponseTextDocument testOne(RequestTextDocument requestTextDocument) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
deleted file mode 100644
index a43cabb..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/PrimitiveTypesTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.common.util.Base64Utility;
-import org.junit.Before;
-import org.junit.Test;
-
-public class PrimitiveTypesTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(TypesService.class, new TypesService(),
- "TypesService", new QName("urn:TypesService", "TypesService"));
-
- }
-
- @Test
- public void testPrimitives() throws Exception {
- doTestType("testInt", "24", "In:24");
- doTestType("testInteger", "24", "In:24");
-
- doTestType("testFloat", "3.14", "In:3.14");
- doTestType("testFloatPrim", "3.14", "In:3.14");
-
- doTestType("testBoolean", "false", "In:false");
- doTestType("testBooleanPrim", "true", "In:true");
-
- doTestType("testBase64Binary", Base64Utility.encode("HelloWorld".getBytes()), "In:HelloWorld");
- }
-
-
- public void doTestType(String operation, String data, String expected) throws Exception {
- String req = "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>"
- + "<env:Header/>"
- + "<env:Body xmlns='urn:TypesService' xmlns:x='http://example.com'>"
- + " <" + operation + ">"
- + " <arg0>" + data + "</arg0>"
- + " </" + operation + ">"
- + "</env:Body>"
- + "</env:Envelope>";
- Node nd = invoke("TypesService", req.getBytes());
-
- addNamespace("t", "urn:TypesService");
- assertValid("//t:return[text()='" + expected + "']", nd);
- assertValid("//t:return1[text()='" + data + "']", nd);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
deleted file mode 100644
index b62bfd2..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TestService.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-
-import com.sample.procure.PurchaseOrderDocument;
-import org.junit.Assert;
-
-
-@WebService(targetNamespace = "urn:TestService",
- serviceName = "TestService")
-public class TestService {
- @WebMethod(operationName = "GetWeatherByZipCode")
- public ResponseDocument getWeatherByZipCode(RequestDocument body) {
- return ResponseDocument.Factory.newInstance();
- }
-
- @WebMethod(operationName = "GetTrouble")
- public TroubleDocument getTrouble(TroubleDocument trouble) {
- return trouble;
- }
-
- @WebMethod(operationName = "ThrowFault")
- public TroubleDocument throwFault() throws CustomFault {
- CustomFault fault = new CustomFault();
- fault.setFaultInfo("extra");
- throw fault;
- }
-
- @WebMethod
- public ResponseDocument mixedRequest(
- @WebParam(name = "string") String string,
- @WebParam(name = "request") RequestDocument req) {
- Assert.assertEquals("foo", string);
- Assert.assertEquals("foo", req.getRequest().getSessionId());
-
- ResponseDocument response = ResponseDocument.Factory.newInstance();
- response.addNewResponse().addNewForm();
- return response;
- }
-
- @WebMethod
- public void submitPO(PurchaseOrderDocument doc) {
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
deleted file mode 100644
index 90bc984..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/TypesService.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.xml.ws.Holder;
-
-import org.apache.cxf.helpers.IOUtils;
-
-@WebService(targetNamespace = "urn:TypesService")
-public class TypesService {
-
- @WebMethod
- public String testInt(int i, @WebParam(mode = WebParam.Mode.OUT) Holder<Integer> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testInteger(Integer i, @WebParam(mode = WebParam.Mode.OUT) Holder<Integer> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testFloatPrim(float i, @WebParam(mode = WebParam.Mode.OUT) Holder<Float> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testFloat(Float i, @WebParam(mode = WebParam.Mode.OUT) Holder<Float> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testBooleanPrim(boolean i, @WebParam(mode = WebParam.Mode.OUT) Holder<Boolean> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testBoolean(Boolean i, @WebParam(mode = WebParam.Mode.OUT) Holder<Boolean> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testLongPrim(long i, @WebParam(mode = WebParam.Mode.OUT) Holder<Long> i2) {
- i2.value = i;
- return "In:" + i;
- }
- @WebMethod
- public String testLong(Long i, @WebParam(mode = WebParam.Mode.OUT) Holder<Long> i2) {
- i2.value = i;
- return "In:" + i;
- }
-
- @WebMethod
- public String testBase64Binary(byte i[], @WebParam(mode = WebParam.Mode.OUT) Holder<byte[]> i2) {
- i2.value = i;
- return "In:" + IOUtils.newStringFromBytes(i);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
deleted file mode 100644
index a842aaa..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-import net.webservicex.GetWeatherByZipCodeDocument;
-import net.webservicex.GetWeatherByZipCodeResponseDocument;
-import net.webservicex.WeatherForecasts;
-
-@WebService(targetNamespace = "http://www.webservicex.net")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class WeatherService {
- @WebMethod(operationName = "GetWeatherByZipCode")
- public GetWeatherByZipCodeResponseDocument getWeatherByZipCode(
- @WebParam(name = "GetWeatherByZipCode") GetWeatherByZipCodeDocument body) {
-
- GetWeatherByZipCodeResponseDocument res = GetWeatherByZipCodeResponseDocument.Factory.newInstance();
-
- WeatherForecasts weather = res.addNewGetWeatherByZipCodeResponse().addNewGetWeatherByZipCodeResult();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return res;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
deleted file mode 100644
index 2faae25..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-import net.webservicex.GetWeatherByZipCodeDocument;
-import net.webservicex.GetWeatherByZipCodeResponseDocument;
-import net.webservicex.WeatherForecasts;
-
-@WebService(targetNamespace = "http://www.webservicex.net")
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public class WeatherService2 {
-
- @WebMethod(operationName = "GetWeatherByZipCode")
- public GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse
- getWeatherByZipCode(GetWeatherByZipCodeDocument.GetWeatherByZipCode body) {
-
- GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse res
- = GetWeatherByZipCodeResponseDocument.GetWeatherByZipCodeResponse.Factory
- .newInstance();
-
- WeatherForecasts weather = res.addNewGetWeatherByZipCodeResult();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return res;
- }
- @WebMethod(operationName = "GetForecasts")
- public WeatherForecasts getForecasts() {
- WeatherForecasts weather = WeatherForecasts.Factory.newInstance();
-
- weather.setLatitude(1);
- weather.setLongitude(1);
- weather.setPlaceName("Grand Rapids, MI");
-
- return weather;
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
deleted file mode 100644
index 769999b..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WeatherService2Test.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class WeatherService2Test extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(WeatherService2.class,
- new WeatherService2(),
- "WeatherService", null);
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("WeatherService", "GetWeatherByZip.xml");
-
- addNamespace("w", "http://www.webservicex.net");
- assertValid("//w:GetWeatherByZipCodeResponse", response);
-
- response = invoke("WeatherService", "GetForecasts.xml");
-
- addNamespace("u", "http://www.webservicex.net");
- assertValid("//u:GetForecastsResponse", response);
- assertValid("//u:GetForecastsResponse/w:Latitude", response);
- assertValid("//u:GetForecastsResponse/w:Longitude", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("WeatherService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("w", WSDLConstants.NS_WSDL11);
-
- assertValid("//w:message[@name='GetForecastsResponse']/w:part[@element='tns:GetForecastsResponse']",
- wsdl);
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
deleted file mode 100644
index 89f60a8..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedRequest.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
- <env:Header/>
- <env:Body xmlns="urn:TestService">
- <mixedRequest>
- <string>foo</string>
- <request xmlns="http://cxf.apache.org/xmlbeans">
- <sessionId>foo</sessionId>
- </request>
- </mixedRequest>
- </env:Body>
-</env:Envelope>
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
deleted file mode 100644
index 4852c1a..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/WrappedStyleTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import org.apache.cxf.endpoint.Server;
-import org.apache.cxf.service.model.MessagePartInfo;
-import org.apache.cxf.service.model.OperationInfo;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class WrappedStyleTest extends AbstractXmlBeansTest {
- private Server endpoint;
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- endpoint = createService(TestService.class, new TestService(),
- "TestService", new QName("urn:TestService", "TestService"));
-
- }
-
- @Test
- public void testParams() throws Exception {
- String ns = "urn:TestService";
-
- OperationInfo op = endpoint.getEndpoint().getService()
- .getServiceInfos().get(0).getInterface().getOperation(new QName(ns, "GetWeatherByZipCode"));
-
- assertNotNull(op);
- MessagePartInfo info = op.getUnwrappedOperation().getInput().getMessagePart(0);
-
- assertEquals(new QName("http://cxf.apache.org/xmlbeans", "request"), info.getElementQName());
- }
-
- @Test
- public void testInvoke() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/WrappedRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("t", "urn:TestService");
- addNamespace("x", "http://cxf.apache.org/xmlbeans");
- assertValid("//t:mixedRequestResponse/x:response/x:form", response);
- }
-
- @Test
- public void testFault() throws Exception {
- Node response = invoke("TestService", "/org/apache/cxf/xmlbeans/FaultRequest.xml");
-
- assertNotNull(response);
-
- addNamespace("t", "urn:TestService");
- addNamespace("x", "http://cxf.apache.org/xmlbeans/exception");
- assertValid("//detail/t:CustomFault[text()='extra']", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("TestService");
-
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("ns0", "http://cxf.apache.org/xmlbeans");
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "//xsd:element[@name='string'][@type='xsd:string']", wsdl);
-
- NodeList list = assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:complexType[@name='mixedRequest']"
- + "//xsd:element[@ref]", wsdl);
- for (int x = 0; x < list.getLength(); x++) {
- Element el = (Element)list.item(x);
- assertTrue(el.getAttribute("ref"), el.getAttribute("ref").contains("request"));
- }
-
- assertValid("//xsd:schema[@targetNamespace='urn:TestService']"
- + "/xsd:element[@name='CustomFault'][@type='xsd:string']", wsdl);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/cxf/blob/40380d8e/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
----------------------------------------------------------------------
diff --git a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java b/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
deleted file mode 100644
index 74e7189..0000000
--- a/rt/databinding/xmlbeans/src/test/java/org/apache/cxf/xmlbeans/XMLBeansServiceTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.xmlbeans;
-
-import javax.xml.namespace.QName;
-
-import org.w3c.dom.Node;
-
-import org.apache.cxf.wsdl.WSDLConstants;
-import org.apache.ws.commons.schema.constants.Constants;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class XMLBeansServiceTest extends AbstractXmlBeansTest {
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
-
- createService(WeatherService.class, new WeatherService(),
- "WeatherService", new QName("http://www.webservicex.net", "WeatherService"));
- createService(TestService.class, new TestService(), "TestService",
- new QName("urn:TestService", "TestService"));
- }
-
- @Test
- public void testAnyService() throws Exception {
- try {
- getWSDLDocument("TestService");
- assertTrue("Generating WSDL above should not throw an NPE", true);
- } catch (NullPointerException e) {
- fail("Shouldn't be throwing an NPE here");
- }
- }
-
- @Test
- public void testService() throws Exception {
- Node response = invoke("WeatherService", "GetWeatherByZip.xml");
-
- addNamespace("w", "http://www.webservicex.net");
- assertValid("//w:GetWeatherByZipCodeResponse", response);
- }
-
- @Test
- public void testWSDL() throws Exception {
- Node wsdl = getWSDLDocument("WeatherService");
- // printNode(wsdl);
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
- assertValid("//wsdl:types/xsd:schema[@targetNamespace='http://www.webservicex.net']", wsdl);
- assertValid("//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:element[@name='WeatherForecasts']", wsdl);
- assertValidBoolean("count(//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:element[@name='WeatherForecasts'])=1", wsdl);
- assertValid("//xsd:schema[@targetNamespace='http://www.webservicex.net']"
- + "/xsd:complexType[@name='WeatherForecasts']", wsdl);
- }
-
- @Test
- public void testAnyWSDL() throws Exception {
-
- Node wsdl = getWSDLDocument("TestService");
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
-
- assertValid("//wsdl:types/xsd:schema[@targetNamespace='http://cxf.apache.org/xmlbeans']"
- + "/xsd:element[@name='request']", wsdl);
- }
-
- @Test
- public void testAnyWSDLNoDupRootRefElements() throws Exception {
- Node wsdl = getWSDLDocument("TestService");
-
- String xpathString = "/wsdl:definitions/wsdl:types//xsd:schema/xsd:element[@name='trouble']";
-
- addNamespace("wsdl", WSDLConstants.NS_WSDL11);
- addNamespace("wsdlsoap", WSDLConstants.NS_SOAP11);
- addNamespace("xsd", Constants.URI_2001_SCHEMA_XSD);
- addNamespace("s", Constants.URI_2001_SCHEMA_XSD);
-
- assertEquals(1, assertValid(xpathString, wsdl).getLength());
- }
-
-
-
-}