From commits-return-45610-archive-asf-public=cust-asf.ponee.io@tomee.apache.org Fri Dec 21 14:01:08 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 246E318077D for ; Fri, 21 Dec 2018 14:01:06 +0100 (CET) Received: (qmail 34721 invoked by uid 500); 21 Dec 2018 13:01:06 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 34541 invoked by uid 99); 21 Dec 2018 13:01:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Dec 2018 13:01:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 83EDBE135E; Fri, 21 Dec 2018 13:01:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jgallimore@apache.org To: commits@tomee.apache.org Date: Fri, 21 Dec 2018 13:01:09 -0000 Message-Id: In-Reply-To: <1ec8d4b0835d440da8af55fadc75cb85@git.apache.org> References: <1ec8d4b0835d440da8af55fadc75cb85@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [5/6] tomee git commit: add exemple mvc-resteasy-hello add exemple mvc-resteasy-hello Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b2a656e8 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b2a656e8 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b2a656e8 Branch: refs/heads/master Commit: b2a656e8cd4da444ece331740f23af6c1826c815 Parents: af3362a Author: Daniel Dias Authored: Sat Dec 15 01:57:41 2018 -0200 Committer: Daniel Dias Committed: Fri Dec 21 01:52:26 2018 -0200 ---------------------------------------------------------------------- examples/mvc-resteasy/README.adoc | 2 +- examples/mvc-resteasy/pom.xml | 64 ++++----------- .../superbiz/application/MVCApplication.java | 6 -- .../superbiz/application/TomeeController.java | 22 ------ .../java/org/superbiz/mvc/MVCApplication.java | 22 ++++++ .../java/org/superbiz/mvc/TomeeController.java | 38 +++++++++ .../src/main/resources/META-INF/beans.xml | 17 ++++ .../src/test/java/org/superbiz/mvc/MVCTest.java | 57 -------------- .../superbiz/mvc/util/WebArchiveBuilder.java | 83 -------------------- .../src/test/resources/arquillian.xml | 35 --------- 10 files changed, 94 insertions(+), 252 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/README.adoc ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/README.adoc b/examples/mvc-resteasy/README.adoc index d38d459..6bf5847 100644 --- a/examples/mvc-resteasy/README.adoc +++ b/examples/mvc-resteasy/README.adoc @@ -13,7 +13,7 @@ Build and start the demo: Open: - http://localhost:8080/mvc-resteasy + http://localhost:8080/mvc-resteasy/app/hello?name=TomEE ==== Intro of Eclipse Krazo http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/pom.xml ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/pom.xml b/examples/mvc-resteasy/pom.xml index 6221d5a..a4a0c3d 100644 --- a/examples/mvc-resteasy/pom.xml +++ b/examples/mvc-resteasy/pom.xml @@ -34,8 +34,6 @@ 8.0.0-SNAPSHOT 1.0.0-m04 3.6.1.Final - 1.1.13.Final - 2.3.1 @@ -79,13 +77,6 @@ org.mvc-spec.ozark ozark-resteasy ${version.ozark} - runtime - - - - javax.mvc - javax.mvc-api - 1.0-pfd @@ -104,44 +95,21 @@ resteasy-servlet-initializer ${resteasy.version} - - - org.jboss.arquillian.junit - arquillian-junit-container - ${version.arquillian} - test - - - org.apache.tomee - arquillian-tomee-remote - ${tomee.version} - - - org.apache.tomee - apache-tomee - ${tomee.version} - webprofile - test - zip - - - org.jboss.arquillian.graphene - graphene-webdriver - ${version.graphene.webdriver} - pom - test - - - junit - junit - 4.11 - test - - - net.sourceforge.htmlunit - htmlunit - 2.32 - test - + + + + + localhost + file://${basedir}/target/repo/ + + + localhost + file://${basedir}/target/snapshot-repo/ + + http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/main/java/org/superbiz/application/MVCApplication.java ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/main/java/org/superbiz/application/MVCApplication.java b/examples/mvc-resteasy/src/main/java/org/superbiz/application/MVCApplication.java deleted file mode 100644 index 1cc2d0d..0000000 --- a/examples/mvc-resteasy/src/main/java/org/superbiz/application/MVCApplication.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.superbiz.application; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("app") -public class MVCApplication extends Application { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/main/java/org/superbiz/application/TomeeController.java ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/main/java/org/superbiz/application/TomeeController.java b/examples/mvc-resteasy/src/main/java/org/superbiz/application/TomeeController.java deleted file mode 100644 index c739a54..0000000 --- a/examples/mvc-resteasy/src/main/java/org/superbiz/application/TomeeController.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.superbiz.application; - -import javax.inject.Inject; -import javax.mvc.Controller; -import javax.mvc.Models; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.QueryParam; - -@Controller -@Path("hello") -public class TomeeController { - - @Inject - private Models models; - - @GET - public String getHello(@QueryParam("name") String name) { - this.models.put("hello", name); - return "hello.jsp"; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/MVCApplication.java ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/MVCApplication.java b/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/MVCApplication.java new file mode 100644 index 0000000..6303690 --- /dev/null +++ b/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/MVCApplication.java @@ -0,0 +1,22 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.superbiz.mvc; +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("app") +public class MVCApplication extends Application { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/TomeeController.java ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/TomeeController.java b/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/TomeeController.java new file mode 100644 index 0000000..9ca4ecf --- /dev/null +++ b/examples/mvc-resteasy/src/main/java/org/superbiz/mvc/TomeeController.java @@ -0,0 +1,38 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.superbiz.mvc; + +import javax.inject.Inject; +import javax.mvc.Controller; +import javax.mvc.Models; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.QueryParam; + +@Controller +@Path("hello") +public class TomeeController { + + @Inject + private Models models; + + @GET + public String getHello(@QueryParam("name") String name) { + this.models.put("hello", name); + return "hello.jsp"; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/main/resources/META-INF/beans.xml ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/main/resources/META-INF/beans.xml b/examples/mvc-resteasy/src/main/resources/META-INF/beans.xml index 86b63b7..13ea327 100644 --- a/examples/mvc-resteasy/src/main/resources/META-INF/beans.xml +++ b/examples/mvc-resteasy/src/main/resources/META-INF/beans.xml @@ -1,4 +1,21 @@ + additionalDependencies = new ArrayList<>(); - - public WebArchiveBuilder addPackage(String packageName) { - archive.addPackage(packageName); - return this; - } - - public WebArchiveBuilder addView(Asset asset, String name) { - archive.addAsWebInfResource(asset, "views/" + name); - return this; - } - - public WebArchiveBuilder addView(File file, String name) { - return this.addView(new FileAsset(file), name); - } - - public WebArchiveBuilder addBeansXml() { - archive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); - return this; - } - - public WebArchiveBuilder addDependencies(MavenDependency... dependencies) { - this.additionalDependencies.addAll(Arrays.asList(dependencies)); - return this; - } - - public WebArchiveBuilder addDependency(String coordinates) { - addDependencies(MavenDependencies.createDependency(coordinates, ScopeType.RUNTIME,false)); - return this; - } - - public WebArchive build() { - PomEquippedResolveStage stage = Maven.configureResolver().workOffline() - .withClassPathResolution(true) - .loadPomFromFile("pom.xml") - .importCompileAndRuntimeDependencies(); - - if (!this.additionalDependencies.isEmpty()) { - stage = stage.addDependencies(this.additionalDependencies); - } - - return archive.addAsLibraries(stage.resolve().withTransitivity().asFile()); - } - -} http://git-wip-us.apache.org/repos/asf/tomee/blob/b2a656e8/examples/mvc-resteasy/src/test/resources/arquillian.xml ---------------------------------------------------------------------- diff --git a/examples/mvc-resteasy/src/test/resources/arquillian.xml b/examples/mvc-resteasy/src/test/resources/arquillian.xml deleted file mode 100644 index cec14c8..0000000 --- a/examples/mvc-resteasy/src/test/resources/arquillian.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - -1 - -1 - -1 - target/tomee - target/arquillian-dump-dir - - - - - htmlunit - -