Splunk SDK for Java unit tests

A great place to look for examples of how to use the Splunk SDK for Java is in the unit tests. These are the same tests that we use to validate the core SDK library.

To run the SDK unit tests, open a command prompt at the root of the Splunk SDK for Java directory (/splunk-sdk-java) and enter:

ant test

To run the units from anywhere in the repository, enter:

ant test -find

It's also possible to run the units within Java IDEs such as Eclipse and IntelliJ). For example, to open the Splunk SDK for Java project in Eclipse:

  1. On the File menu, click Import.

  2. Expand General, click Existing Projects into Workspace, and then click Next.

  3. Next to the Select root directory option, type the path to the Splunk SDK for Java root directory (or click Browse to locate it), and then click Finish.