From a5c80f42da65043452dcc1248a80f3ea2cdf50c5 Mon Sep 17 00:00:00 2001 From: abythell Date: Thu, 6 Nov 2014 21:55:33 -0800 Subject: [PATCH] update test instructions --- README.md | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 29465a1..f538ad4 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,25 @@ ThingSpeak Java Client === -A Java client for the [ThingSpeak](http://thingspeak.com) Internet of -Things. Implements all aspects of the ThingSpeak API and can be used to -update channel data, retrieve and examine feeds, and query public channels. -It supports the hosted ThingSpeak server at api.thingspeak.com as well -as self-hosted open-source servers ([GitHub Source](https://github.com/iobridge/thingspeak)). +A Java client for the [ThingSpeak](http://thingspeak.com) Internet of Things. +Implements all aspects of the ThingSpeak API and can be used to update channel +data, retrieve and examine feeds, and query public channels. It supports the +hosted ThingSpeak server at api.thingspeak.com as well as self-hosted +open-source servers ([GitHub Source](https://github.com/iobridge/thingspeak)). -Also included: An appender for log4j - post data to ThingSpeak channels using Logger -framework. +Also included: An appender for log4j - post data to ThingSpeak channels using +Logger framework. How To Install --- -Get the source by [downloading a zip file](https://github.com/angryelectron/thingspeak-java/archive/master.zip) -or by cloning the git repository https://github.com/angryelectron/thingspeak-java.git . -Building the source requires the Java 7 SDK and Apache Ant, or use the [Netbeans IDE](http://netbeans.org). +Get the source by [downloading a zip +file](https://github.com/angryelectron/thingspeak-java/archive/master.zip) or +by cloning the git repository +https://github.com/angryelectron/thingspeak-java.git . Building the source +requires the Java 7 SDK and Apache Ant, or use the [Netbeans +IDE](http://netbeans.org). -Here is an example of how to install the client from the command line in Ubuntu/Debian/Raspbian with a minimal build environment: +Here is an example of how to install the client from the command line in +Ubuntu/Debian/Raspbian with a minimal build environment: ``` sudo apt-get update @@ -25,7 +29,9 @@ cd thingspeak-java ant ``` -After building, the jars, docs, and dependencies can be found in thingspeak/dist. +To run optional tests, run 'ant test'. Due to the rate limit of the public +Thingspeak server (15sec), tests can take a long time to run. After building, +the jars, docs, and dependencies can be found in thingspeak/dist. How To Use --- @@ -34,10 +40,14 @@ Add thingspeak-x.y.jar to your project and the following dependencies: * [Unirest](http://unirest.io) * [GSON](http://code.google.com/p/google-gson/) -Dependencies can be found in thingspeak/dist/lib after building the source. Refer to the included javadocs for more details. The [ThingSpeak API Documentation](http://community.thingspeak.com/documentation/api/#thingspeak_api) +Dependencies can be found in thingspeak/dist/lib after building the source. +Refer to the included javadocs for more details. The [ThingSpeak API +Documentation](http://community.thingspeak.com/documentation/api/#thingspeak_api) is also a good source of additional information about using the API. -If you encounter any issues with the ThingSpeak Java Client, please use the [GitHub issue tracker](https://github.com/angryelectron/thingspeak-java/issues). +If you encounter any issues with the ThingSpeak Java Client, please use the +[GitHub issue +tracker](https://github.com/angryelectron/thingspeak-java/issues). Examples --- @@ -60,13 +70,15 @@ Entry entry = channel.getLastChannelEntry(); System.out.println(entry.getField(1); ``` -Please refer to thingspeak/dist/javadoc for more information about customzing channel feeds, searching public channels, using open-source servers, and all the other operations supported by the ThingSpeak API. +Please refer to thingspeak/dist/javadoc for more information about customzing +channel feeds, searching public channels, using open-source servers, and all +the other operations supported by the ThingSpeak API. log4j Appender --- -Use log4j to update ThingSpeak channels. Date, Level, and Message are 'fields', -written as an 'entry'. Setup a new ThingSpeak channel with these three fields, then -pass the channel number and API write-key to the appender. +Use log4j to update ThingSpeak channels. Date, Level, and Message are +'fields', written as an 'entry'. Setup a new ThingSpeak channel with these +three fields, then pass the channel number and API write-key to the appender. Here's how to configure the appender and send a test message (just add your own channelNumber and apiWriteKey):