mirror of https://github.com/dapr/java-sdk.git
More reformatting to 2 spaces indentation. (#50)
This commit is contained in:
parent
78fec8f840
commit
6733fcdda8
|
@ -46,6 +46,7 @@ public class HelloWorldClient {
|
|||
|
||||
/**
|
||||
* Creates a Grpc client for the DaprGrpc service.
|
||||
*
|
||||
* @param host host for the remote service endpoint
|
||||
* @param port port for the remote service endpoint
|
||||
*/
|
||||
|
@ -58,6 +59,7 @@ public class HelloWorldClient {
|
|||
|
||||
/**
|
||||
* Helper constructor to build client from channel.
|
||||
*
|
||||
* @param channel
|
||||
*/
|
||||
private GrpcHelloWorldDaprClient(ManagedChannel channel) {
|
||||
|
@ -67,12 +69,12 @@ public class HelloWorldClient {
|
|||
|
||||
/**
|
||||
* Client mode: sends messages, one per second.
|
||||
*
|
||||
* @param messages
|
||||
*/
|
||||
private void sendMessages(String... messages) throws ExecutionException, InterruptedException, InvalidProtocolBufferException {
|
||||
List<ListenableFuture<InvokeServiceResponseEnvelope>> futureResponses = new ArrayList<>();
|
||||
for (String message : messages)
|
||||
{
|
||||
for (String message : messages) {
|
||||
SayRequest request = SayRequest
|
||||
.newBuilder()
|
||||
.setMessage(message)
|
||||
|
@ -101,6 +103,7 @@ public class HelloWorldClient {
|
|||
|
||||
/**
|
||||
* Client mode: gracefully shutdown client within 1 min, otherwise force it.
|
||||
*
|
||||
* @throws InterruptedException Propagated interrupted exception.
|
||||
*/
|
||||
private void shutdown() throws InterruptedException {
|
||||
|
|
|
@ -27,15 +27,15 @@ import static java.lang.System.out;
|
|||
|
||||
/**
|
||||
* OrderManager web app.
|
||||
*
|
||||
* <p>
|
||||
* Based on the helloworld Node.js example in https://github.com/dapr/samples/blob/master/1.hello-world/app.js
|
||||
*
|
||||
* <p>
|
||||
* To install jars into your local maven repo:
|
||||
* mvn clean install
|
||||
*
|
||||
* <p>
|
||||
* To run (after step above):
|
||||
* dapr run --app-id orderapp --app-port 3000 --port 3500 -- mvn exec:java -pl=examples -Dexec.mainClass=io.dapr.examples.state.http.OrderManager
|
||||
*
|
||||
* <p>
|
||||
* If this class changes, run this before running it again:
|
||||
* mvn compile
|
||||
*/
|
||||
|
|
|
@ -11,6 +11,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Converts time from the String format used by Dapr into a Duration.
|
||||
*
|
||||
* @param valueString A String representing time in the Dapr runtime's format (e.g. 4h15m50s60ms).
|
||||
* @return A Duration
|
||||
*/
|
||||
|
@ -47,6 +48,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Converts a Duration to the format used by the Dapr runtime.
|
||||
*
|
||||
* @param value Duration
|
||||
* @return The Duration formatted as a String in the format the Dapr runtime uses (e.g. 4h15m50s60ms)
|
||||
*/
|
||||
|
@ -56,8 +58,7 @@ public class ConverterUtils {
|
|||
// return empty string for anything negative, it'll only happen for reminder "periods", not dueTimes. A
|
||||
// negative "period" means fire once only.
|
||||
if (value == Duration.ZERO ||
|
||||
(value.compareTo(Duration.ZERO) == 1))
|
||||
{
|
||||
(value.compareTo(Duration.ZERO) == 1)) {
|
||||
long hours = getDaysPart(value) * 24 + getHoursPart(value);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -82,6 +83,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Helper to get the "days" part of the Duration. For example if the duration is 26 hours, this returns 1.
|
||||
*
|
||||
* @param d
|
||||
* @return
|
||||
*/
|
||||
|
@ -92,6 +94,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Helper to get the "hours" part of the Duration. For example if the duration is 26 hours, this is 1 day, 2 hours, so this returns 2.
|
||||
*
|
||||
* @param The duration to parse
|
||||
* @return the hour part of the duration
|
||||
*/
|
||||
|
@ -103,6 +106,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Helper to get the "minutes" part of the Duration.
|
||||
*
|
||||
* @param The duration to parse
|
||||
* @return the minutes part of the duration
|
||||
*/
|
||||
|
@ -114,6 +118,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Helper to get the "seconds" part of the Duration.
|
||||
*
|
||||
* @param The duration to parse
|
||||
* @return the seconds part of the duration
|
||||
*/
|
||||
|
@ -125,6 +130,7 @@ public class ConverterUtils {
|
|||
|
||||
/**
|
||||
* Helper to get the "millis" part of the Duration.
|
||||
*
|
||||
* @param The duration to parse
|
||||
* @return the milliseconds part of the duration
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
package io.dapr.actors;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.junit.Test;
|
|||
|
||||
/**
|
||||
* Integration test for the HTTP Async Client.
|
||||
*
|
||||
* <p>
|
||||
* Requires Dapr running.
|
||||
*/
|
||||
public class DaprHttpAsyncClientIT {
|
||||
|
|
|
@ -30,8 +30,7 @@ public class ActorMethodInfoMapTest {
|
|||
Assert.assertEquals(c.getClass(), String.class.getClass());
|
||||
Parameter[] p = m1.getParameters();
|
||||
Assert.assertEquals(p[0].getType().getClass(), String.class.getClass());
|
||||
}
|
||||
catch(Exception e) {
|
||||
} catch (Exception e) {
|
||||
Assert.fail("Exception not expected.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue