Skip to content

Commit

Permalink
https://github.com/fengjiachun/Jupiter/issues/73
Browse files Browse the repository at this point in the history
  • Loading branch information
jiachun.fjc committed Sep 17, 2018
1 parent 5ac272d commit dd11b63
Show file tree
Hide file tree
Showing 7 changed files with 1,645 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,7 @@ public static void checkClass(String className, String message) {
}
}

public static <T> void forClass(@SuppressWarnings("unused") Class<T> clazz) {}

private ClassUtil() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@
public interface ServiceNonAnnotationTest {

String sayHello(String arg1, Integer arg2, List<String> arg3);

String sayHello2(String[] args);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.jupiter.example;

import java.util.Arrays;
import java.util.List;

/**
Expand All @@ -37,4 +38,9 @@ public String sayHello(String arg1, Integer arg2, List<String> arg3) {
"arg3=" +
arg3;
}

@Override
public String sayHello2(String[] args) {
return Arrays.toString(args);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class JupiterClient {

public static void main(String[] args) {
SystemPropertyUtil.setProperty("jupiter.message.args.allow_null_array_arg", "true");
SystemPropertyUtil.setProperty("jupiter.serializer.protostuff.allow_null_array_element", "true");
final JClient client = new DefaultClient().withConnector(new JNettyTcpConnector());
// 连接RegistryServer
client.connectToRegistryServer("127.0.0.1:20001");
Expand Down Expand Up @@ -90,6 +91,15 @@ public void run() {
result = service.sayHello("test2", 4, new ArrayList<String>());
Preconditions.checkArgument("arg1=test2, arg2=4, arg3=[]".equals(result));
System.out.println(result);
result = service.sayHello2(new String[] { "a", null, "b" });
Preconditions.checkArgument("[a, null, b]".equals(result));
System.out.println(result);
result = service.sayHello2(new String[] { null, "a", "b" });
Preconditions.checkArgument("[null, a, b]".equals(result));
System.out.println(result);
result = service.sayHello2(new String[] { "a", "b", null });
Preconditions.checkArgument("[a, b, null]".equals(result));
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class JupiterServer {

public static void main(String[] args) {
SystemPropertyUtil.setProperty("jupiter.message.args.allow_null_array_arg", "true");
SystemPropertyUtil.setProperty("jupiter.serializer.protostuff.allow_null_array_element", "true");
final JServer server = new DefaultServer().withAcceptor(new JNettyTcpAcceptor(18090));
final MonitorServer monitor = new MonitorServer();
try {
Expand Down
Loading

0 comments on commit dd11b63

Please sign in to comment.