You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rs...@apache.org on 2017/11/03 19:02:44 UTC
svn commit: r1814233 - in
/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src:
main/java/org/apache/meecrowave/maven/
test/java/org/apache/meecrowave/maven/ test/java/org/app/ test/resources/
Author: rsandtner
Date: Fri Nov 3 19:02:43 2017
New Revision: 1814233
URL: http://svn.apache.org/viewvc?rev=1814233&view=rev
Log:
MEECROWAVE-76 include meecrowave.properties in meecrowave:run
Added:
openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Model.java
openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/resources/meecrowave.properties
Modified:
openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/apache/meecrowave/maven/MeecrowaveRunMojoTest.java
openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java
Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java?rev=1814233&r1=1814232&r2=1814233&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/main/java/org/apache/meecrowave/maven/MeecrowaveRunMojo.java Fri Nov 3 19:02:43 2017
@@ -403,6 +403,7 @@ public class MeecrowaveRunMojo extends A
getLog().warn("can't initialize attribute " + field.getName());
}
}
+ config.loadFrom(meecrowaveProperties);
if (properties != null) {
config.getProperties().putAll(properties);
}
Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/apache/meecrowave/maven/MeecrowaveRunMojoTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/apache/meecrowave/maven/MeecrowaveRunMojoTest.java?rev=1814233&r1=1814232&r2=1814233&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/apache/meecrowave/maven/MeecrowaveRunMojoTest.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/apache/meecrowave/maven/MeecrowaveRunMojoTest.java Fri Nov 3 19:02:43 2017
@@ -44,6 +44,7 @@ import java.util.concurrent.TimeUnit;
import static org.apache.ziplock.JarLocation.jarLocation;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class MeecrowaveRunMojoTest {
@@ -103,6 +104,10 @@ public class MeecrowaveRunMojoTest {
for (int i = 0; i < 120; i++) {
try {
assertEquals("simple", IOUtils.toString(new URL("http://localhost:" + port + "/api/test")));
+ assertTrue(IOUtils.toString(new URL("http://localhost:" + port + "/api/test/model")).contains("first_name"));
+ assertTrue(IOUtils.toString(new URL("http://localhost:" + port + "/api/test/model")).contains("last_name"));
+ assertTrue(IOUtils.toString(new URL("http://localhost:" + port + "/api/test/model")).contains("firstname"));
+ assertTrue(IOUtils.toString(new URL("http://localhost:" + port + "/api/test/model")).contains("null"));
latch.countDown();
break;
} catch (final Exception | AssertionError e) {
Modified: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java?rev=1814233&r1=1814232&r2=1814233&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java (original)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Endpoint.java Fri Nov 3 19:02:43 2017
@@ -36,4 +36,13 @@ public class Endpoint {
public String simple() {
return Boolean.parseBoolean(injectable.injected()) ? "simple" : "fail";
}
+
+ @GET
+ @Path("/model")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Model simpleJsonModel() {
+ Model model = new Model();
+ model.setFirstName("firstname");
+ return model;
+ }
}
Added: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Model.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Model.java?rev=1814233&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Model.java (added)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/java/org/app/Model.java Fri Nov 3 19:02:43 2017
@@ -0,0 +1,42 @@
+/*
+ * 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.app;
+
+public class Model {
+
+ private String firstName;
+ private String lastName;
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+}
Added: openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/resources/meecrowave.properties
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/resources/meecrowave.properties?rev=1814233&view=auto
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/resources/meecrowave.properties (added)
+++ openwebbeans/meecrowave/trunk/meecrowave-maven-plugin/src/test/resources/meecrowave.properties Fri Nov 3 19:02:43 2017
@@ -0,0 +1,19 @@
+# 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.
+
+jsonb-naming-strategy = LOWER_CASE_WITH_UNDERSCORES
+jsonb-nulls = true