diff --git a/net/src/test/java/com/zfoo/net/core/csharp/ServerPacketController.java b/net/src/test/java/com/zfoo/net/core/csharp/ServerPacketController.java deleted file mode 100644 index 9688fc9df..000000000 --- a/net/src/test/java/com/zfoo/net/core/csharp/ServerPacketController.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2020 The zfoo Authors - * - * Licensed 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 com.zfoo.net.core.csharp; - -import com.zfoo.net.NetContext; -import com.zfoo.net.packet.csharp.CM_CSharpRequest; -import com.zfoo.net.anno.PacketReceiver; -import com.zfoo.net.session.Session; -import com.zfoo.protocol.util.JsonUtils; -import org.springframework.stereotype.Component; - -/** - * @author godotg - */ -@Component -public class ServerPacketController { - - @PacketReceiver - public void atCM_CSharpRequest(Session session, CM_CSharpRequest cm) { - System.out.println("receive packet from client:"); - System.out.println(JsonUtils.object2String(cm)); - - NetContext.getRouter().send(session, cm); - } - -} diff --git a/net/src/test/java/com/zfoo/net/core/csharp/ServerTest.java b/net/src/test/java/com/zfoo/net/core/csharp/ServerTest.java deleted file mode 100644 index d84bd5e23..000000000 --- a/net/src/test/java/com/zfoo/net/core/csharp/ServerTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2020 The zfoo Authors - * - * Licensed 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 com.zfoo.net.core.csharp; - -import com.zfoo.net.core.HostAndPort; -import com.zfoo.net.core.tcp.TcpServer; -import com.zfoo.net.session.SessionUtils; -import com.zfoo.protocol.util.ThreadUtils; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.context.support.ClassPathXmlApplicationContext; - -/** - * @author godotg - */ -@Ignore -public class ServerTest { - - private static final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("config.xml"); - - @Test - public void startServer() { - SessionUtils.printSessionInfo(); -// startClient1(); - - var server = new TcpServer(HostAndPort.valueOf("127.0.0.1:9000")); - server.start(); - ThreadUtils.sleep(Long.MAX_VALUE); - } - - -} diff --git a/net/src/test/java/com/zfoo/net/core/tcp/server/TcpServerTest.java b/net/src/test/java/com/zfoo/net/core/tcp/server/TcpServerTest.java index ec737529d..17dfc1f1b 100644 --- a/net/src/test/java/com/zfoo/net/core/tcp/server/TcpServerTest.java +++ b/net/src/test/java/com/zfoo/net/core/tcp/server/TcpServerTest.java @@ -35,7 +35,7 @@ public class TcpServerTest { public void startServer() { var context = new ClassPathXmlApplicationContext("config.xml"); - var server = new TcpServer(HostAndPort.valueOf("127.0.0.1:9000")); + var server = new TcpServer(HostAndPort.valueOf("0.0.0.0:9000")); server.start(); ThreadUtils.sleep(Long.MAX_VALUE); } diff --git a/net/src/test/java/com/zfoo/net/packet/CM_Int.java b/net/src/test/java/com/zfoo/net/packet/CM_Int.java index 27e41810a..f24614f84 100644 --- a/net/src/test/java/com/zfoo/net/packet/CM_Int.java +++ b/net/src/test/java/com/zfoo/net/packet/CM_Int.java @@ -33,7 +33,6 @@ public class CM_Int { private long d; - private char e; private String f; @@ -57,14 +56,6 @@ public byte getA() { return a; } - public char getE() { - return e; - } - - public void setE(char e) { - this.e = e; - } - public void setA(byte a) { this.a = a; } @@ -104,12 +95,11 @@ public boolean equals(Object o) { b == cm_int.b && c == cm_int.c && d == cm_int.d && - e == cm_int.e && f.equals(cm_int.f); } @Override public int hashCode() { - return Objects.hash(flag, a, b, c, d, e, f); + return Objects.hash(flag, a, b, c, d, f); } } diff --git a/net/src/test/java/com/zfoo/net/packet/SM_Int.java b/net/src/test/java/com/zfoo/net/packet/SM_Int.java index 6361b667c..f4bcd1d1f 100644 --- a/net/src/test/java/com/zfoo/net/packet/SM_Int.java +++ b/net/src/test/java/com/zfoo/net/packet/SM_Int.java @@ -33,8 +33,6 @@ public class SM_Int { private Long d; - private char e; - private String f; public Boolean getFlag() { @@ -77,14 +75,6 @@ public void setD(Long d) { this.d = d; } - public char getE() { - return e; - } - - public void setE(char e) { - this.e = e; - } - public String getF() { return f; } @@ -98,8 +88,7 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; SM_Int sm_int = (SM_Int) o; - return e == sm_int.e && - flag.equals(sm_int.flag) && + return flag.equals(sm_int.flag) && a.equals(sm_int.a) && b.equals(sm_int.b) && c.equals(sm_int.c) && @@ -109,7 +98,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(flag, a, b, c, d, e, f); + return Objects.hash(flag, a, b, c, d, f); } } diff --git a/net/src/test/java/com/zfoo/net/packet/csharp/CM_CSharpRequest.java b/net/src/test/java/com/zfoo/net/packet/csharp/CM_CSharpRequest.java deleted file mode 100644 index 5747ca9cb..000000000 --- a/net/src/test/java/com/zfoo/net/packet/csharp/CM_CSharpRequest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2020 The zfoo Authors - * - * Licensed 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 com.zfoo.net.packet.csharp; - -import com.zfoo.protocol.anno.Protocol; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * @author godotg - */ -@Protocol(id = 1165) -public class CM_CSharpRequest { - - // 注释1 - public byte a; - /** - * 注释2 - * 附加注释 - */ - public Byte aa; - public byte[] aaa; - public Byte[] aaaa; - - public short b; - public Short bb; - public short[] bbb; - public Short[] bbbb; - - public int c; - public Integer cc; - public int[] ccc; - public Integer[] cccc; - - public long d; - public Long dd; - public long[] ddd; - public Long[] dddd; - - public float e; - public Float ee; - public float[] eee; - public Float[] eeee; - - public double f; - public Double ff; - public double[] fff; - public Double[] ffff; - - public boolean g; - public Boolean gg; - public boolean[] ggg; - public Boolean[] gggg; - - // 注释行 - public char h; - public Character hh; - public char[] hhh; - public Character[] hhhh; - - public String jj; - public String[] jjj; - - public CSharpObjectA objectA; - public CSharpObjectA[] objectArray; - - public List l; - public List>> ll; - public List> lll; - public List llll; - public List> lllll; - - public Map m; - public Map mm; - public Map> mmm; - public Map>, List>>> mmmm; - - public Set s; - public Set>> ss; - public Set> sss; - public Set ssss; - /** - * 注释z - * 附加注释 - */ - public Set> sssss; - -} diff --git a/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectA.java b/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectA.java deleted file mode 100644 index ba100f423..000000000 --- a/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectA.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2020 The zfoo Authors - * - * Licensed 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 com.zfoo.net.packet.csharp; - -import com.zfoo.protocol.anno.Protocol; - -/** - * @author godotg - */ -@Protocol(id = 1166) -public class CSharpObjectA { - - public int value; - public CSharpObjectB objectB; - -} diff --git a/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectB.java b/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectB.java deleted file mode 100644 index 1dbbb6059..000000000 --- a/net/src/test/java/com/zfoo/net/packet/csharp/CSharpObjectB.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2020 The zfoo Authors - * - * Licensed 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 com.zfoo.net.packet.csharp; - -import com.zfoo.protocol.anno.Protocol; - -/** - * @author godotg - */ -@Protocol(id = 1167) -public class CSharpObjectB { - - public boolean flag; - -} diff --git a/net/src/test/java/com/zfoo/net/packet/websocket/WebSocketPacketRequest.java b/net/src/test/java/com/zfoo/net/packet/websocket/WebSocketPacketRequest.java index 38672357d..e535f5b23 100644 --- a/net/src/test/java/com/zfoo/net/packet/websocket/WebSocketPacketRequest.java +++ b/net/src/test/java/com/zfoo/net/packet/websocket/WebSocketPacketRequest.java @@ -53,9 +53,6 @@ public class WebSocketPacketRequest { private double[] fff; private Double[] ffff; - private char g; - private char[] gg; - private List ggg; private String jj; private String[] jjj; @@ -256,30 +253,6 @@ public void setFfff(Double[] ffff) { this.ffff = ffff; } - public char getG() { - return g; - } - - public void setG(char g) { - this.g = g; - } - - public char[] getGg() { - return gg; - } - - public void setGg(char[] gg) { - this.gg = gg; - } - - public List getGgg() { - return ggg; - } - - public void setGgg(List ggg) { - this.ggg = ggg; - } - public String getJj() { return jj; } diff --git a/net/src/test/resources/protocol.xml b/net/src/test/resources/protocol.xml index 54b038e78..ec2adfb8f 100644 --- a/net/src/test/resources/protocol.xml +++ b/net/src/test/resources/protocol.xml @@ -56,10 +56,6 @@ - - - -