├── CONTRIBUTING.md ├── LICENSE ├── spec ├── AmazonSearch.wadl ├── TODO.txt ├── YahooSearch.wadl ├── references.bib ├── wadl.rnc ├── wadl.sty ├── wadl.tex └── wadl.xsd └── wadl ├── pom.xml ├── wadl-ant ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jvnet │ └── ws │ └── wadl2java │ └── WJCTask.java ├── wadl-cmdline ├── nbactions.xml ├── pom.xml └── src │ └── main │ └── java │ └── org │ └── jvnet │ └── ws │ └── wadl2java │ └── Main.java ├── wadl-core ├── README.txt ├── etc │ ├── XMLSchema.dtd │ ├── catalog.xml │ ├── datatypes.dtd │ └── xml.xsd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jvnet │ │ │ └── ws │ │ │ ├── wadl │ │ │ ├── ast │ │ │ │ ├── AbstractNode.java │ │ │ │ ├── ApplicationNode.java │ │ │ │ ├── ElementResolver.java │ │ │ │ ├── FaultNode.java │ │ │ │ ├── InvalidWADLException.java │ │ │ │ ├── MethodNode.java │ │ │ │ ├── PathSegment.java │ │ │ │ ├── RepresentationNode.java │ │ │ │ ├── ResourceNode.java │ │ │ │ ├── ResourceTypeNode.java │ │ │ │ ├── WadlAstBuilder.java │ │ │ │ └── package.html │ │ │ └── util │ │ │ │ ├── AbstractMultivaluedMap.java │ │ │ │ └── MessageListener.java │ │ │ └── wadl2java │ │ │ ├── GeneratorUtil.java │ │ │ ├── JavaDocUtil.java │ │ │ ├── Resolver.java │ │ │ ├── ResourceClassGenerator.java │ │ │ ├── Wadl2Java.java │ │ │ ├── common │ │ │ └── BaseResourceClassGenerator.java │ │ │ ├── javascript │ │ │ └── JavaScriptGenerator.java │ │ │ ├── jaxrs │ │ │ └── JAXRS20ResourceClassGenerator.java │ │ │ ├── jersey │ │ │ └── Jersey1xResourceClassGenerator.java │ │ │ └── package.html │ └── resources │ │ ├── org │ │ └── jvnet │ │ │ └── ws │ │ │ ├── wadl │ │ │ └── ast │ │ │ │ └── ast.properties │ │ │ └── wadl2java │ │ │ └── Wadl2Java.properties │ │ └── xsd │ │ └── wadl.xsd │ └── test │ ├── java │ ├── com │ │ └── sun │ │ │ └── research │ │ │ └── .gitkeep │ └── org │ │ └── jvnet │ │ └── ws │ │ ├── wadl │ │ ├── ast │ │ │ ├── PathSegmentTest.java │ │ │ └── WadlAstBuilderTest.java │ │ └── util │ │ │ └── .gitkeep │ │ └── wadl2java │ │ ├── GeneratorUtilTest.java │ │ └── MainTest.java │ └── resources │ └── org │ └── jvnet │ └── ws │ └── wadl │ └── ast │ ├── NewsSearchError.xsd │ ├── NewsSearchResponse.xsd │ └── SoapUIYahooSearch.wadl ├── wadl-dist ├── pom.xml └── src │ ├── assembly │ └── dist.xml │ ├── com │ └── sun │ │ └── research │ │ └── wadl2java │ │ └── yahoo │ │ └── Main.java │ ├── main │ └── resources │ │ ├── LICENSE.txt │ │ ├── README.html │ │ ├── README.txt │ │ ├── bin │ │ ├── wadl2java │ │ └── wadl2java.bat │ │ ├── samples │ │ ├── README.html │ │ ├── README.txt │ │ ├── ant │ │ │ └── build.xml │ │ ├── cmdline │ │ │ ├── run │ │ │ └── run.cmd │ │ ├── maven │ │ │ └── pom.xml │ │ └── share │ │ │ ├── bbc-schedule.xsd │ │ │ └── bbc.wadl │ │ └── scripts │ │ └── .gitkeep │ └── test │ └── java │ └── org │ └── jvnet │ └── ws │ └── wadl │ └── ast │ └── SampleTest.java ├── wadl-maven-plugin ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── jvnet │ │ │ └── ws │ │ │ └── wadl │ │ │ └── maven │ │ │ └── Wadl2JavaMojo.java │ └── resources │ │ └── .gitkeep │ └── test │ ├── java │ └── org │ │ └── jvnet │ │ └── ws │ │ └── wadl │ │ ├── matchers │ │ ├── Contains.java │ │ ├── Exists.java │ │ ├── Matchers.java │ │ └── Readable.java │ │ └── maven │ │ ├── AbstractJavaWadl2JavaMojoTest.java │ │ ├── AbstractWadl2JavaMojoTest.java │ │ ├── Wadl2JavaMojoJAXRS20Test.java │ │ ├── Wadl2JavaMojoJavaScriptTest.java │ │ ├── Wadl2JavaMojoTest.java │ │ └── wadl │ │ └── Handler.java │ ├── plugin-configs │ └── wadl2java │ │ ├── broken-wadl.xml │ │ ├── forecast.io-wadl.xml │ │ ├── hellobean-nonamespace-wadl.xml │ │ ├── hellobean-wadl-customname.xml │ │ ├── hellobean-wadl-simplexjc.xml │ │ ├── hellobean-wadl.xml │ │ ├── jaxb-missing-schema.xml │ │ ├── jsoninout-wadl.xml │ │ ├── matrixparam-wadl.xml │ │ ├── missing-method-name.xml │ │ ├── multiple-contenttypes-jsonschema-wadl.xml │ │ ├── multiple-contenttypes-wadl.xml │ │ ├── nested-wadl.xml │ │ ├── no-response-content.xml │ │ ├── nonjaxb-wadl-custom-names.xml │ │ ├── nonjaxb-wadl.xml │ │ ├── officedirectory-wadl.xml │ │ ├── open-patent-example.xml │ │ ├── parameterized-wadl.xml │ │ ├── regex-template-wadl.xml │ │ ├── reserved-words-wadl.xml │ │ ├── resources-with-same-name-wadl.xml │ │ ├── smoke-test-config.xml │ │ ├── soapui-yahoo-wadl-config.xml │ │ ├── valid-wadl-config-with-catalog.xml │ │ ├── valid-wadl-config.xml │ │ ├── valid-wadl-with-customizations-config.xml │ │ └── wadl-with-name-customization.xml │ └── resources │ ├── broken-wadl │ └── Broken.wadl │ ├── forecast.io-wadl │ ├── datablock.json │ ├── datapoint.json │ ├── forecast.json │ └── forecast.wadl │ ├── hellobean-nonamespace-wadl │ ├── HelloBean.wadl │ ├── HelloBean.xsd │ └── simple.jaxb │ ├── hellobean-wadl │ ├── HelloBean.wadl │ ├── HelloBean.xsd │ └── simple.jaxb │ ├── jaxb-missing-schema │ └── missing-scehma.wadl │ ├── jsoninout-wadl │ ├── MultipleContentTypes.wadl │ └── xsd0.xsd │ ├── log4j.properties │ ├── matrixparam-wadl │ ├── Parameter.wadl │ └── xsd0.xsd │ ├── multiple-contenttypes-jsonschema-wadl │ ├── MultipleContentTypes.wadl │ ├── requestMessage │ ├── responseMessage │ └── xsd0.xsd │ ├── multiple-contenttypes-wadl │ ├── MultipleContentTypes.wadl │ └── xsd0.xsd │ ├── nested-wadl │ └── NestedWADL.wadl │ ├── no-response-content │ ├── NoResponse.wadl │ └── xsd0.xsd │ ├── nonjaxb-wadl │ └── HelloWorld.wadl │ ├── officedirectory-wadl │ ├── application.wadl │ └── xsd0.xsd │ ├── open-patent-services │ ├── customization-hacked.xjb │ ├── customization-original.xjb │ ├── schema │ │ ├── EclaExporterSchema.xsd │ │ ├── ccd.xsd │ │ ├── exchange-documents.xsd │ │ ├── fulltext-documents.xsd │ │ ├── ops.xsd │ │ ├── ops_legal.xsd │ │ └── rplus.xsd │ └── wadl │ │ ├── notes.txt │ │ ├── ops-hacked.wadl │ │ └── ops-original.wadl │ ├── org │ └── jvnet │ │ └── ws │ │ └── wadl │ │ └── maven │ │ ├── jquery-1.11.1.js │ │ └── template.html │ ├── parameterized-wadl │ ├── Parameter.wadl │ └── xsd0.xsd │ ├── paramterized-wadl │ └── .gitkeep │ ├── regex-template-wadl │ └── application.wadl │ ├── reserved-words-wadl │ ├── HelloBean.xsd │ └── ReservedWords.wadl │ ├── resources-with-same-name-wadl │ ├── application.wadl │ └── xsd0.xsd │ ├── smoke-test │ └── .gitkeep │ ├── soapui-yahoo-wadl │ ├── NewsSearchError.xsd │ ├── NewsSearchResponse.xsd │ └── SoapUIYahooSearch.wadl │ ├── valid-wadl-with-catalog │ ├── NewsSearchError.xsd │ ├── NewsSearchResponse.xsd │ └── YahooSearch.wadl │ ├── valid-wadl-with-customizations │ ├── NewsSearchError.xsd │ ├── NewsSearchResponse.xsd │ ├── YahooSearch.wadl │ └── binding.xjb │ ├── valid-wadl │ ├── NewsSearchError.xsd │ ├── NewsSearchResponse.xsd │ └── YahooSearch.wadl │ └── wadl-with-name-customization │ ├── application.wadl │ ├── customize.xml │ └── xsd0.xsd └── wadl-xslt ├── pom.xml └── src ├── main ├── java │ └── org │ │ └── jvnet │ │ └── ws │ │ └── wadl │ │ └── xslt │ │ ├── UriTemplateParser.java │ │ └── WadlXsltUtils.java └── resources │ └── org │ └── jvnet │ └── ws │ └── wadl │ └── xslt │ ├── upgrade.xsl │ └── wadl_2009-02.xsl └── test ├── java └── org │ └── jvnet │ └── ws │ └── wadl │ └── xslt │ ├── UriTemplateParserTest.java │ └── WadlXsltUtilsTest.java └── resources ├── schemas.xml ├── search.wadl └── test.xsl /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | --- 4 | 5 | # Source Code Submissions 6 | We welcome your contributions and look forward to collaborating with you. We can only accept source code repository 7 | submissions from users who have signed and returned the Oracle 8 | Contributor Agreement. You will find details and the agreement to sign at this OTN web page: 9 | [Oracle Contributor Agreement](http://www.oracle.com/technetwork/community/oca-486395.html). 10 | 11 | # Other Contributions 12 | For all project Submissions other than source code repository contributions, the following also applies: Oracle does 13 | not claim ownership of Your Submissions. However, in order to fulfill 14 | the purposes of this project, You must give Oracle and all Users 15 | the right to post, access, discuss, use, publish, disseminate, and refine 16 | Your Submissions. 17 | 18 | In legalese: *You hereby grant to Oracle and all 19 | Users a royalty-free, perpetual, irrevocable, worldwide, non-exclusive, 20 | and fully sub-licensable right and license, under Your intellectual 21 | property rights, to reproduce, modify, adapt, publish, translate, create 22 | derivative works from, distribute, perform, display, and use Your 23 | Submissions (in whole or part) and to incorporate or implement them in 24 | other works in any form, media, or technology now known or later 25 | developed, all subject to the obligation to retain any copyright notices 26 | included in Your Submissions. All Users, Oracle, and their 27 | sublicensees are responsible for any modifications they make to the 28 | Submissions of others.* 29 | 30 | Copyright © 2017 Oracle and/or its affiliates. All rights reserved. 31 | -------------------------------------------------------------------------------- /spec/AmazonSearch.wadl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 27 | 41 | 42 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /spec/TODO.txt: -------------------------------------------------------------------------------- 1 | TODO 2 | ---- 3 | 4 | - Add section on global vs local usage, explain how to use WADL for a single resource as well as a collection. 5 | - Make param into a referencable element like method and representation. Useful for common param declarations. -------------------------------------------------------------------------------- /spec/YahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 24 | 25 | 37 | 38 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /spec/wadl.rnc: -------------------------------------------------------------------------------- 1 | namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" 2 | namespace local = "" 3 | namespace wadl = "http://wadl.dev.java.net/2009/02" 4 | 5 | start = 6 | element wadl:application { 7 | doc*, 8 | grammars?, 9 | resources*, 10 | ( resource_type | method | representation | param )*, 11 | foreign-attribute, 12 | foreign-element 13 | } 14 | doc = 15 | element wadl:doc { 16 | attribute xml:lang { languageTag }?, 17 | attribute title { text }?, 18 | ( text | foreign-element )*, 19 | foreign-attribute 20 | } 21 | grammars = 22 | element wadl:grammars { 23 | doc*, 24 | incl*, 25 | foreign-element 26 | } 27 | incl = 28 | element wadl:include { 29 | doc*, 30 | attribute href { xsd:anyURI }, 31 | foreign-attribute 32 | } 33 | resources = 34 | element wadl:resources { 35 | doc*, 36 | resource+, 37 | attribute base { xsd:anyURI }, 38 | foreign-attribute, 39 | foreign-element 40 | } 41 | resource_type = 42 | element wadl:resource_type { 43 | doc*, 44 | param*, 45 | (method | resource)*, 46 | attribute id { xsd:token }?, 47 | foreign-element, 48 | foreign-attribute 49 | } 50 | resource = 51 | element wadl:resource { 52 | doc*, 53 | param*, 54 | (method | resource)*, 55 | attribute type { list {xsd:anyURI} } ?, 56 | attribute path { text }?, 57 | attribute id { xsd:token }?, 58 | attribute queryType { text }?, 59 | foreign-element, 60 | foreign-attribute 61 | } 62 | method = 63 | element wadl:method { 64 | ( 65 | ( 66 | attribute href { xsd:anyURI } 67 | ) | ( 68 | doc*, 69 | request?, 70 | response*, 71 | attribute id { xsd:token }?, 72 | attribute name { 73 | "DELETE" | "GET" | "HEAD" | "POST" | "PUT" | xsd:token 74 | } 75 | ) 76 | ), 77 | foreign-element, 78 | foreign-attribute 79 | } 80 | request = 81 | element wadl:request { 82 | doc*, 83 | param*, 84 | representation*, 85 | foreign-attribute, 86 | foreign-element 87 | } 88 | response = 89 | element wadl:response { 90 | doc*, 91 | param*, 92 | representation*, 93 | attribute status { list { xsd:int+ } }?, 94 | foreign-attribute, 95 | foreign-element 96 | } 97 | representation = 98 | element wadl:representation { 99 | ( 100 | ( 101 | attribute href { xsd:anyURI } 102 | ) | ( 103 | doc*, 104 | param*, 105 | attribute id { xsd:token }?, 106 | attribute element { xsd:QName }?, 107 | attribute mediaType { text }?, 108 | attribute profile { list { xsd:anyURI} }? 109 | ) 110 | ), 111 | foreign-attribute, 112 | foreign-element 113 | } 114 | param = 115 | element wadl:param { 116 | ( 117 | ( 118 | attribute href { xsd:anyURI } 119 | ) | ( 120 | doc*, 121 | option*, 122 | link?, 123 | attribute name {xsd:token }, 124 | attribute style { 125 | "plain" | "query" | "matrix" | "header" | "template" 126 | }, 127 | attribute id { xsd:token }?, 128 | attribute type { text }?, 129 | attribute default { text }?, 130 | attribute path { text }?, 131 | attribute required { xsd:boolean }?, 132 | attribute repeating { xsd:boolean }?, 133 | attribute fixed { text }? 134 | ) 135 | ), 136 | foreign-element, 137 | foreign-attribute 138 | } 139 | option = 140 | element wadl:option { 141 | doc*, 142 | attribute value { xsd:string }, 143 | attribute mediaType { text }?, 144 | foreign-element, 145 | foreign-attribute 146 | } 147 | link = 148 | element wadl:link { 149 | doc*, 150 | attribute resource_type { xsd:anyURI }?, 151 | attribute rel { xsd:token }?, 152 | attribute rev { xsd:token }?, 153 | foreign-element, 154 | foreign-attribute 155 | } 156 | foreign-attribute = attribute * - (wadl:* | local:* | xml:*) { text }* 157 | foreign-element = 158 | element * - (wadl:* | local:*) { 159 | (attribute * { text } 160 | | text 161 | | any-element)* 162 | }* 163 | any-element = 164 | element * { 165 | (attribute * { text } 166 | | text 167 | | any-element)* 168 | }* 169 | languageTag = xsd:string { 170 | pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" 171 | } 172 | -------------------------------------------------------------------------------- /spec/wadl.sty: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e}[1996/06/01] 2 | \ProvidesPackage{wadl}[2005/05/24 v1.0 (MJH)] 3 | 4 | \def\verbatim@font{\small\ttfamily} 5 | -------------------------------------------------------------------------------- /spec/wadl.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/spec/wadl.tex -------------------------------------------------------------------------------- /wadl/wadl-ant/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.jvnet.ws.wadl 6 | wadl 7 | 1.1.8-SNAPSHOT 8 | 9 | wadl-ant 10 | WADL Ant Task 11 | 12 | An Ant task for generating Java stubs from WADL files. 13 | 14 | 15 | 16 | org.jvnet.ws.wadl 17 | wadl-core 18 | ${project.version} 19 | 20 | 21 | org.apache.ant 22 | ant 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wadl/wadl-cmdline/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | run 5 | 6 | jar 7 | 8 | 9 | process-classes 10 | org.codehaus.mojo:exec-maven-plugin:1.1:exec 11 | 12 | 13 | -classpath %classpath org.jvnet.ws.wadl2java.Main -o /Users/mh124079/Desktop/test -p com.sun /Users/mh124079/Desktop/test/test.wadl 14 | java 15 | 16 | 17 | 18 | debug 19 | 20 | jar 21 | 22 | 23 | process-classes 24 | org.codehaus.mojo:exec-maven-plugin:1.1:exec 25 | 26 | 27 | -Xdebug -Djava.compiler=none -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath org.jvnet.ws.wadl2java.Main -o /Users/mh124079/Desktop/test -p com.sun /Users/mh124079/Desktop/test/test.wadl 28 | true 29 | java 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /wadl/wadl-cmdline/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.jvnet.ws.wadl 6 | wadl 7 | 1.1.8-SNAPSHOT 8 | 9 | wadl-cmdline 10 | jar 11 | WADL Commandline 12 | A commandline tool for generating Java stubs from WADL files. 13 | 14 | 15 | org.jvnet.ws.wadl 16 | wadl-core 17 | ${project.version} 18 | 19 | 20 | 21 | org.glassfish.jersey.core 22 | jersey-common 23 | ${jersey2.version} 24 | 25 | 26 | 27 | 28 | 29 | netbeans-public 30 | 31 | 32 | netbeans.execution 33 | true 34 | 35 | 36 | 37 | 38 | 39 | maven-jar-plugin 40 | 41 | 42 | 43 | true 44 | org.jvnet.ws.wadl2java.Main 45 | 46 | 47 | 48 | 49 | 68 | 69 | 70 | 71 | 72 | 73 | ${artifactId} 74 | 75 | 76 | maven-jar-plugin 77 | 78 | 79 | 80 | org.jvnet.ws.wadl2java.Main 81 | true 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | true 90 | 91 | 92 | -------------------------------------------------------------------------------- /wadl/wadl-core/README.txt: -------------------------------------------------------------------------------- 1 | wadl2java is a tool that generates client side stubs from WADL files. May be 2 | used from the command line or as an Apache Ant plug-in, see the wadl2java 3 | documentation for full details: 4 | 5 | https://wadl.dev.java.net/wadl2java.html 6 | -------------------------------------------------------------------------------- /wadl/wadl-core/etc/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/AbstractNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | package org.jvnet.ws.wadl.ast; 13 | 14 | import org.xml.sax.Locator; 15 | 16 | /** 17 | * Provide common function for all node types 18 | * @author gdavison 19 | */ 20 | public abstract class AbstractNode { 21 | 22 | 23 | public interface NodeVisitor 24 | { 25 | public void visit(AbstractNode node); 26 | } 27 | 28 | 29 | /** 30 | * @return The location of the node 31 | */ 32 | public abstract Locator getLocation(); 33 | 34 | 35 | /** 36 | * Allow the provided parameter to visit the current node and any 37 | * child nodes. 38 | */ 39 | public void visit(NodeVisitor visitor) 40 | { 41 | visitor.visit(this); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/ApplicationNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | package org.jvnet.ws.wadl.ast; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | import org.jvnet.ws.wadl.Application; 18 | import org.xml.sax.Locator; 19 | 20 | /** 21 | * Provides an abstraction of the Application class that contains a normalised 22 | * tree of off the elements required to define this WADL with the references 23 | * correctly substituted. 24 | * 25 | * @author gdavison 26 | */ 27 | public class ApplicationNode extends AbstractNode { 28 | 29 | 30 | private Application application; 31 | private List resources; 32 | 33 | public ApplicationNode(Application application, List resources) { 34 | this.application = application; 35 | // Defensive copy 36 | this.resources = java.util.Collections.unmodifiableList( 37 | new ArrayList(resources)); 38 | } 39 | 40 | public List getResources() { 41 | return resources; 42 | } 43 | 44 | /** 45 | * @return The location of the node. 46 | */ 47 | @Override 48 | public Locator getLocation() { 49 | return application.sourceLocation(); 50 | } 51 | 52 | 53 | /** 54 | * Allow the provided parameter to visit the current node and any 55 | * child nodes. 56 | */ 57 | public void visit(NodeVisitor visitor) 58 | { 59 | super.visit(visitor); 60 | 61 | for (ResourceNode node : getResources()) { 62 | node.visit(visitor); 63 | } 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/ElementResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | package org.jvnet.ws.wadl.ast; 14 | 15 | import java.net.URI; 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | import org.jvnet.ws.wadl.util.MessageListener; 20 | 21 | 22 | /** 23 | * Maintains a map of file+ref to element. 24 | * @author mh124079 25 | */ 26 | public class ElementResolver { 27 | 28 | private Map map; 29 | private MessageListener messageListener; 30 | 31 | public ElementResolver(MessageListener messageListener) { 32 | this.messageListener = messageListener; 33 | map = new HashMap(); 34 | } 35 | 36 | /** 37 | * Get the element for a ref. 38 | * 39 | * @param ref the element reference as returned by {@link #addReference}. 40 | * @return the corresponding element or null if not found. 41 | */ 42 | public Object get(String ref) { 43 | return map.get(ref); 44 | } 45 | 46 | /** 47 | * Resolve a href and return the element if it is of the expected type. 48 | * 49 | * @return the resolved object. 50 | * @param file the URI of the file in which the referenced element is located, used 51 | * to absolutize references. 52 | * @param href the reference to resolve. 53 | * @param object the original referring object. 54 | * @throws InvalidWADLException when WADL is invalid and cannot be processed. 55 | */ 56 | @SuppressWarnings("unchecked") 57 | public T resolve(URI file, String href, T object) throws InvalidWADLException { 58 | Object o = null; 59 | String id = file.toString()+href.substring(href.indexOf('#')); 60 | o = map.get(id); 61 | if (o == null) { 62 | throw WadlAstBuilder.messageStringFromObject(AstMessages.SKIPPING_REFERENCE(href), object); 63 | } 64 | else if (!object.getClass().isInstance(o)) { 65 | throw WadlAstBuilder.messageStringFromObject(AstMessages.SKIPPING_REFERENCE_TYPE(href), object); 66 | } 67 | return (T)o; 68 | } 69 | 70 | /** 71 | * Add a reference to an element if it has an identifier. 72 | * 73 | * @param file the URI of the file that contains the element. 74 | * @param id the id of the element, may be null. 75 | * @param o the element. 76 | * @return the unique identifier of the element or null if the element did 77 | * not contain an identifier. 78 | */ 79 | public String addReference(URI file, String id, Object o) { 80 | String uniqueId = null; 81 | if (id != null && id.length()>0) { 82 | // if the element has an ID then add it to the ref map 83 | uniqueId = file.toString()+"#"+id; 84 | map.put(uniqueId, o); 85 | } 86 | return uniqueId; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/FaultNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | * FaultNode.java 15 | * 16 | * Created on August 16, 2006, 1:00 PM 17 | * 18 | */ 19 | 20 | package org.jvnet.ws.wadl.ast; 21 | 22 | import java.util.List; 23 | import javax.xml.namespace.QName; 24 | import org.jvnet.ws.wadl.Doc; 25 | import org.jvnet.ws.wadl.Param; 26 | import org.jvnet.ws.wadl.Representation; 27 | import org.jvnet.ws.wadl2java.GeneratorUtil; 28 | import org.xml.sax.Locator; 29 | 30 | /** 31 | * Represents a WADL fault. 32 | * 33 | * @author mh124079 34 | */ 35 | public class FaultNode extends AbstractNode { 36 | 37 | private Representation fault; 38 | String className; 39 | 40 | /** 41 | * Creates a new instance of FaultNode. 42 | * 43 | * @param f the unmarshalled JAXB-generated fault object. 44 | */ 45 | public FaultNode(Representation f) { 46 | fault = f; 47 | if (f.getId()!=null) 48 | className = GeneratorUtil.makeClassName(f.getId()); 49 | else if (f.getElement()!=null) 50 | className = GeneratorUtil.makeClassName(f.getElement().getLocalPart()); 51 | else 52 | className = getMediaTypeAsClassName(); 53 | className+="Exception"; 54 | } 55 | 56 | /** 57 | * Convenience function for generating a suitable Java class name for this WADL 58 | * fault. 59 | * 60 | * @return a suitable class name. 61 | */ 62 | public String getClassName() { 63 | return className; 64 | } 65 | 66 | /** 67 | * Convenience function for generating a suitable Java class name for this WADL 68 | * fault based on the media type. 69 | * 70 | * @return a suitable class name. 71 | */ 72 | public String getMediaTypeAsClassName() { 73 | return GeneratorUtil.makeClassName(getMediaType()); 74 | } 75 | 76 | /** 77 | * Get the media type of the fault. 78 | * 79 | * @return the media type 80 | */ 81 | public String getMediaType() { 82 | return fault.getMediaType(); 83 | } 84 | 85 | /** 86 | * Get the XML root element of the fault representation. 87 | * 88 | * @return the XML qualified name of the root element. 89 | */ 90 | public QName getElement() { 91 | return fault.getElement(); 92 | } 93 | 94 | /** 95 | * Get the child parameters. 96 | * 97 | * @return a list of child parameters. 98 | */ 99 | public List getParam() { 100 | return fault.getParam(); 101 | } 102 | 103 | /** 104 | * List of child documentation elements. 105 | * 106 | * @return documentation list, one item per language. 107 | */ 108 | public List getDoc() { 109 | return fault.getDoc(); 110 | } 111 | 112 | 113 | /** 114 | * @return The location of the node 115 | */ 116 | @Override 117 | public Locator getLocation() { 118 | return fault.sourceLocation(); 119 | } 120 | 121 | } 122 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/InvalidWADLException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /** 14 | * 15 | */ 16 | 17 | package org.jvnet.ws.wadl.ast; 18 | 19 | import org.jvnet.ws.wadl2java.Wadl2JavaMessages; 20 | import org.xml.sax.Locator; 21 | 22 | /** 23 | * Thrown the the WADL is invalid and cannot be processed. 24 | * 25 | * @author gdavison 26 | */ 27 | public class InvalidWADLException extends java.lang.Exception { 28 | 29 | private static final Locator NULL_LOCATOR = new Locator() { 30 | public String getPublicId() { 31 | return null; 32 | } 33 | 34 | public String getSystemId() { 35 | return null; 36 | } 37 | 38 | public int getLineNumber() { 39 | return -1; 40 | } 41 | 42 | public int getColumnNumber() { 43 | return -1; 44 | } 45 | }; 46 | 47 | private Locator _locator; 48 | 49 | /** 50 | * Constructs an instance of InvalidWADLException with the specified detail message 51 | * and location 52 | * @param msg the detail message. 53 | */ 54 | public InvalidWADLException(String msg, Locator locator) { 55 | super(locator==null ? msg : Wadl2JavaMessages.FILE( 56 | msg, 57 | locator.getLineNumber(), locator.getColumnNumber(), locator.getSystemId())); 58 | 59 | // Use a null locator is one isn't provided 60 | _locator = locator !=null ? locator : NULL_LOCATOR; 61 | } 62 | 63 | 64 | /** 65 | * @return the line number for the problem, can be -1 66 | */ 67 | public int getLineNumber() { 68 | return _locator.getLineNumber(); 69 | } 70 | 71 | /** 72 | * @return the column for the problem, can be -1 73 | */ 74 | public int getColumnNumber() { 75 | return _locator.getColumnNumber(); 76 | } 77 | 78 | /** 79 | * @return the system id of the location, can be used as the location 80 | * of the file being processed if avaliable. 81 | */ 82 | public String getSystemId() { 83 | return _locator.getSystemId(); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/RepresentationNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | * RepresentationNode.java 15 | * 16 | * Created on August 16, 2006, 12:59 PM 17 | * 18 | */ 19 | 20 | package org.jvnet.ws.wadl.ast; 21 | 22 | import java.util.List; 23 | 24 | import javax.xml.namespace.QName; 25 | 26 | import org.jvnet.ws.wadl.Doc; 27 | import org.jvnet.ws.wadl.Param; 28 | import org.jvnet.ws.wadl.Representation; 29 | import org.jvnet.ws.wadl2java.GeneratorUtil; 30 | import org.xml.sax.Locator; 31 | 32 | /** 33 | * Represents a WADL representation. 34 | * 35 | * @author mh124079 36 | */ 37 | public class RepresentationNode extends AbstractNode { 38 | 39 | Representation rep; 40 | 41 | /** 42 | * Creates a new instance of RepresentationNode. 43 | * 44 | * @param r the unmarshalled JAXB-generated representation object. 45 | */ 46 | public RepresentationNode(Representation r) { 47 | rep = r; 48 | } 49 | 50 | /** 51 | * Convenience function for generating a suitable Java class name for this WADL 52 | * representation based on the media type. 53 | * 54 | * @return a suitable name. 55 | */ 56 | public String getMediaTypeAsClassName() { 57 | String mediaType = getMediaType(); 58 | if (mediaType != null && mediaType.startsWith("application/")) { 59 | mediaType = mediaType.substring("application/".length()); 60 | } 61 | return GeneratorUtil.makeClassName(mediaType); 62 | } 63 | 64 | /** 65 | * Get the media type of the representation. 66 | * 67 | * @return the media type. 68 | */ 69 | public String getMediaType() { 70 | return rep.getMediaType(); 71 | } 72 | 73 | /** 74 | * Get the list of link profiles used to described the relationships of 75 | * embedded links. 76 | * 77 | * @return list of profiles. 78 | */ 79 | public List getProfiles() { 80 | return rep.getProfile(); 81 | } 82 | 83 | /** 84 | * Get the XML root element name for the representation. 85 | * 86 | * @return the qualified name of the root XML element. 87 | */ 88 | public QName getElement() { 89 | return rep.getElement(); 90 | } 91 | 92 | /** 93 | * Get a list of child parameters. 94 | * 95 | * @return child parameters 96 | */ 97 | public List getParam() { 98 | return rep.getParam(); 99 | } 100 | 101 | /** 102 | * List of child documentation elements. 103 | * 104 | * @return documentation list, one item per language. 105 | */ 106 | public List getDoc() { 107 | return rep.getDoc(); 108 | } 109 | 110 | /** 111 | * Get the representation id (if any). 112 | * 113 | * @return the id or null if no id. 114 | */ 115 | public String getId() { 116 | return rep.getId(); 117 | } 118 | 119 | 120 | /** 121 | * @return The location of the node 122 | */ 123 | @Override 124 | public Locator getLocation() { 125 | return rep.sourceLocation(); 126 | } 127 | 128 | /** 129 | * @param attribute The QName of the attribute to be found 130 | * @return An extension attribute if it is found 131 | */ 132 | public String getOtherAttribute(QName attribute) { 133 | return rep.getOtherAttributes().get(attribute); 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/ast/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Abstract Syntax Tree for WADL 6 | 7 | 8 |

Classes to insulate code generator from JAXB generated classes. This set 9 | of classes is used to create an abstract syntax tree for a WADL description 10 | independent from how that description is serialized.

11 | 12 | 13 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl/util/MessageListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package org.jvnet.ws.wadl.util; 6 | 7 | /** 8 | * A public class that allows an implementor to deal with messages output 9 | * by the generator. Also allow us to remove a direct API dependency 10 | * on the internals of generator. 11 | * 12 | * @author gdavison 13 | **/ 14 | public interface MessageListener { 15 | 16 | /** 17 | * Report a warning. 18 | * 19 | * @param message The message to display to the user, if null the message 20 | * from the throwable is used instead. 21 | * @param throwable The exception that triggered this message, can be null 22 | * if the message is not null. 23 | */ 24 | public void warning(String message, Throwable throwable); 25 | 26 | /** 27 | * Report informative message. 28 | * 29 | * @param message The message to display to the user. 30 | */ 31 | public void info(String message); 32 | 33 | /** 34 | * Report an error. 35 | * 36 | * @param message The message to display to the user, if null the message 37 | * from the throwable is used instead. 38 | * @param throwable The exception that triggered this message, can be null 39 | * if the message is not null. 40 | */ 41 | public void error(String message, Throwable throwable); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl2java/Resolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | package org.jvnet.ws.wadl2java; 13 | 14 | import javax.xml.namespace.QName; 15 | 16 | import com.sun.codemodel.JType; 17 | import java.net.URI; 18 | import org.jvnet.ws.wadl.ast.AbstractNode; 19 | 20 | /** 21 | * This is a simple interface to replace reference to the S2JJAXModel 22 | * class that is passed around to resolve QName element or URI references 23 | * to type references. 24 | * 25 | * @author gdavison 26 | */ 27 | public interface Resolver { 28 | 29 | /** 30 | * @param element The element to resolve, can be a QName in the case 31 | * of a JAX-B xml definition or a URI in the case of a JSON-Schema 32 | * reference 33 | * 34 | * @return the java type that is used to represent this element, might 35 | * actually be a XmlType rather than a XmlElement 36 | */ 37 | public JType resolve (Object element); 38 | 39 | 40 | /** 41 | * @param context The object that we are loading relative to 42 | * @return A URI relative to the base URI of the document that context 43 | * is loaded from 44 | */ 45 | 46 | public URI resolveURI(AbstractNode context, String path); 47 | 48 | 49 | /** 50 | * Do we need to configure the client for JSON 51 | * @return true if required 52 | */ 53 | public boolean isThereJsonMapping(); 54 | } 55 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl2java/ResourceClassGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package org.jvnet.ws.wadl2java; 6 | 7 | import com.sun.codemodel.JClassAlreadyExistsException; 8 | import java.net.URI; 9 | import org.jvnet.ws.wadl.ast.ResourceNode; 10 | import org.jvnet.ws.wadl.ast.ResourceTypeNode; 11 | 12 | /** 13 | * A simplified interface to the resource class generators 14 | * @author gdavison 15 | */ 16 | public interface ResourceClassGenerator { 17 | // 18 | // /** 19 | // * Generate a bean setter and getter for a parameter. 20 | // * 21 | // * @param $impl The class or interface to add the bean setter and getter to. 22 | // * @param p the WADL parameter for which to create the setter and getter. 23 | // * @param isAbstract controls whether a method body is created {@code false} or not {@code true}. Set to {@code true} 24 | // * for interface methods, {@code false} for class methods. 25 | // */ 26 | // void generateBeanProperty(JDefinedClass $impl, List matrixParameters, Param p, boolean isAbstract); 27 | 28 | /** 29 | * Create a class that acts as a container for a hierarchy 30 | * of static inner classes, one for each resource described by the WADL file. 31 | * 32 | * @param rootResource the root URI to the WADL so we can generate the required annotations 33 | * @param root the resource element that corresponds to the root of the resource tree 34 | * @throws com.sun.codemodel.JClassAlreadyExistsException if, during code 35 | * generation, the WADL processor attempts to create a duplicate 36 | * class. This indicates a structural problem with the WADL file, e.g. duplicate 37 | * peer resource entries. 38 | */ 39 | public void generateEndpointClass( 40 | URI rootResource, ResourceNode root) 41 | throws JClassAlreadyExistsException ; 42 | 43 | 44 | // /** 45 | // * Generate a static member class that represents a WADL resource. 46 | // * 47 | // * @param parentClass the parent class for the generated class. 48 | // * @param $global_base_uri a reference to the field that contains the base URI. 49 | // * @return the generated class. 50 | // * @throws com.sun.codemodel.JClassAlreadyExistsException if a class with 51 | // * the same name already exists. 52 | // */ 53 | // JDefinedClass generateClass(JDefinedClass parentClass, JVar $global_base_uri) throws JClassAlreadyExistsException; 54 | // 55 | // /** 56 | // * Generate a set of method declarations for a WADL method element. 57 | // * 58 | // *

Generates two Java methods per returned representation type for each request 59 | // * type, one with all optional parameters and one without. I.e. if the WADL method 60 | // * specifies two possible request representation formats and three supported 61 | // * response representation formats, this method will generate twelve Java methods, 62 | // * one for each combination.

63 | // * 64 | // * @param isAbstract controls whether the generated methods will have a body {@code false} 65 | // * or not {@code true}. 66 | // * @param method the WADL method element to process. 67 | // */ 68 | // void generateMethodDecls(MethodNode method, boolean isAbstract); 69 | 70 | 71 | /** 72 | * Generate Java interfaces for WADL resource types 73 | * @throws com.sun.codemodel.JClassAlreadyExistsException if the interface to be generated already exists 74 | */ 75 | public void generateResourceTypeInterface(ResourceTypeNode n)throws JClassAlreadyExistsException; 76 | 77 | 78 | } 79 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/java/org/jvnet/ws/wadl2java/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WADL tools for Java 6 | 7 | 8 |

Implements a WADL to Java tool that generates client-side stubs for the 9 | resources and methods declared in a WADL file.

10 | 11 |

Command line usage:

12 | 13 |
java -jar wadl2java.jar -p package -o directory file.wadl
14 | 15 |

where:

16 | 17 |
18 |
-p package
19 |
Specifies the package used for generated code, e.g. com.example.test
20 |
-o directory
21 |
Specifies the directory to which files will be written. E.g. if the package 22 | is com.example.test and the directory is gen-src then 23 | files will be written to ./gen-src/com/example/test. The directory 24 | dir must exist, subdirectories will be created as required.
25 |
file.wadl
26 |
The WADL file to process.
27 |
28 | 29 |

Use as an ant task:

30 | 31 |
<property name="jaxws.home" value="/path/to/jax-ws/directory" />
32 | <property name="wadl2java.home" value="/path/to/wadl2java/directory" />
33 | 
34 | <taskdef name="wjc" classname="org.jvnet.ws.wadl2java.WJCTask">
35 |   <classpath>
36 |     <fileset dir="${jaxws.home}" includes="lib/*.jar" />
37 |     <pathelement location="${wadl2java.home}/dist/wadl2java.jar"/>
38 |   </classpath>
39 | </taskdef>
40 | 
41 | <target name="-pre-compile">
42 |   <echo message="Compiling the description..." />
43 |   <wjc description="file.wadl" package="com.yahoo.search" target="gen-src"/>
44 | </target>
45 | 46 | @see WADL Specification 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/resources/org/jvnet/ws/wadl/ast/ast.properties: -------------------------------------------------------------------------------- 1 | # Sample ResourceBundle properties file 2 | template.value.missing=No value for required template parameter: {0} 3 | matrix.value.missing=No value for required matrix parameter: {0} 4 | 5 | 6 | processing=Processing: {0} 7 | 8 | 9 | missing.id.method=Missing id property on method element 10 | missing.id.resourceType=Missing id property on resourceType element 11 | missing.id.representation=Missing id property on representation element 12 | missing.id.param=Missing id property on param element 13 | 14 | missing.method.name=Missing method name property on method element 15 | 16 | lonely.href.method=A method with a href should not have any other WADL parameters or children 17 | lonely.href.resourceType=A resourceType with a href should not have any other WADL parameters or children 18 | lonely.href.representation=A representation with a href should not have any other WADL parameters or children 19 | lonely.href.param=A param with a href should not have any other WADL parameters or children 20 | 21 | skipping.reference=Reference {0} not found 22 | skipping.reference.type=Reference {0} identifies the wrong kind of element 23 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/main/resources/org/jvnet/ws/wadl2java/Wadl2Java.properties: -------------------------------------------------------------------------------- 1 | # Sample ResourceBundle properties file 2 | 3 | logger.info = Info: {0} 4 | logger.warning = Warning: {0} 5 | logger.error = Error: {0} 6 | 7 | usage=Usage: wadl2java -o outputDir -s style -p package [-a] [-c customizationFile]* [-xjcArgument argument]* file.wadl 8 | invalid.generation.style = Invalid generation style {0} should be one of {1} 9 | unknown.option=Unknown option: {0} 10 | not.a.file={0} is not a file 11 | not.a.directory={0} is not a directory 12 | package.attribute.required=package attribute must be specified 13 | target.attribute.required=target attribute must be specified 14 | target.directory.must.exist=target directory {0} must exist 15 | target.attribute.directory=target attribute {0} must specify a directory 16 | description.required=description attribute must be specified 17 | wadl.description.must.exist=WADL description {0} must exist 18 | wadl.description.file=WADL description {0} must be a file 19 | skipping.compilation=Generated code is up to date, skipping compilation 20 | jaxb.processing.failed=Generating JAX-B binding types failed 21 | processing.failed=WADL file processing failed 22 | processing=Processing: {0} 23 | 24 | 25 | warning=Warning:{0} 26 | file = {0}, line {1}, col {2}, file {3} 27 | warning.file=Warning: {0}, line {1}, col {2}, file {3} 28 | error=Error: {0}, line {1}, col {2}, file {3} 29 | error.fatal="Fatal Error: {0}, line {1}, col {2}, file {3} 30 | info=Info: {0}, line {1}, col {2}, file {3} 31 | element.not.found=Warning: element {0} not found 32 | fault.no.element=Warning: skipping fault with no XML element 33 | parameter.required=Parameter {0} of method {1} is required and must not be null 34 | invocation.failed=Invocation failed, see FaultInfo property for details 35 | create.instance=Create new instance 36 | create.instance.client=Create new instance using existing Client instance, and a base URI and any parameters 37 | create.instance.client.uri=Create new instance using existing Client instance, and the URI from which the parameters will be extracted 38 | 39 | create.client=Create a new Client instance 40 | create.client.instance=Template method to allow tooling to override Client factory 41 | create.client.customize=Template method to allow tooling to customize the new Client -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/com/sun/research/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-core/src/test/java/com/sun/research/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/org/jvnet/ws/wadl/ast/PathSegmentTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | * PathSegmentTest.java 15 | * JUnit based test 16 | * 17 | * Created on August 7, 2006, 2:32 PM 18 | */ 19 | 20 | package org.jvnet.ws.wadl.ast; 21 | 22 | import org.jvnet.ws.wadl.ast.PathSegment; 23 | import org.jvnet.ws.wadl.ast.InvalidWADLException; 24 | import junit.framework.*; 25 | import org.jvnet.ws.wadl.Param; 26 | import org.jvnet.ws.wadl.ParamStyle; 27 | import org.jvnet.ws.wadl.Resource; 28 | import java.util.HashMap; 29 | import java.util.List; 30 | 31 | /** 32 | * 33 | * @author mh124079 34 | */ 35 | public class PathSegmentTest extends TestCase { 36 | 37 | public PathSegmentTest(String testName) { 38 | super(testName); 39 | } 40 | 41 | @Override 42 | protected void setUp() throws Exception { 43 | } 44 | 45 | @Override 46 | protected void tearDown() throws Exception { 47 | } 48 | 49 | /** 50 | * Test of getTemplateParameters method, of class org.jvnet.ws.wadl2java.PathSegment. 51 | */ 52 | public void testGetTemplateParameters() throws InvalidWADLException { 53 | System.out.println("getTemplateParameters"); 54 | 55 | Resource r = new Resource(); 56 | r.setPath("fred/{param1}/bob/{param2}"); 57 | Param p = new Param(); 58 | p.setName("param1"); 59 | p.setRequired(true); 60 | r.getParam().add(p); 61 | 62 | PathSegment instance = new PathSegment(r,null,null); 63 | List result = instance.getTemplateParameters(); 64 | 65 | assertEquals(result.get(0).getName(), "param1"); 66 | assertTrue(result.get(0).isRequired() == Boolean.TRUE); 67 | assertEquals(result.get(1).getName(), "param2"); 68 | assertFalse(result.get(1).isRequired() == Boolean.TRUE); 69 | } 70 | 71 | public void testEvaluate() throws InvalidWADLException { 72 | System.out.println("evaluate"); 73 | Resource r = new Resource(); 74 | r.setPath("fred/{param1}/bob/{param2}"); 75 | Param p = new Param(); 76 | p.setName("param1"); 77 | p.setRequired(true); 78 | r.getParam().add(p); 79 | p = new Param(); 80 | p.setName("param3"); 81 | p.setStyle(ParamStyle.MATRIX); 82 | r.getParam().add(p); 83 | p = new Param(); 84 | p.setName("param4"); 85 | p.setStyle(ParamStyle.MATRIX); 86 | r.getParam().add(p); 87 | p = new Param(); 88 | p.setName("param5"); 89 | p.setStyle(ParamStyle.MATRIX); 90 | r.getParam().add(p); 91 | 92 | PathSegment instance = new PathSegment(r,null,null); 93 | HashMap params = new HashMap(); 94 | params.put("param1", "value1"); 95 | params.put("param2", "value2"); 96 | params.put("param3", "value3"); 97 | params.put("param4", true); 98 | params.put("param5", false); 99 | String result = instance.evaluate(params); 100 | 101 | assertEquals(result, "fred/value1/bob/value2;param3=value3;param4"); 102 | 103 | PathSegment instance2 = new PathSegment("fred/{xyzzy}/bob/"); 104 | result = instance2.evaluate(null); 105 | assertEquals(result, "fred//bob/"); 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/org/jvnet/ws/wadl/ast/WadlAstBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package org.jvnet.ws.wadl.ast; 6 | 7 | import java.io.IOException; 8 | import java.net.URISyntaxException; 9 | import java.util.List; 10 | import java.util.ArrayList; 11 | import org.junit.Test; 12 | import org.jvnet.ws.wadl.util.MessageListener; 13 | import org.w3c.dom.Element; 14 | import org.xml.sax.InputSource; 15 | 16 | import static org.hamcrest.MatcherAssert.assertThat; 17 | import static org.hamcrest.Matchers.*; 18 | 19 | 20 | /** 21 | * Provide unit tests for the AST 22 | * @author gdavison 23 | */ 24 | public class WadlAstBuilderTest { 25 | 26 | 27 | /** 28 | * Whilst investigating a bug, make sure that the AST is properly reporting 29 | * the number of methods. 30 | */ 31 | @Test 32 | public void testSoapUIYahooSearch() throws InvalidWADLException, IOException, URISyntaxException 33 | { 34 | WadlAstBuilder builder = new WadlAstBuilder( 35 | new WadlAstBuilder.SchemaCallback() { 36 | 37 | public void processSchema(InputSource is) { 38 | } 39 | 40 | public void processSchema(String uri, Element node) { 41 | } 42 | }, 43 | new MessageListener() { 44 | 45 | public void warning(String message, Throwable throwable) { 46 | } 47 | 48 | public void info(String message) { 49 | } 50 | 51 | public void error(String message, Throwable throwable) { 52 | } 53 | }); 54 | 55 | ApplicationNode an = 56 | builder.buildAst(WadlAstBuilderTest.class.getResource("SoapUIYahooSearch.wadl").toURI()); 57 | List methods = an.getResources().get(0).getChildResources().get(0).getMethods(); 58 | 59 | // Sanity check that the reference doesn't duplicate the values 60 | assertThat("Only one method", 61 | methods.size(), equalTo(1)); 62 | 63 | // Check that the status on the upgraded fault message 64 | // has correctly been upgrade to the 2009 WADL version 65 | List supportedOutputs = new ArrayList(); 66 | for (List nodeList : methods.get(0).getSupportedOutputs().values()) { 67 | for (RepresentationNode node : nodeList) 68 | { 69 | supportedOutputs.add(node); 70 | } 71 | } 72 | assertThat("Only one output", 73 | supportedOutputs.size(), equalTo(1)); 74 | assertThat("Only one fault", 75 | methods.get(0).getFaults().size(), equalTo(1)); 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/org/jvnet/ws/wadl/util/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-core/src/test/java/org/jvnet/ws/wadl/util/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/org/jvnet/ws/wadl2java/GeneratorUtilTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * GeneratorUtilTest.java 3 | * JUnit based test 4 | * 5 | * Created on February 16, 2007, 10:02 AM 6 | */ 7 | 8 | package org.jvnet.ws.wadl2java; 9 | 10 | import junit.framework.*; 11 | import com.sun.codemodel.ClassType; 12 | import com.sun.codemodel.JClass; 13 | import com.sun.codemodel.JClassAlreadyExistsException; 14 | import com.sun.codemodel.JCodeModel; 15 | import com.sun.codemodel.JDefinedClass; 16 | import com.sun.codemodel.JEnumConstant; 17 | import com.sun.codemodel.JExpr; 18 | import com.sun.codemodel.JFieldVar; 19 | import com.sun.codemodel.JMethod; 20 | import com.sun.codemodel.JMod; 21 | import com.sun.codemodel.JVar; 22 | import org.jvnet.ws.wadl.Option; 23 | import org.jvnet.ws.wadl.Param; 24 | import org.jvnet.ws.wadl.ast.ResourceNode; 25 | import java.util.Arrays; 26 | import java.util.HashSet; 27 | import javax.xml.namespace.QName; 28 | 29 | /** 30 | * 31 | * @author mh124079 32 | */ 33 | public class GeneratorUtilTest extends TestCase { 34 | 35 | public GeneratorUtilTest(String testName) { 36 | super(testName); 37 | } 38 | 39 | protected void setUp() throws Exception { 40 | } 41 | 42 | protected void tearDown() throws Exception { 43 | } 44 | 45 | /** 46 | * Test of makeConstantName method, of class org.jvnet.ws.wadl2java.GeneratorUtil. 47 | */ 48 | public void testMakeConstantName() { 49 | System.out.println("makeConstantName"); 50 | 51 | assertEquals("FOO", GeneratorUtil.makeConstantName("foo")); 52 | assertEquals("FOO", GeneratorUtil.makeConstantName("FOO")); 53 | assertEquals("FOO", GeneratorUtil.makeConstantName("Foo")); 54 | assertEquals("FOO_BAR", GeneratorUtil.makeConstantName("foo bar")); 55 | assertEquals("CLASS", GeneratorUtil.makeConstantName("class")); 56 | } 57 | 58 | /** 59 | * Test of makeClassName method, of class org.jvnet.ws.wadl2java.GeneratorUtil. 60 | */ 61 | public void testMakeClassName() { 62 | System.out.println("makeClassName"); 63 | 64 | assertEquals("Foo", GeneratorUtil.makeClassName("foo")); 65 | assertEquals("FOO", GeneratorUtil.makeClassName("FOO")); 66 | assertEquals("Foo", GeneratorUtil.makeClassName("Foo")); 67 | assertEquals("FooBar", GeneratorUtil.makeClassName("foo bar")); 68 | assertEquals("Class", GeneratorUtil.makeClassName("class")); 69 | } 70 | 71 | /** 72 | * Test of makeClassName method with something that looks like an IP 73 | */ 74 | public void testMakeClassNameIP() { 75 | System.out.println("makeIPClassName"); 76 | 77 | assertEquals("IP120001", GeneratorUtil.makeClassName("120001")); 78 | } 79 | 80 | 81 | /** 82 | * Test of makeParamName method, of class org.jvnet.ws.wadl2java.GeneratorUtil. 83 | */ 84 | public void testMakeParamName() { 85 | System.out.println("makeParamName"); 86 | 87 | assertEquals("foo", GeneratorUtil.makeParamName("foo")); 88 | assertEquals("foo", GeneratorUtil.makeParamName("FOO")); 89 | assertEquals("foo", GeneratorUtil.makeParamName("Foo")); 90 | assertEquals("fooBar", GeneratorUtil.makeParamName("foo bar")); 91 | assertEquals("_class", GeneratorUtil.makeParamName("class")); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/java/org/jvnet/ws/wadl2java/MainTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | * MainTest.java 15 | * JUnit based test 16 | * 17 | * Created on April 27, 2006, 4:59 PM 18 | */ 19 | 20 | package org.jvnet.ws.wadl2java; 21 | 22 | import junit.framework.*; 23 | import javax.xml.bind.JAXBContext; 24 | import javax.xml.bind.JAXBException; 25 | import javax.xml.bind.Unmarshaller; 26 | import org.jvnet.ws.wadl.*; 27 | import java.io.File; 28 | import java.util.List; 29 | 30 | /** 31 | * 32 | * @author mh124079 33 | */ 34 | public class MainTest extends TestCase { 35 | 36 | public MainTest(String testName) { 37 | super(testName); 38 | } 39 | 40 | protected void setUp() throws Exception { 41 | } 42 | 43 | protected void tearDown() throws Exception { 44 | } 45 | 46 | public static Test suite() { 47 | TestSuite suite = new TestSuite(MainTest.class); 48 | 49 | return suite; 50 | } 51 | 52 | /** 53 | * Test of process method, of class org.jvnet.ws.wadl2java.Main. 54 | */ 55 | /* public void testProcess() { 56 | System.out.println("process"); 57 | 58 | Main instance = new Main(new File("YahooSearch.wadl")); 59 | instance.process(); 60 | } 61 | */ 62 | /** 63 | * Test of main method, of class org.jvnet.ws.wadl2java.Main. 64 | */ 65 | public void testMain() { 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/resources/org/jvnet/ws/wadl/ast/NewsSearchError.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/resources/org/jvnet/ws/wadl/ast/NewsSearchResponse.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /wadl/wadl-core/src/test/resources/org/jvnet/ws/wadl/ast/SoapUIYahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | The Yahoo News Search service provides online searching of news 17 | stories from around the world. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | The Yahoo News Search service provides online searching of news 29 | stories from around the world. 30 | 31 | 32 | The application ID. See Application IDs for more information. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 52 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/assembly/dist.xml: -------------------------------------------------------------------------------- 1 | 2 | bin 3 | 4 | zip 5 | 6 | 7 | 8 | ${basedir}/src/main/resources/LICENSE.txt 9 | / 10 | false 11 | 12 | 13 | ${basedir}/src/main/resources/README.txt 14 | / 15 | true 16 | 17 | 18 | ${basedir}/src/main/resources/README.html 19 | / 20 | true 21 | 22 | 23 | ${basedir}/src/main/resources/samples/README.html 24 | samples 25 | true 26 | 27 | 28 | ${basedir}/src/main/resources/samples/README.txt 29 | samples 30 | true 31 | 32 | 33 | ${basedir}/src/main/resources/samples/maven/pom.xml 34 | samples/maven 35 | true 36 | 37 | 38 | ${basedir}/src/main/resources/bin/wadl2java 39 | bin 40 | unix 41 | 0744 42 | true 43 | 44 | 45 | ${basedir}/src/main/resources/bin/wadl2java.bat 46 | bin 47 | dos 48 | true 49 | 50 | 51 | 52 | 53 | ${basedir}/src/main/resources/samples/share 54 | samples/share 55 | 56 | *.wadl 57 | *.xsd 58 | *.xjb 59 | 60 | 61 | 62 | ${basedir}/src/main/resources/samples/ant 63 | samples/ant 64 | 65 | build.xml 66 | 67 | 68 | 69 | ${basedir}/src/main/resources/samples/cmdline 70 | samples/cmdline 71 | 72 | *.formatted 73 | *.cmd 74 | *.bat 75 | 76 | unix 77 | 0744 78 | 79 | 80 | ${basedir}/src/main/resources/samples/cmdline 81 | samples/cmdline 82 | 83 | *.formatted 84 | 85 | 86 | *.cmd 87 | *.bat 88 | 89 | dos 90 | 91 | 92 | ${project.build.directory}/endorsed 93 | lib/endorsed 94 | 95 | *.jar 96 | 97 | 98 | 99 | 100 | 101 | lib 102 | false 103 | runtime 104 | 105 | 106 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/com/sun/research/wadl2java/yahoo/Main.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | 13 | /* 14 | * Main.java 15 | * 16 | * Created on May 1, 2006, 5:10 PM 17 | * 18 | */ 19 | 20 | package com.sun.research.wadl2java.yahoo; 21 | 22 | import com.yahoo.search.Endpoint.NewsSearch; 23 | import com.yahoo.search.Output; 24 | import com.yahoo.search.Sort; 25 | import com.yahoo.search.Type; 26 | import yahoo.yn.Result; 27 | import yahoo.yn.ResultSet; 28 | 29 | /** 30 | * Simple command line example to query the Yahoo News Search service 31 | * @author mh124079 32 | */ 33 | public class Main { 34 | 35 | /** 36 | * Query the Yahoo News Search service for stories that contain the word Java. 37 | * @param args the command line arguments 38 | */ 39 | public static void main(String[] args) { 40 | try { 41 | NewsSearch s = new NewsSearch(); 42 | ResultSet resultSet = s.getAsResultSet( 43 | "jaxws_restful_sample", "java sun", Type.ALL, 10, 1, 44 | Sort.DATE, "en", Output.XML, null); 45 | for (Result result: resultSet.getResultList()) { 46 | System.out.printf("%s (%s)\n", result.getTitle(), 47 | result.getClickUrl()); 48 | } 49 | } catch (Exception ex) { 50 | ex.printStackTrace(); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | README 4 | 5 | 6 |

README

7 |

WADL v. ${version}

8 |

9 | WADL is designed to provide a machine process-able description of 10 | HTTP-based Web applications. To date such applications have 11 | been mainly described using a combination of textual description 12 | and XML schema, WADL aims to provide a machine process-able 13 | description of such applications. 14 |

15 |

16 | This distribution contains the following files: 17 |

18 |
19 |
./bin
20 |
Scripts for running the commandline tool.
21 |
./lib
22 |
The libraries required to run the commandline tools and the Ant task.
23 |
./samples
24 |
Some examples, showing how to use the different tools provided.
25 |
26 | 27 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/README.txt: -------------------------------------------------------------------------------- 1 | README 2 | 3 | WADL v. ${version} 4 | 5 | WADL is designed to provide a machine process-able description of 6 | HTTP-based Web applications. To date such applications have 7 | been mainly described using a combination of textual description 8 | and XML schema, WADL aims to provide a machine process-able 9 | description of such applications. 10 | 11 | This distribution contains the following files: 12 | 13 | ./bin 14 | Scripts for running the commandline tool. 15 | 16 | ./lib 17 | The libraries required to run the commandline tools and the Ant 18 | task. 19 | 20 | ./samples 21 | Some examples, showing how to use the different tools provided. 22 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/bin/wadl2java: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # The contents of this file are subject to the terms 4 | # of the Common Development and Distribution License 5 | # (the "License"). You may not use this file except 6 | # in compliance with the License. 7 | 8 | # You can obtain a copy of the license at 9 | # http://www.opensource.org/licenses/cddl1.php 10 | # See the License for the specific language governing 11 | # permissions and limitations under the License. 12 | # ---------------------------------------------------------------------------- 13 | 14 | if [ -f /etc/wadlrc ] ; then 15 | . /etc/wadlrc 16 | fi 17 | 18 | if [ -f "$HOME/.wadlrc" ] ; then 19 | . "$HOME/.wadlrc" 20 | fi 21 | 22 | # OS specific support. $var _must_ be set to either true or false. 23 | cygwin=false; 24 | darwin=false; 25 | case "`uname`" in 26 | CYGWIN*) cygwin=true ;; 27 | Darwin*) darwin=true 28 | if [ -z "$JAVA_VERSION" ] ; then 29 | JAVA_VERSION="CurrentJDK" 30 | else 31 | echo "Using Java version: $JAVA_VERSION" 32 | fi 33 | if [ -z "$JAVA_HOME" ] ; then 34 | JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home 35 | fi 36 | ;; 37 | esac 38 | 39 | if [ -z "$JAVA_HOME" ] ; then 40 | if [ -e /etc/gentoo-release ] ; then 41 | JAVA_HOME=`java-config --jre-home` 42 | fi 43 | fi 44 | 45 | if [ -z "$WADL_HOME" ] ; then 46 | # try to find WADL 47 | if [ -d /opt/wadl ] ; then 48 | WADL_HOME=/opt/wadl 49 | fi 50 | 51 | if [ -d "$HOME/wadl" ] ; then 52 | WADL_HOME="$HOME/wadl" 53 | fi 54 | 55 | ## resolve links - $0 may be a link to wadl's home 56 | PRG="$0" 57 | 58 | # need this for relative symlinks 59 | while [ -h "$PRG" ] ; do 60 | ls=`ls -ld "$PRG"` 61 | link=`expr "$ls" : '.*-> \(.*\)$'` 62 | if expr "$link" : '/.*' > /dev/null; then 63 | PRG="$link" 64 | else 65 | PRG="`dirname "$PRG"`/$link" 66 | fi 67 | done 68 | 69 | saveddir=`pwd` 70 | 71 | WADL_HOME=`dirname "$PRG"`/.. 72 | 73 | # make it fully qualified 74 | WADL_HOME=`cd "$WADL_HOME" && pwd` 75 | 76 | cd "$saveddir" 77 | # echo Using wadl at $WADL_HOME 78 | fi 79 | 80 | # For Cygwin, ensure paths are in UNIX format before anything is touched 81 | if $cygwin ; then 82 | [ -n "$WADL_HOME" ] && 83 | WADL_HOME=`cygpath --unix "$WADL_HOME"` 84 | [ -n "$JAVA_HOME" ] && 85 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 86 | [ -n "$CLASSPATH" ] && 87 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 88 | fi 89 | 90 | if [ -z "$JAVACMD" ] ; then 91 | if [ -n "$JAVA_HOME" ] ; then 92 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 93 | # IBM's JDK on AIX uses strange locations for the executables 94 | JAVACMD="$JAVA_HOME/jre/sh/java" 95 | else 96 | JAVACMD="$JAVA_HOME/bin/java" 97 | fi 98 | else 99 | JAVACMD=java 100 | fi 101 | fi 102 | 103 | if [ ! -x "$JAVACMD" ] ; then 104 | echo "Error: JAVA_HOME is not defined correctly." 105 | echo " We cannot execute $JAVACMD" 106 | exit 1 107 | fi 108 | 109 | if [ -z "$JAVA_HOME" ] ; then 110 | echo "Warning: JAVA_HOME environment variable is not set." 111 | fi 112 | 113 | CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher 114 | 115 | # For Cygwin, switch paths to Windows format before running java 116 | if $cygwin; then 117 | [ -n "$WADL_HOME" ] && 118 | WADL_HOME=`cygpath --path --windows "$WADL_HOME"` 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 121 | [ -n "$HOME" ] && 122 | HOME=`cygpath --path --windows "$HOME"` 123 | fi 124 | 125 | exec "$JAVACMD" \ 126 | $WADL_OPTS \ 127 | "-Djava.endorsed.dirs=%WADL_HOME%/lib/endorsed" \ 128 | "-Dwadl.home=${WADL_HOME}" \ 129 | -jar ${WADL_HOME}/lib/wadl-cmdline-${project.version}.jar \ 130 | "$@" 131 | 132 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/README.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | README 4 | 5 | 6 |

README

7 |

8 | Each of the examples in this directory documents a way to 9 | convert a WADL file to a collection of Java sources. 10 |

11 |
12 |
./ant
13 |
14 | Convert a WADL file to Java sources using the Ant task. 15 |
16 |
17 |
18 |
./maven
19 |
20 | Convert a WADL file to Java sources using the Maven 2 21 | plugin. Note that the plugin will actually be downloaded from 22 | the Maven repository. The plugin itself is not shipping as 23 | part of this distribution. 24 |
25 |
26 |
27 |
./cmdline
28 |
29 | Convert a WADL file to Java sources using the commandline tool 30 | found in the bin directory in this distribution. 31 |
32 |
33 |
34 |
./shared
35 |
36 | The WADL file and schemas used as input in each of these 37 | examples. 38 |
39 |
40 | 41 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/README.txt: -------------------------------------------------------------------------------- 1 | README 2 | 3 | Each of the examples in this directory documents a way to convert a WADL 4 | file to a collection of Java sources. 5 | 6 | ./ant 7 | Convert a WADL file to Java sources using the Ant task. 8 | 9 | ./maven 10 | Convert a WADL file to Java sources using the Maven 2 plugin. Note 11 | that the plugin will actually be downloaded from the Maven 12 | repository. The plugin itself is not shipping as part of this 13 | distribution. 14 | 15 | ./cmdline 16 | Convert a WADL file to Java sources using the commandline tool 17 | found in the bin directory in this distribution. 18 | 19 | ./shared 20 | The WADL file and schemas used as input in each of these examples. 21 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/ant/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | Builds stubs for accessing BBC Schedule service. 16 | 17 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 32 | 33 | 34 | 36 | 38 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/cmdline/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # An example showing how to use the commandline tools included in this 5 | # package. 6 | # 7 | 8 | mkdir -p ./gen-src 9 | 10 | ../../bin/wadl2java \ 11 | -o ./gen-src \ 12 | -p bbc.schedule \ 13 | ../share/bbc.wadl -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/cmdline/run.cmd: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM An example showing how to use the commandline tools included in this 3 | @REM package. 4 | @REM 5 | 6 | @mkdir .\gen-src 7 | 8 | ..\..\bin\wadl2java.bat -o ./gen-src -p com.yahoo.search -c ../share/binding.xjb ../share/YahooSearch.wadl 9 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/maven/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | bbc.schedule 5 | schedule-api 6 | ${project.version} 7 | BBC Schedule API 8 | 9 | 10 | wadl-repository 11 | WADL Maven Repository 12 | https://wadl.dev.java.net/nonav/repository/ 13 | 14 | 15 | maven2-repository.dev.java.net 16 | Java.net Repository for Maven 17 | http://download.java.net/maven/2/ 18 | 19 | 20 | wadl-snapshots 21 | WADL Snapshots Repository 22 | https://wadl.dev.java.net/nonav/snapshots 23 | 24 | true 25 | 26 | 27 | false 28 | 29 | 30 | 31 | 32 | 33 | wadl-snapshots 34 | WADL Snapshots Repository 35 | https://wadl.dev.java.net/nonav/snapshots 36 | 37 | true 38 | 39 | 40 | false 41 | 42 | 43 | 44 | 45 | 46 | org.jvnet.ws.wadl 47 | wadl-core 48 | ${project.version} 49 | 50 | 51 | com.sun.jersey 52 | jersey-client 53 | 1.17 54 | 55 | 56 | 57 | 58 | 59 | org.apache.maven.plugins 60 | maven-compiler-plugin 61 | 62 | 1.7 63 | 1.7 64 | 65 | 66 | 67 | org.jvnet.ws.wadl 68 | wadl-client-plugin 69 | ${project.version} 70 | 71 | 72 | 73 | generate 74 | 75 | 76 | 77 | 78 | ../share 79 | bbc.schedule 80 | false 81 | 82 | 83 | http://www.bbc.co.uk 84 | BBCSchedule 85 | 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/samples/share/bbc.wadl: -------------------------------------------------------------------------------- 1 | 12 | 13 | 16 | 17 | A simple subset of the BBC scheduling REST service written by hand 18 | 19 | 20 | 21 | A XML Grammar based on some example messages as generated by the XSD from XML wizard in JDeveloper 22 | 23 | 24 | 25 | 26 | This WADL represents the REST API as descibed on the BBC developers page 27 | 28 | 29 | 30 | The BBC service, for example radio1 or radio4 31 | 32 | 33 | 34 | 35 | The outlet, this might map to a country ie england, for radio1, or a medium, for radio2, for example fm 36 | 37 | 38 | 39 | 40 | Simple time period modifier 41 | 42 | 43 | 44 | 45 | 46 | 47 | Get the schedule for yesterday/today/tommorrow depending on the modifier 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | The year to filter by 57 | 58 | 59 | The month to filter by 60 | 61 | 62 | The day to filter by 63 | 64 | 65 | 66 | 67 | Get the scheduel for the specific day 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /wadl/wadl-dist/src/main/resources/scripts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-dist/src/main/resources/scripts/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-dist/src/test/java/org/jvnet/ws/wadl/ast/SampleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | package org.jvnet.ws.wadl.ast; 13 | 14 | import org.junit.Test; 15 | 16 | /** 17 | * 18 | * @author gdavison 19 | */ 20 | public class SampleTest { 21 | 22 | @Test 23 | public void testCmdLineSample() 24 | { 25 | System.getProperties().list(System.out); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/main/resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-maven-plugin/src/main/resources/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/java/org/jvnet/ws/wadl/matchers/Contains.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.matchers; 2 | 3 | import org.hamcrest.Description; 4 | import org.hamcrest.TypeSafeMatcher; 5 | 6 | import java.io.File; 7 | 8 | public class Contains extends TypeSafeMatcher { 9 | 10 | private String nested; 11 | 12 | public Contains(String nested) { 13 | this.nested = nested; 14 | } 15 | 16 | @Override 17 | public boolean matchesSafely(File file) { 18 | File nestedFile = new File(file, nested); 19 | return nestedFile.exists(); 20 | } 21 | 22 | public void describeTo(Description descr) { 23 | descr.appendText("does not contain " + nested); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/java/org/jvnet/ws/wadl/matchers/Exists.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package org.jvnet.ws.wadl.matchers; 5 | 6 | import java.io.File; 7 | 8 | import org.hamcrest.Description; 9 | import org.hamcrest.TypeSafeMatcher; 10 | 11 | public class Exists extends TypeSafeMatcher { 12 | 13 | @Override 14 | public boolean matchesSafely(File file) { 15 | return file.exists(); 16 | } 17 | 18 | public void describeTo(Description desc) { 19 | desc.appendText("not existing"); 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/java/org/jvnet/ws/wadl/matchers/Matchers.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.matchers; 2 | 3 | import java.io.File; 4 | 5 | import org.hamcrest.Matcher; 6 | 7 | public class Matchers { 8 | 9 | public static Matcher exists() { 10 | return new Exists(); 11 | } 12 | 13 | public static Matcher readable() { 14 | return new Readable(); 15 | } 16 | 17 | public static Matcher contains(String nested) { 18 | return new Contains(nested); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/java/org/jvnet/ws/wadl/matchers/Readable.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.matchers; 2 | 3 | import java.io.File; 4 | 5 | import org.hamcrest.Description; 6 | import org.hamcrest.TypeSafeMatcher; 7 | 8 | public class Readable extends TypeSafeMatcher { 9 | 10 | @Override 11 | public boolean matchesSafely(File file) { 12 | return file.canRead(); 13 | } 14 | 15 | public void describeTo(Description desc) { 16 | desc.appendText("not readable"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/java/org/jvnet/ws/wadl/maven/wadl/Handler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The contents of this file are subject to the terms 3 | * of the Common Development and Distribution License 4 | * (the "License"). You may not use this file except 5 | * in compliance with the License. 6 | * 7 | * You can obtain a copy of the license at 8 | * http://www.opensource.org/licenses/cddl1.php 9 | * See the License for the specific language governing 10 | * permissions and limitations under the License. 11 | */ 12 | package org.jvnet.ws.wadl.maven.wadl; 13 | 14 | import java.io.File; 15 | import java.io.IOException; 16 | import java.net.URL; 17 | import java.net.URLConnection; 18 | import java.net.URLStreamHandler; 19 | import org.jvnet.ws.wadl.maven.Wadl2JavaMojoTest; 20 | 21 | /** 22 | * Create a new protocol type so that the tests can think that they 23 | * are resolving the URL from a remote server and not files on disk. 24 | * This was added in particular to test WADL-50 25 | * @author gdavison 26 | */ 27 | public class Handler extends URLStreamHandler { 28 | 29 | @Override 30 | protected URLConnection openConnection(URL u) throws IOException { 31 | 32 | String relative = u.getPath(); 33 | String pathOnDisk = Wadl2JavaMojoTest.getFilePath(relative); 34 | 35 | return new File(pathOnDisk).toURL().openConnection(); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/broken-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/broken-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/broken-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/forecast.io-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/forecast.io-wadl/generated-sources/wadl 8 | test 9 | 10 | wadl://example/forecast.io-wadl/forecast.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/hellobean-nonamespace-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/hellobean-nonamespace-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/hellobean-nonamespace-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/hellobean-wadl-customname.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/hellobean-wadl-customname/generated-sources/wadl 8 | ${basedir}/src/test/resources/hellobean-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 19 | http://www.example.com/resource/ 20 | Bean 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/hellobean-wadl-simplexjc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/hellobean-wadl-simplexjc/generated-sources/wadl 8 | ${basedir}/src/test/resources/hellobean-wadl 9 | test 10 | *.wadl 11 | 12 | ${basedir}/src/test/resources/hellobean-wadl/simple.jaxb 13 | 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/hellobean-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/hellobean-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/hellobean-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/jaxb-missing-schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/jaxb-missing-schema/generated-sources/wadl 8 | ${basedir}/src/test/resources/jaxb-missing-schema 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/jsoninout-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/jsoninout-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/jsoninout-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/matrixparam-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/matrixparam-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/matrixparam-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/missing-method-name.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/path-with-numbers/generated-sources/wadl 8 | ${basedir}/src/test/resources/open-patent-services 9 | test 10 | wadl/ops-original.wadl 11 | 12 | 13 | ${basedir}/src/test/resources/open-patent-services/customization-original.xjb 14 | 15 | true 16 | false 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/multiple-contenttypes-jsonschema-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/multiple-contenttypes-jsonschema-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/multiple-contenttypes-jsonschema-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/multiple-contenttypes-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/multiple-contenttypes-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/multiple-contenttypes-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/nested-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/nested-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/nested-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/no-response-content.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/no-response-content/generated-sources/wadl 8 | ${basedir}/src/test/resources/no-response-content 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/nonjaxb-wadl-custom-names.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/nonjaxb-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/nonjaxb-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | http://localhost:9998/ 18 | MyApiClient 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/nonjaxb-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/nonjaxb-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/nonjaxb-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/officedirectory-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/officedirectory-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/officedirectory-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/open-patent-example.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/open-patent-example/generated-sources/wadl 8 | test 9 | 10 | wadl://example/open-patent-services/wadl/ops-hacked.wadl 11 | 12 | 13 | ${basedir}/src/test/resources/open-patent-services/customization-hacked.xjb 14 | 15 | 16 | true 17 | false 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/parameterized-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/parameterized-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/parameterized-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/regex-template-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/regex-template-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/regex-template-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/reserved-words-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/reserved-words-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/reserved-words-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/resources-with-same-name-wadl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/resources-with-same-name-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/resources-with-same-name-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | true 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/smoke-test-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/smoke-test/generated-sources/wadl 8 | ${basedir}/src/test/resources/smoke-test 9 | smoke 10 | 11 | *.wadl 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/soapui-yahoo-wadl-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/soapui-yahoo-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/soapui-yahoo-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/valid-wadl-config-with-catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/valid-wadl-with-catalog/generated-sources/wadl 8 | ${basedir}/src/test/resources/valid-wadl-with-catalog 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/valid-wadl-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/valid-wadl/generated-sources/wadl 8 | ${basedir}/src/test/resources/valid-wadl 9 | test 10 | *.wadl 11 | 12 | true 13 | false 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/valid-wadl-with-customizations-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/valid-wadl-with-customizations/generated-sources/wadl 8 | ${basedir}/src/test/resources/valid-wadl-with-customizations 9 | test 10 | *.wadl 11 | 12 | ${basedir}/src/test/resources/valid-wadl-with-customizations/binding.xjb 13 | 14 | true 15 | false 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/plugin-configs/wadl2java/wadl-with-name-customization.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | wadl-client-plugin 6 | 7 | ${basedir}/target/test-harness/wadl-with-name-customization/generated-sources/wadl 8 | ${basedir}/src/test/resources/wadl-with-name-customization 9 | test 10 | *.wadl 11 | 12 | ${basedir}/src/test/resources/wadl-with-name-customization/customize.xml 13 | 14 | true 15 | false 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/broken-wadl/Broken.wadl: -------------------------------------------------------------------------------- 1 | A very broken WADL -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/forecast.io-wadl/datablock.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "object", 3 | "$schema" : "http://json-schema.org/draft-03/schema", 4 | "id" : "datablock", 5 | "properties" : { 6 | "data" : { 7 | "type" : "array", 8 | "required" : false, 9 | "items" : { 10 | "$ref" : "datapoint.json" 11 | } 12 | }, 13 | "icon" : { 14 | "type" : "string", 15 | "required" : false 16 | }, 17 | "summary" : { 18 | "type" : "string", 19 | "required" : false 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/forecast.io-wadl/datapoint.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "object", 3 | "$schema" : "http://json-schema.org/draft-03/schema", 4 | "id" : "datapoint", 5 | "properties" : { 6 | "time" : { 7 | "type" : "number", 8 | "required" : true 9 | }, 10 | "summary" : { 11 | "type" : "string", 12 | "required" : false 13 | }, 14 | "icon" : { 15 | "type" : "string", 16 | "required" : false 17 | }, 18 | "sunriseTime" : { 19 | "type" : "number", 20 | "required" : false 21 | }, 22 | "sunsetTime" : { 23 | "type" : "number", 24 | "required" : false 25 | }, 26 | "precipIntensity" : { 27 | "type" : "number", 28 | "required" : false 29 | }, 30 | "precipIntensityError" : { 31 | "type" : "number", 32 | "required" : false 33 | }, 34 | "precipIntensityMax" : { 35 | "type" : "number", 36 | "required" : false 37 | }, 38 | "precipIntensityMaxTime" : { 39 | "type" : "number", 40 | "required" : false 41 | }, 42 | "precipIntensityMaxError" : { 43 | "type" : "number", 44 | "required" : false 45 | }, 46 | "precipProbability" : { 47 | "type" : "number", 48 | "required" : false 49 | }, 50 | "precipProbabilityError" : { 51 | "type" : "number", 52 | "required" : false 53 | }, 54 | "precipType" : { 55 | "type" : "string", 56 | "required" : false 57 | }, 58 | "precipAccumulation" : { 59 | "type" : "number", 60 | "required" : false 61 | }, 62 | "precipAccumulationError" : { 63 | "type" : "number", 64 | "required" : false 65 | }, 66 | "temperature" : { 67 | "type" : "number", 68 | "required" : false 69 | }, 70 | "temperatureError" : { 71 | "type" : "number", 72 | "required" : false 73 | }, 74 | "temperatureMin" : { 75 | "type" : "number", 76 | "required" : false 77 | }, 78 | "temperatureMinTime" : { 79 | "type" : "number", 80 | "required" : false 81 | }, 82 | "temperatureMinError" : { 83 | "type" : "number", 84 | "required" : false 85 | }, 86 | "temperatureMax" : { 87 | "type" : "number", 88 | "required" : false 89 | }, 90 | "temperatureMaxTime" : { 91 | "type" : "number", 92 | "required" : false 93 | }, 94 | "temperatureMaxError" : { 95 | "type" : "number", 96 | "required" : false 97 | }, 98 | "dewPoint" : { 99 | "type" : "number", 100 | "required" : false 101 | }, 102 | "dewPointError" : { 103 | "type" : "number", 104 | "required" : false 105 | }, 106 | "windSpeed" : { 107 | "type" : "number", 108 | "required" : false 109 | }, 110 | "windSpeedError" : { 111 | "type" : "number", 112 | "required" : false 113 | }, 114 | "windBearing" : { 115 | "type" : "number", 116 | "required" : false 117 | }, 118 | "windBearingError" : { 119 | "type" : "number", 120 | "required" : false 121 | }, 122 | "cloudCover" : { 123 | "type" : "number", 124 | "required" : false 125 | }, 126 | "cloudCoverError" : { 127 | "type" : "number", 128 | "required" : false 129 | }, 130 | "humidity" : { 131 | "type" : "number", 132 | "required" : false 133 | }, 134 | "humidityError" : { 135 | "type" : "number", 136 | "required" : false 137 | }, 138 | "pressure" : { 139 | "type" : "number", 140 | "required" : false 141 | }, 142 | "pressureError" : { 143 | "type" : "number", 144 | "required" : false 145 | }, 146 | "visibility" : { 147 | "type" : "number", 148 | "required" : false 149 | }, 150 | "visibilityError" : { 151 | "type" : "number", 152 | "required" : false 153 | }, 154 | "ozone" : { 155 | "type" : "number", 156 | "required" : false 157 | }, 158 | "ozoneError" : { 159 | "type" : "number", 160 | "required" : false 161 | } 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/forecast.io-wadl/forecast.json: -------------------------------------------------------------------------------- 1 | { 2 | "type" : "object", 3 | "$schema" : "http://json-schema.org/draft-03/schema", 4 | "id" : "forecast", 5 | "properties" : { 6 | "latitude" : { 7 | "type" : "number", 8 | "required" : true 9 | }, 10 | "longitude" : { 11 | "type" : "number", 12 | "required" : true 13 | }, 14 | "offset" : { 15 | "type" : "number", 16 | "required" : false 17 | }, 18 | "timezone" : { 19 | "type" : "string", 20 | "required" : true 21 | }, 22 | "currently" : { 23 | "$ref" : "datapoint.json", 24 | "required" : false 25 | }, 26 | "minutely" : { 27 | "$ref" : "datablock.json", 28 | "required" : false 29 | }, 30 | "hourly" : { 31 | "$ref" : "datablock.json", 32 | "required" : false 33 | }, 34 | "daily" : { 35 | "$ref" : "datablock.json", 36 | "required" : false 37 | }, 38 | "alerts" : { 39 | "type" : "array", 40 | "required" : "false", 41 | "items" : { 42 | "type" : "object", 43 | "properties" : { 44 | "title" : { 45 | "type" : "string", 46 | "required" : true 47 | }, 48 | "expires" : { 49 | "type" : "number", 50 | "required" : true 51 | }, 52 | "uri" : { 53 | "type" : "uri", 54 | "required" : true 55 | } 56 | } 57 | } 58 | }, 59 | "flags" : { 60 | "type" : "object", 61 | "required" : false, 62 | "properties" : { 63 | "darksky-unavailable" : { 64 | "type" : "string", 65 | "required" : false 66 | }, 67 | "darksky-stations" : { 68 | "type" : "array", 69 | "required" : false, 70 | "items" : { 71 | "type" : "string", 72 | "required" : false 73 | } 74 | }, 75 | "datapoint-stations" : { 76 | "type" : "array", 77 | "required" : false, 78 | "items" : { 79 | "type" : "string", 80 | "required" : false 81 | } 82 | }, 83 | "isd-stations" : { 84 | "type" : "array", 85 | "required" : false, 86 | "items" : { 87 | "type" : "string", 88 | "required" : false 89 | } 90 | }, 91 | "lamp-stations" : { 92 | "type" : "array", 93 | "required" : false, 94 | "items" : { 95 | "type" : "string", 96 | "required" : false 97 | } 98 | }, 99 | "metar-stations" : { 100 | "type" : "array", 101 | "required" : false, 102 | "items" : { 103 | "type" : "string", 104 | "required" : false 105 | } 106 | }, 107 | "sources" : { 108 | "type" : "array", 109 | "required" : false, 110 | "items" : { 111 | "type" : "string", 112 | "required" : false 113 | } 114 | }, 115 | "metno-license" : { 116 | "type" : "string", 117 | "required" : false 118 | }, 119 | "units" : { 120 | "type" : "string", 121 | "required" : false 122 | } 123 | } 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/forecast.io-wadl/forecast.wadl: -------------------------------------------------------------------------------- 1 | 2 | 5 | A describe of the REST provided by forecast.io 6 | 7 | 8 | 9 | This is the forecast.io API key used to control access to the server, 10 | you can get an API key from http://developer.forecast.io 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | The date of the weather forecast expressed in Unix time in seconds 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | The latitude of the weather report request 33 | 34 | 35 | The longitude of the weather report request 36 | 37 | 38 | 39 | 40 | 41 | 42 | The callback for the purposes of JSONP 43 | 44 | 45 | The units to be used to render the weather data 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | A comma delimeted list, of any of the following" currently, minutely, daily, alerts, flags 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-nonamespace-wadl/HelloBean.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-nonamespace-wadl/HelloBean.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-nonamespace-wadl/simple.jaxb: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-wadl/HelloBean.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-wadl/HelloBean.xsd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/hellobean-wadl/simple.jaxb: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/jaxb-missing-schema/missing-scehma.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/jsoninout-wadl/MultipleContentTypes.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/jsoninout-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=info, stdout 2 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 3 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/matrixparam-wadl/Parameter.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/matrixparam-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-jsonschema-wadl/MultipleContentTypes.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-jsonschema-wadl/requestMessage: -------------------------------------------------------------------------------- 1 | {"type":"object","properties":{"text":{"type":"string"}},"name":"requestMessage"} 2 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-jsonschema-wadl/responseMessage: -------------------------------------------------------------------------------- 1 | {"type":"object","properties":{"text":{"type":"string"}},"name":"responseMessage"} 2 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-jsonschema-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-wadl/MultipleContentTypes.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/multiple-contenttypes-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/nested-wadl/NestedWADL.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/no-response-content/NoResponse.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/no-response-content/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/nonjaxb-wadl/HelloWorld.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/officedirectory-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/open-patent-services/customization-hacked.xjb: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/open-patent-services/customization-original.xjb: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/open-patent-services/wadl/notes.txt: -------------------------------------------------------------------------------- 1 | These .wadl files are from 2 | 3 | http://www.epo.org/searching/free/ops.html 4 | 5 | ops-original is the original one 6 | ops-hacked is one modified to be compliant with the spec / and with 7 | extra entries for test purposes. -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/org/jvnet/ws/wadl/maven/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/parameterized-wadl/Parameter.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/parameterized-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/paramterized-wadl/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-maven-plugin/src/test/resources/paramterized-wadl/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/regex-template-wadl/application.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/reserved-words-wadl/HelloBean.xsd: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/reserved-words-wadl/ReservedWords.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/resources-with-same-name-wadl/application.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/resources-with-same-name-wadl/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/smoke-test/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaee/wadl/cef9a66435ca6f2a3a15310c6c8910bdec818120/wadl/wadl-maven-plugin/src/test/resources/smoke-test/.gitkeep -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/soapui-yahoo-wadl/NewsSearchError.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/soapui-yahoo-wadl/NewsSearchResponse.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/soapui-yahoo-wadl/SoapUIYahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | The Yahoo News Search service provides online searching of news 17 | stories from around the world. 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | The Yahoo News Search service provides online searching of news 29 | stories from around the world. 30 | 31 | 32 | The application ID. See Application IDs for more information. 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 52 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-catalog/NewsSearchError.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-catalog/NewsSearchResponse.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-catalog/YahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | The Yahoo News Search service provides online searching of news 28 | stories from around the world. 29 | 30 | 31 | The application ID. See Application IDs for more information. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 48 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-customizations/NewsSearchError.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-customizations/NewsSearchResponse.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-customizations/YahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | The Yahoo News Search service provides online searching of news 28 | stories from around the world. 29 | 30 | 31 | The application ID. See Application IDs for more information. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 48 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl-with-customizations/binding.xjb: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl/NewsSearchError.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl/NewsSearchResponse.xsd: -------------------------------------------------------------------------------- 1 | 2 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/valid-wadl/YahooSearch.wadl: -------------------------------------------------------------------------------- 1 | 2 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | The Yahoo News Search service provides online searching of news 28 | stories from around the world. 29 | 30 | 31 | The application ID. See Application IDs for more information. 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 48 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/wadl-with-name-customization/application.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/wadl-with-name-customization/customize.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /wadl/wadl-maven-plugin/src/test/resources/wadl-with-name-customization/xsd0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | org.jvnet.ws.wadl 6 | wadl 7 | 1.1.8-SNAPSHOT 8 | 9 | wadl-xslt 10 | WADL XSLT 11 | 12 | A small module providing some XSLT extensions to deal with WADL 13 | URI templates in an XSLT stylesheet. 14 | 15 | 16 | 17 | wilfred 18 | Wilfred Springer 19 | 20 | 21 | 22 | 23 | junit 24 | junit 25 | ${junit.version} 26 | test 27 | 28 | 29 | org.mockito 30 | mockito-all 31 | 1.7 32 | test 33 | 34 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/main/java/org/jvnet/ws/wadl/xslt/UriTemplateParser.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.xslt; 2 | 3 | /** 4 | * A simple parser for URI templates. 5 | * 6 | */ 7 | public class UriTemplateParser { 8 | 9 | private enum State { 10 | InsideParam, OutsideParam; 11 | } 12 | 13 | /** 14 | * Parses the template, calling back on the handler for every component in 15 | * the template. 16 | * 17 | * @param template The URI template. 18 | * @param handler The object receiving call backs. 19 | */ 20 | public static void parse(String template, Handler handler) { 21 | assert template != null; 22 | assert handler != null; 23 | int pos = 0; 24 | final int length = template.length(); 25 | State state = State.OutsideParam; 26 | StringBuilder builder = new StringBuilder(); 27 | while (pos < length) { 28 | char c = template.charAt(pos++); 29 | switch (state) { 30 | case InsideParam: { 31 | if (c == '}') { 32 | if (builder.length() > 0) { 33 | handler.handleParam(builder.toString()); 34 | builder.setLength(0); 35 | } 36 | state = State.OutsideParam; 37 | } 38 | else { 39 | builder.append(c); 40 | } 41 | break; 42 | } 43 | case OutsideParam: { 44 | if (c == '{') { 45 | if (builder.length() > 0) { 46 | handler.handleText(builder.toString()); 47 | builder.setLength(0); 48 | } 49 | state = State.InsideParam; 50 | } 51 | else { 52 | builder.append(c); 53 | } 54 | break; 55 | } 56 | } 57 | } 58 | if (builder.length() > 0) { 59 | switch (state) { 60 | case InsideParam: 61 | handler.handleParam(builder.toString()); 62 | break; 63 | case OutsideParam: 64 | handler.handleText(builder.toString()); 65 | break; 66 | } 67 | } 68 | } 69 | 70 | /** 71 | * The interface that will receive callbacks. 72 | * 73 | */ 74 | public interface Handler { 75 | 76 | /** 77 | * Called for text in the template. 78 | */ 79 | void handleText(String text); 80 | 81 | /** 82 | * Called for parameters in the template. 83 | * 84 | * @param param The name of the parameter. 85 | */ 86 | void handleParam(String param); 87 | 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/main/java/org/jvnet/ws/wadl/xslt/WadlXsltUtils.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.xslt; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * A collection of helper utilities for accessing common XSL scripts and 7 | * functions for use in them. 8 | * 9 | */ 10 | public class WadlXsltUtils { 11 | 12 | /** 13 | * @return A transform that upgrades the current WADL to the '2009 14 | * standard 15 | */ 16 | public static InputStream getUpgradeTransformAsStream() { 17 | return WadlXsltUtils.class.getResourceAsStream("upgrade.xsl"); 18 | } 19 | 20 | /** 21 | * A the moment this template requires the Oracle XDK; but in future the ideal 22 | * is to move towards a vanilla XSLT document without any specific parser or 23 | * java dependencies 24 | * 25 | * @return A template that will transform a WADL into a user readable 26 | * HTML document. 27 | */ 28 | public static InputStream getWadlSummaryTransform() { 29 | return WadlXsltUtils.class.getResourceAsStream("wadl_2009-02.xsl"); 30 | } 31 | 32 | /** 33 | * @todo Figure out how to do this is XSLT 34 | * @param uri The input URI 35 | * @return A String where each / has been replaced with a / and a soft 36 | * hyphen 37 | */ 38 | public static String hypernizeURI(String uri) { 39 | // ­ and didn't work; but this is apparently font related 40 | String result = uri.replaceAll("/", "/​"); 41 | return result; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/test/java/org/jvnet/ws/wadl/xslt/UriTemplateParserTest.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.xslt; 2 | 3 | import static org.mockito.Mockito.verify; 4 | import static org.mockito.Mockito.verifyNoMoreInteractions; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.jvnet.ws.wadl.xslt.UriTemplateParser; 9 | import org.jvnet.ws.wadl.xslt.UriTemplateParser.Handler; 10 | import org.mockito.Mock; 11 | import org.mockito.runners.MockitoJUnit44Runner; 12 | 13 | @RunWith(MockitoJUnit44Runner.class) 14 | public class UriTemplateParserTest { 15 | 16 | @Mock 17 | private Handler handler; 18 | 19 | @Test 20 | public void shouldParseParameterFirst() { 21 | UriTemplateParser.parse("{a}/bc", handler); 22 | verify(handler).handleParam("a"); 23 | verify(handler).handleText("/bc"); 24 | verifyNoMoreInteractions(handler); 25 | } 26 | 27 | @Test 28 | public void shouldParseParameterLast() { 29 | UriTemplateParser.parse("bc/{a}", handler); 30 | verify(handler).handleText("bc/"); 31 | verify(handler).handleParam("a"); 32 | verifyNoMoreInteractions(handler); 33 | } 34 | 35 | @Test 36 | public void shouldParseMultipleParameters() { 37 | UriTemplateParser.parse("bc/{a}{b}", handler); 38 | verify(handler).handleText("bc/"); 39 | verify(handler).handleParam("a"); 40 | verify(handler).handleParam("b"); 41 | verifyNoMoreInteractions(handler); 42 | } 43 | 44 | @Test 45 | public void shouldParseEmpty() { 46 | UriTemplateParser.parse("", handler); 47 | verifyNoMoreInteractions(handler); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/test/java/org/jvnet/ws/wadl/xslt/WadlXsltUtilsTest.java: -------------------------------------------------------------------------------- 1 | package org.jvnet.ws.wadl.xslt; 2 | 3 | import static org.hamcrest.CoreMatchers.equalTo; 4 | import static org.hamcrest.CoreMatchers.notNullValue; 5 | import static org.junit.Assert.assertThat; 6 | import org.junit.Test; 7 | 8 | public class WadlXsltUtilsTest { 9 | 10 | @Test 11 | public void hypernizUriTest() { 12 | 13 | String uri = "http://one/long/string"; 14 | String result = WadlXsltUtils.hypernizeURI(uri); 15 | 16 | // Check that the URI will now properly hypernate 17 | assertThat(5, equalTo(result.split("&").length)); 18 | } 19 | 20 | 21 | @Test 22 | public void checkTemplatesExistTest() { 23 | 24 | 25 | // Check that the URI will now properly hypernate 26 | assertThat(WadlXsltUtils.getUpgradeTransformAsStream(), notNullValue()); 27 | assertThat(WadlXsltUtils.getWadlSummaryTransform(), notNullValue()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/test/resources/schemas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/test/resources/search.wadl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | The identifier of the project. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /wadl/wadl-xslt/src/test/resources/test.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | : 12 | 13 | [ 14 | 15 | : ' 16 | 17 | '] 18 | 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------