Skip to content

Commit

Permalink
Rename httprpc-server project to httprpc.
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-brown committed Jul 28, 2018
1 parent f69fab9 commit 08ed603
Show file tree
Hide file tree
Showing 62 changed files with 30 additions and 30 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Releases](https://img.shields.io/github/release/gk-brown/HTTP-RPC.svg)](https://github.com/gk-brown/HTTP-RPC/releases)
[![Maven Central](https://img.shields.io/maven-central/v/org.httprpc/httprpc-server.svg)](http://repo1.maven.org/maven2/org/httprpc/httprpc-server/)
[![Maven Central](https://img.shields.io/maven-central/v/org.httprpc/httprpc.svg)](http://repo1.maven.org/maven2/org/httprpc/httprpc/)

# Introduction
HTTP-RPC is an open-source framework for implementing REST services in Java. It is extremely lightweight and requires only a Java runtime environment and a servlet container. The entire framework is distributed as a single JAR file that is about 52KB in size, making it an ideal choice for applications such as microservices where a minimal footprint is desired.
Expand All @@ -25,7 +25,7 @@ The HTTP-RPC JAR file can be downloaded [here](https://github.com/gk-brown/HTTP-
```xml
<dependency>
<groupId>org.httprpc</groupId>
<artifactId>httprpc-server</artifactId>
<artifactId>httprpc</artifactId>
<version>...</version>
</dependency>
```
Expand Down Expand Up @@ -599,7 +599,7 @@ If the server returns an error response, a `WebServiceException` will be thrown.
For example, the following code snippet demonstrates how `WebServiceProxy` might be used to access the operations of the simple math service discussed earlier:
```java
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-server/math/sum"));
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc/math/sum"));
webServiceProxy.getArguments().put("a", 4);
webServiceProxy.getArguments().put("b", 2);
Expand Down Expand Up @@ -642,12 +642,12 @@ public interface MathService {
This code uses the `adapt()` method to create an instance of `MathService`, then invokes the `getSum()` method on the returned instance. The results are identical to the previous example:
```java
MathService mathService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-server-test/math/"), MathService.class);
MathService mathService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-test/math/"), MathService.class);
Number result = mathService.getSum(4, 2);
System.out.println(result); // 6.0
```
# Additional Information
This guide introduced the HTTP-RPC framework and provided an overview of its key features. For additional information, see the the [examples](https://github.com/gk-brown/HTTP-RPC/tree/master/httprpc-server-test/src/org/httprpc/test).
This guide introduced the HTTP-RPC framework and provided an overview of its key features. For additional information, see the the [examples](https://github.com/gk-brown/HTTP-RPC/tree/master/httprpc-test/src/org/httprpc/test).
2 changes: 1 addition & 1 deletion httprpc-server-test/.classpath → httprpc-test/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="src" path="/httprpc-server">
<classpathentry kind="src" path="/httprpc">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion httprpc-server-test/.project → httprpc-test/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>httprpc-server-test</name>
<name>httprpc-test</name>
<comment></comment>
<projects/>
<natures>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
#Fri Jul 27 08:55:19 EDT 2018
#Sat Jul 28 09:34:09 EDT 2018
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="httprpc-server-test">
<property name="context-root" value="httprpc-server-test"/>
<wb-module deploy-name="httprpc-test">
<property name="context-root" value="httprpc-test"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/" source-path="src/main/webapp"/>
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/httprpc-server/httprpc-server">
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/resource/httprpc/httprpc">
<dependency-type>uses</dependency-type>
</dependent-module>
</wb-module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repositories {
}

dependencies {
compile project(':httprpc-server')
compile project(':httprpc')
providedCompile 'javax.servlet:javax.servlet-api:3.1.0'
providedCompile 'javax.servlet:jsp-api:2.0'
implementation 'org.jtemplate:jtemplate:2.2+'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion httprpc-server/.project → httprpc/.project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>httprpc-server</name>
<name>httprpc</name>
<comment></comment>
<projects/>
<natures>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
#Fri Jul 27 08:55:19 EDT 2018
#Sat Jul 28 09:34:09 EDT 2018
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
Expand Down
6 changes: 3 additions & 3 deletions httprpc-server/build.gradle → httprpc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
}

group = 'org.httprpc'
version = '5.4.2'
version = '5.5'

repositories {
mavenCentral()
Expand Down Expand Up @@ -64,7 +64,7 @@ publishing {

publications {
mavenJava(MavenPublication) {
artifactId = 'httprpc-server'
artifactId = 'httprpc'
from components.java
artifact sourcesJar
artifact javadocJar
Expand All @@ -86,7 +86,7 @@ publishing {
}
scm {
connection = 'scm:git:git://github.com/gk-brown/HTTP-RPC.git'
url = 'https://github.com/gk-brown/HTTP-RPC/tree/master/httprpc-server'
url = 'https://github.com/gk-brown/HTTP-RPC/tree/master/httprpc'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void main(String[] args) throws Exception {
}

public static void testGet() throws Exception {
TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-server-test/test"), TestService.class);
TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-test/test"), TestService.class);

Map<String, ?> result = testService.testGet("héllo+gøodbye", listOf("a", "b", "c"), 123, true,
date, localDate, localTime, localDateTime);
Expand All @@ -121,15 +121,15 @@ public static void testGet() throws Exception {
}

public static void testGetFibonnaci() throws Exception {
TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-server-test/test/"), TestService.class);
TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-test/test/"), TestService.class);

List<Number> fibonacci = testService.testGetFibonacci();

validate("GET (Fibonacci)", fibonacci.equals(listOf(1, 2, 3, 5, 8, 13)));
}

public static void testURLEncodedPost() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("POST", new URL("http://localhost:8080/httprpc-server-test/test"));
WebServiceProxy webServiceProxy = new WebServiceProxy("POST", new URL("http://localhost:8080/httprpc-test/test"));

webServiceProxy.getArguments().putAll(mapOf(
entry("string", "héllo+gøodbye"),
Expand Down Expand Up @@ -159,7 +159,7 @@ public static void testMultipartPost() throws Exception {
URL textTestURL = WebServiceProxyTest.class.getResource("test.txt");
URL imageTestURL = WebServiceProxyTest.class.getResource("test.jpg");

TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-server-test/test"), TestService.class);
TestService testService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-test/test"), TestService.class);

Map<String, ?> result = testService.testPost("héllo+gøodbye", listOf("a", "b", "c"), 123, true,
date, localDate, localTime, localDateTime,
Expand All @@ -182,7 +182,7 @@ public static void testMultipartPost() throws Exception {
}

public static void testCustomPost() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("POST", new URL("http://localhost:8080/httprpc-server-test/test"));
WebServiceProxy webServiceProxy = new WebServiceProxy("POST", new URL("http://localhost:8080/httprpc-test/test"));

URL imageTestURL = WebServiceProxyTest.class.getResource("test.jpg");

Expand All @@ -207,7 +207,7 @@ public static void testCustomPost() throws Exception {
}

public static void testPut() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("PUT", new URL("http://localhost:8080/httprpc-server-test/test"));
WebServiceProxy webServiceProxy = new WebServiceProxy("PUT", new URL("http://localhost:8080/httprpc-test/test"));

URL textTestURL = WebServiceProxyTest.class.getResource("test.txt");

Expand Down Expand Up @@ -241,7 +241,7 @@ public static void testPut() throws Exception {
}

public static void testDelete() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("DELETE", new URL("http://localhost:8080/httprpc-server-test/test"));
WebServiceProxy webServiceProxy = new WebServiceProxy("DELETE", new URL("http://localhost:8080/httprpc-test/test"));

webServiceProxy.getArguments().putAll(mapOf(
entry("id", 101)
Expand All @@ -253,7 +253,7 @@ public static void testDelete() throws Exception {
}

public static void testError() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-server/test/error"));
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc/test/error"));

boolean error;
try {
Expand All @@ -268,7 +268,7 @@ public static void testError() throws Exception {
}

public static void testTimeout() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-server-test/test"));
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-test/test"));

webServiceProxy.setConnectTimeout(3000);
webServiceProxy.setReadTimeout(3000);
Expand All @@ -291,7 +291,7 @@ public static void testTimeout() throws Exception {
}

public static void testMath() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-server-test/math/sum"));
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-test/math/sum"));

webServiceProxy.getArguments().put("a", 4);
webServiceProxy.getArguments().put("b", 2);
Expand All @@ -302,14 +302,14 @@ public static void testMath() throws Exception {
}

public static void testMathService() throws Exception {
MathService mathService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-server-test/math/"), MathService.class);
MathService mathService = WebServiceProxy.adapt(new URL("http://localhost:8080/httprpc-test/math/"), MathService.class);

validate("Math (service)", mathService.getSum(4, 2).equals(6)
&& mathService.getSum(listOf(1.0, 2.0, 3.0)).equals(6));
}

public static void testTree() throws Exception {
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-server-test/tree"));
WebServiceProxy webServiceProxy = new WebServiceProxy("GET", new URL("http://localhost:8080/httprpc-test/tree"));

TreeNode root = BeanAdapter.adapt(webServiceProxy.invoke(), TreeNode.class);

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = 'HTTP-RPC'

include 'httprpc-server', 'httprpc-server-test'
include 'httprpc', 'httprpc-test'

enableFeaturePreview('STABLE_PUBLISHING')

0 comments on commit 08ed603

Please sign in to comment.