Contact us Become a partner Knowledge site
XPLG home
Home / Solution / Testing / Run analysis using XpoLog API - JUnit, JMeter, Ant and more
Log Management | Log Analysis | Applications | Operations | Compliance | Testing
How to run analysis using XpoLog API? JUnit, JMeter, Ant and more
XpoLog Center provides an HTTP-based API for creating and generating environment analyses. This API can be easily used to control XpoLog Center from external tools, such as JUnit, JMeter, Ant. The API can also be used to automate the process of generating environment analysis reports.

The example below demonstrates the usage of XpoLog's API as part of JUnit and Ant execution:
(1) Download and install XpoLog
Download XpoLog from the download section of this site and follow the installation wizard to install.
Open a browser to the machine you installed XpoLog on, connect on port 30303
(for example: http://localhost:30303/).   [back to top]
(2) Define an Ant target
<target name="xpologAPI">
[back to top]
(3) Define Test Environment properties
  <!-- The following properties can also be extracted from a properties file dynamically -->
  <property name="type" value="functional">
  <property name="version" value="3.7">
  <property name="build" value="1610">
[back to top]
(4) Call the API to mark the begining of the test
  <!-- Following is a call to the prepare API, notice the sessionKey parameter the will be used later in the call to the generate API, note that URL parameters are separated by & -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/prepareReportAPI.jsp?sessionKey=antTest&reportType=Testing&reportName=JunitXpologCase&location=dir=</write>
    <write/>
    <read ></root></read>
  </telnet>
[back to top]
(5) Execute JUnit tests
  <!-- Following is an execution of a JUnit test -->
  <junit printsummary="yes" haltonfailure="no" dir="">
    <classpath>
      <pathelement location="classes"/>
      <pathelement location="test/JUnit/classes"/>
      <fileset dir="lib">
        <include name="*.jar"/>
      </fileset>
    </classpath>
    <formatter type="plain"/>
    <batchtest fork="yes" todir="test/JUnit/antoutput/reports">
      <fileset dir="test/JUnit/src/">
        <include name="xpolog/junit/*/**/*TestSuite.java"/>
      </fileset>
    </batchtest>
  </junit>
[back to top]
(6) Call the API to generate the application logs analysis
  <!-- Following is a call to the generate API, this call will perform an analysis on the application logs -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/generateReportAPI.jsp?sessionKey=antTest&reportName=JunitXpologCase</write>
    <write/>
    <read ></root></read>
  </telnet>
[back to top]
(7) Call the API to generate the JUnit logs analysis
  <!-- Following is a call to the generate API, this call will perform an analysis on the JUnit result logs. Note that no sessionKey parameter is passed to this call since the analysis is performed on the entire data -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/generateReportAPI.jsp?reportType=Testing&reportName=TestingJunitCase&location=dir=C:/workspace/Xpolog/test/JUnit/antoutput& properties=type=Junit;version=;build=</write>
    <write/>
    <read ></root></read>
  </telnet>
[back to top]
(8) Close the Ant target
</target>
[back to top]
(9) The complete Ant target should look like the following:
<target name="xpologAPI">
  <!-- The following properties can also be extracted from a properties file dynamically -->
  <property name="type" value="functional">
  <property name="version" value="3.7">
  <property name="build" value="1610">

  <!-- Following is a call to the prepare API, notice the sessionKey parameter the will be used later in the call to the generate API, note that URL parameters are separated by & -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/prepareReportAPI.jsp?sessionKey=antTest&reportType=Testing&reportName=JunitXpologCase&location=dir=</write>
    <write/>
    <read ></root></read>
  </telnet>

  <!-- Following is an execution of a JUnit test -->
  <junit printsummary="yes" haltonfailure="no" dir="">
    <classpath>
      <pathelement location="classes"/>
      <pathelement location="test/JUnit/classes"/>
      <fileset dir="lib">
        <include name="*.jar"/>
      </fileset>
    </classpath>
    <formatter type="plain"/>
    <batchtest fork="yes" todir="test/JUnit/antoutput/reports">
      <fileset dir="test/JUnit/src/">
        <include name="xpolog/junit/*/**/*TestSuite.java"/>
      </fileset>
    </batchtest>
  </junit>

  <!-- Following is a call to the generate API, this call will perform an analysis on the application logs -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/generateReportAPI.jsp?sessionKey=antTest&reportName=JunitXpologCase</write>
    <write/>
    <read ></root></read>
  </telnet>

  <!-- Following is a call to the generate API, this call will perform an analysis on the JUnit result logs. Note that no sessionKey parameter is passed to this call since the analysis is performed on the entire data -->
  <telnet port="30303" server="localhost">
    <read/>
    <write>GET /logeye/reports/api/generateReportAPI.jsp?reportType=Testing&reportName=TestingJunitCase&location=dir=C:/workspace/Xpolog/test/JUnit/antoutput& properties=type=Junit;version=;build=</write>
    <write/>
    <read ></root></read>
  </telnet>
</target>

The complete API reference can be downloaded from here
[back to top]
 
download free trial for testing
schedule an online demo
download solution overview
Need more help?
Log Analysis Testing Solution
 
How to create Snapshots?
 
Installation and specification
 
Support and knowledge center
 
Who uses XpoLog Center?
log managementLog Management Compliance
"It saves us several hours of work every day investigating problems" Per-Anders, Cinnober
 
XpoLog for operations teamsOperations
"XpoLog provides the best log monitoring solution over the web" Eyal Elhadad, Traiana
 
XpoLog for applications teamsApplications
"Our teams are able to do investigations in 10% of the time it used to take"
Ian Bloomfield, TechOnline
Take it for a spin
Feel XpoLog on your logs within minutes!
Download Free Trial >
Take a quick tour >
 
 
Home / Solution / Testing / Run analysis using XpoLog API - JUnit, JMeter, Ant and more
 
XpoLog
Center
Suite
 
Enterprise
Manager
XpoSearch
Dashboard
TxExpo
 
Professional
Manager
XpoSearch
Dashboard
 
Standard
Manager
XpoSearch
 
 Download Free Trial >   Compare Suite Packages >
Product
Overview
XpoLog Manager
XpoSearch
Dashboard
TxExpo
Integrations
 
Solution
Log Management
Log Analysis
Applications
Operations
Compliance
Testing
 
Downloads
Download XpoLog
 
Customers
Customers
Case Studies
Testimonials
 
Partners
Partners
 
Company
Overview
Contact us
Investors
 
News
News & Events
 
2008 Copyright by XpoLog Ltd. All rights reserved