Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
闫逍旭
committed
Jan 7, 2016
1 parent
4304ae5
commit 5253f3a
Showing
12 changed files
with
168 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
mpush-client/src/test/java/com/shinemo/mpush/client/PushClientTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
package com.shinemo.mpush.client; | |||
|
|||
import com.shinemo.mpush.api.PushSender; | |||
import org.junit.Test; | |||
|
|||
import java.util.Arrays; | |||
import java.util.concurrent.locks.LockSupport; | |||
|
|||
import static org.junit.Assert.*; | |||
|
|||
/** | |||
* Created by ohun on 2016/1/7. | |||
*/ | |||
public class PushClientTest { | |||
|
|||
@Test | |||
public void testSend() throws Exception { | |||
|
|||
} | |||
|
|||
public static void main(String[] args) throws InterruptedException { | |||
PushClient client = new PushClient(); | |||
client.init(); | |||
Thread.sleep(5000); | |||
client.send("this a first push", Arrays.asList("user-0", "user-1", "user-2", "user-3", "user-4"), | |||
new PushSender.Callback() { | |||
@Override | |||
public void onSuccess(String userId) { | |||
System.err.println("push onSuccess userId=" + userId); | |||
} | |||
|
|||
@Override | |||
public void onFailure(String userId) { | |||
System.err.println("push onFailure userId=" + userId); | |||
} | |||
|
|||
@Override | |||
public void onOffline(String userId) { | |||
System.err.println("push onOffline userId=" + userId); | |||
} | |||
|
|||
@Override | |||
public void onTimeout(String userId) { | |||
System.err.println("push onTimeout userId=" + userId); | |||
} | |||
} | |||
); | |||
LockSupport.park(); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,8 @@ | |||
ZK_SERVER=10.1.20.74:2181 | |||
MAX_PACKET_SIZE=10240 | |||
COMPRESS_LIMIT=10240 | |||
MIN_HEARTBEAT=10000 | |||
MAX_HEARTBEAT=1800000 | |||
MAX_HB_TIMEOUT_TIMES=2 | |||
PRIVATE_KEY=MIIBNgIBADANBgkqhkiG9w0BAQEFAASCASAwggEcAgEAAoGBAKCE8JYKhsbydMPbiO7BJVq1pbuJWJHFxOR7L8Hv3ZVkSG4eNC8DdwAmDHYu/wadfw0ihKFm2gKDcLHp5yz5UQ8PZ8FyDYvgkrvGV0ak4nc40QDJWws621dm01e/INlGKOIStAAsxOityCLv0zm5Vf3+My/YaBvZcB5mGUsPbx8fAgEAAoGAAy0+WanRqwRHXUzt89OsupPXuNNqBlCEqgTqGAt4Nimq6Ur9u2R1KXKXUotxjp71Ubw6JbuUWvJg+5Rmd9RjT0HOUEQF3rvzEepKtaraPhV5ejEIrB+nJWNfGye4yzLdfEXJBGUQzrG+wNe13izfRNXI4dN/6Q5npzqaqv0E1CkCAQACAQACAQACAQACAQA= | |||
PUBLIC_KEY=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCghPCWCobG8nTD24juwSVataW7iViRxcTkey/B792VZEhuHjQvA3cAJgx2Lv8GnX8NIoShZtoCg3Cx6ecs+VEPD2fBcg2L4JK7xldGpOJ3ONEAyVsLOttXZtNXvyDZRijiErQALMTorcgi79M5uVX9/jMv2Ggb2XAeZhlLD28fHwIDAQAB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<configuration debug="false"> | |||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |||
<target>System.out</target> | |||
<encoding>UTF-8</encoding> | |||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | |||
<level>DEBUG</level> | |||
</filter> | |||
<layout class="ch.qos.logback.classic.PatternLayout"> | |||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - [%thread] %-5level - %logger{35} - %msg%n</pattern> | |||
</layout> | |||
</appender> | |||
|
|||
<appender name="STDERR" class="ch.qos.logback.core.ConsoleAppender"> | |||
<target>System.err</target> | |||
<encoding>UTF-8</encoding> | |||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | |||
<level>WARN</level> | |||
</filter> | |||
<layout class="ch.qos.logback.classic.PatternLayout"> | |||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} - [%thread] %-5level - %logger{35} - %msg%n</pattern> | |||
</layout> | |||
</appender> | |||
|
|||
|
|||
<root> | |||
<level value="INFO" /> | |||
<appender-ref ref="STDOUT" /> | |||
</root> | |||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.