Skip to content

Commit

Permalink
Multipane (#44)
Browse files Browse the repository at this point in the history
* Initial converting commit, formatting READEME and POM

* Multipane conversion

* Displaying files correctly

* Trying formatting for multipane

* Reformatting multipane style

* Reformatting multipane style

* Adding hotspots

* Fixing tags

* Minor updates

* Fixing hotspot

* Formatting, updating travis and failsafe plugin

* pom change, xml element formatting, adding role=command

* hotspot updates

* updating liberty maven parent plugin

* Add guide author

* Post review feedback

* Updating file number

* 2nd round review

* adding role=command

* removing role=command

* Bolding code commands

* Removing code=commands

* Fixing issue with code not displaying in right column:

* Removed finish.adoc include from README.adoc

* Updating dependency order

* JDK 11 pom update

* Updated README and pom.xml comment

* Changed to CREATE file in README.adoc

* Updating README

* Updated pom.xml

* Updated README with [hotspot] changes

* Updated README with link in new tab changes

* Deleted pom and updated README.adoc

* Formatted server.xml and updated README

* Updating hotspots and readme

* Fixing code command not switching tabs and hotspot

* Change the guide attribution to point to master

* Update HelloServlet.java

* Update EndpointIT.java

* Update HelloServlet.java
  • Loading branch information
justineechen authored and gkwan-ibm committed Feb 27, 2019
1 parent 02728ac commit 215d902
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 154 deletions.
14 changes: 13 additions & 1 deletion .gitignore
@@ -1,3 +1,15 @@
target/
.project

# Eclipse generated
.apt_generated/
.settings/
.project
.classpath
.factorypath
MANIFEST.MF

# MacOS system files
.DS_Store

# Asciidoc rendered
README.html
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,7 @@ before_script:
- unset _JAVA_OPTIONS
- cd finish
script:
- mvn clean install
- mvn -q clean install
- serverName=$(target/liberty/wlp/bin/server list | cut -d '.' -f2| tr -d '\n');
- build=$(grep "Open Liberty" target/liberty/wlp/usr/servers/"$serverName"/logs/console.log
| cut -d' ' -f5 | cut -d')' -f1 ); release=$( echo "$build" | cut -d'/' -f1); number=$(
Expand Down
277 changes: 176 additions & 101 deletions README.adoc

Large diffs are not rendered by default.

55 changes: 18 additions & 37 deletions finish/pom.xml
@@ -1,44 +1,31 @@
<?xml version='1.0' encoding='utf-8'?>
<!-- tag::whole[] -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.wasdev.wlp.maven.parent</groupId>
<artifactId>liberty-maven-app-parent</artifactId>
<version>2.0</version>
<version>RELEASE</version>
</parent>
<!-- Add the rest of the POM below here. -->
<!-- tag::coordinates[] -->

<groupId>io.openliberty.guides</groupId>
<artifactId>ServletSample</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<!-- end::coordinates[] -->
<!-- tag::properties[] -->

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<app.name>${project.artifactId}</app.name>
<!-- tag::serverProperties[] -->
<testServerHttpPort>9080</testServerHttpPort>
<testServerHttpsPort>9443</testServerHttpsPort>
<warContext>${app.name}</warContext>
<!-- end::serverProperties[] -->
<package.file>${project.build.directory}/${app.name}.zip</package.file>
<packaging.type>usr</packaging.type>
</properties>
<!-- end::properties[] -->
<!-- tag::dependencies[] -->
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<!-- tag::dependencies_test[] -->
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
Expand All @@ -51,30 +38,34 @@
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- Support for JDK 9 and above -->
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.11</version>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.11</version>
<version>2.3.0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<!-- end::dependencies_test[] -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<!-- end::dependencies[] -->
<!-- tag::build[] -->
<build>
<plugins>
<plugin>
Expand All @@ -88,7 +79,6 @@
<plugin>
<groupId>net.wasdev.wlp.maven.plugins</groupId>
<artifactId>liberty-maven-plugin</artifactId>
<version>2.6.1</version>
<configuration>
<assemblyArtifact>
<groupId>io.openliberty</groupId>
Expand All @@ -110,21 +100,16 @@
<executions>
<execution>
<id>package-server</id>
<phase>package</phase>
<goals>
<goal>package-server</goal>
</goals>
<configuration>
<outputDirectory>target/wlp-package</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- tag::build_test[] -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<version>3.0.0-M1</version>
<executions>
<execution>
<goals>
Expand All @@ -136,19 +121,15 @@
<include>**/it/**</include>
</includes>
<systemPropertyVariables>
<liberty.test.port>${testServerHttpPort}</liberty.test.port>
<liberty.test.port>
${testServerHttpPort}
</liberty.test.port>
<war.name>${warContext}</war.name>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<!-- end::build_test[] -->
</plugins>
</build>
<!-- end::build[] -->



</project>
<!-- end::whole[] -->
@@ -1,6 +1,6 @@
// tag::comment[]
/*******************************************************************************
* Copyright (c) 2017 IBM Corporation and others.
* Copyright (c) 2017, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -27,14 +27,16 @@ public class HelloServlet extends HttpServlet {
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().append("Hello! How are you today?\n");
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}
3 changes: 2 additions & 1 deletion finish/src/main/liberty/config/server.xml
Expand Up @@ -3,7 +3,8 @@
<feature>servlet-3.1</feature>
</featureManager>

<httpEndpoint httpPort="${default.http.port}" httpsPort="${default.https.port}" id="defaultHttpEndpoint" host="*" />
<httpEndpoint httpPort="${default.http.port}"
httpsPort="${default.https.port}" id="defaultHttpEndpoint" host="*" />

<webApplication id="ServletSample" location="ServletSample.war" contextRoot="${app.context.root}" />
</server>
@@ -1,6 +1,6 @@
// tag::comment[]
// tag::copyright[]
/*******************************************************************************
* Copyright (c) 2017 IBM Corporation and others.
* Copyright (c) 2017, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -9,7 +9,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
// end::comment[]
// end::copyright[]
package io.openliberty.guides.hello.it;

import static org.junit.Assert.*;
Expand All @@ -21,17 +21,14 @@

public class EndpointIT {
private static String URL;


@BeforeClass
public static void init() {

// tag::URL[]
String port = System.getProperty("liberty.test.port");
String war = System.getProperty("war.name");
URL = "http://localhost:" + port + "/" + war + "/" + "servlet";
// end::URL[]

}

@Test
Expand All @@ -47,7 +44,8 @@ public void testServlet() throws Exception {

String response = method.getResponseBodyAsString(1000);

assertTrue("Unexpected response body", response.contains("Hello! How are you today?"));
assertTrue("Unexpected response body",
response.contains("Hello! How are you today?"));
} finally {
method.releaseConnection();
}
Expand Down
@@ -1,6 +1,6 @@
// tag::comment[]
/*******************************************************************************
* Copyright (c) 2017 IBM Corporation and others.
* Copyright (c) 2017, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -27,14 +27,16 @@ public class HelloServlet extends HttpServlet {
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().append("Hello! How are you today?\n");
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
}

0 comments on commit 215d902

Please sign in to comment.