|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavapns.test.NotificationTest
public class NotificationTest
A command-line test facility for the Push Notification Service.
Example: java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4
By default, this test uses the sandbox service. To switch, add "production" as a fourth parameter:
Example: java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 production
Also by default, this test pushes a simple alert. To send a complex payload, add "complex" as a fifth parameter:
Example: java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 production complex
To send a simple payload to a large number of fake devices, add "threads" as a fifth parameter, the number of fake devices to construct, and the number of threads to use:
Example: java -cp "[required libraries]" javapns.test.NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4 sandbox threads 1000 5
Field Summary | |
---|---|
static NotificationProgressListener |
DEBUGGING_PROGRESS_LISTENER
A NotificationProgressListener you can use to debug NotificationThreads. |
Method Summary | |
---|---|
static void |
configureBasicLogging()
Enable Log4J with a basic default configuration (console only). |
static void |
main(String[] args)
Execute this class from the command line to run tests. |
static void |
printPushedNotifications(List<PushedNotification> notifications)
Print to the console a comprehensive report of all pushed notifications and results. |
static void |
printPushedNotifications(String description,
List<PushedNotification> notifications)
Print to the console a list of pushed notifications. |
static void |
verifyKeystore(Object keystoreReference,
String password,
boolean production)
Validate a keystore reference and print the results to the console. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final NotificationProgressListener DEBUGGING_PROGRESS_LISTENER
Method Detail |
---|
public static void main(String[] args)
args
- public static void printPushedNotifications(List<PushedNotification> notifications)
notifications
- a raw list of pushed notificationspublic static void printPushedNotifications(String description, List<PushedNotification> notifications)
description
- a title for this list of notificationsnotifications
- a list of pushed notifications to printpublic static void configureBasicLogging()
public static void verifyKeystore(Object keystoreReference, String password, boolean production)
keystoreReference
- a reference to or an actual keystorepassword
- password for the keystoreproduction
- service to use
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |