com.deepshiftlabs.nerrvana
Class NerrvanaPluginSettings

java.lang.Object
  extended by com.deepshiftlabs.nerrvana.NerrvanaPluginSettings

public class NerrvanaPluginSettings
extends Object

Wraps all Nerrvana related settings. It expects to get following XML:

 <nerrvana-plugin>
 <!-- You will be able to use this file to configure Nerrvana Jenkins plug-in in a near future -->
 <!-- Nerrvana API parameters -->
 <api-params>
       <!-- Address of the Nerrvana gateway -->
       <gateway>https://api.nerrvana.com</gateway>
       <!-- User-specific key which identifies user on Nerrvana side -->
       <!-- Available as an 'API public key' on Settings page (https://cloud.nerrvana.com/user/editAccount) in Nerrvana. -->
       <apikey>2bf7c81-a031f-1ad2-fd3a6-f59b9e0668e</apikey>
       <!-- This key is used by Nerrvana plug-in to create a checksum of an API call parameters to ensure their consistency. -->
       <!-- Available as an 'API private key' on Settings page in Nerrvana. -->
       <secretkey>wctfFwelygx3tXS4TasrsOS4oXV7YadcPppvEnx55WG7qPk6jrAHjJi1TRoLlhrarIlabte4H9zWROXVkLnXto2LlVC47EXx91Uu</secretkey>
   </api-params>

   <!-- Parameters related to Nerrvana-driven Selenium tests -->
   <!-- Test run name template, the revision number will be added to the end automatically -->
   <test-run-name>AnswersTests_PGSQL</test-run-name>

   <!-- Test run description, all test runs created by Jenkins will have this description -->
   <test-run-descr>Created by Nerrvana-Jenkins plugin</test-run-descr>

   <!-- Dynamic part of the test run description.
        If such file exists, plugin will append its content to the test run description.
        For example, you can pass SVN revision number, SVN commit time or any other information into plugin.
    -->
   <test-run-descr-file>info.txt</test-run-descr-file>

   <!-- Which executable file Nerrvana should use to start tests -->
   <executable-file>xbuild-pgsql.sh</executable-file>

   <!-- List of platforms to run tests against for this config -->
   <platforms>

       <!-- List of available platforms. Uncomment to use. -->

       <!--platform><code>centos_53_firefox_36</code><name>Firefox 3.6
 (CentOS)</name></platform-->
 <!--platform><code>winxp_sp3_chrome_1801025</code><name>Chrome 18.0.1025
 (WinXP)</name></platform-->
 <!--platform><code>winxp_sp3_firefox_36</code><name>Firefox 3.6
 (WinXP)</name></platform--> <!--platform><code>winxp_sp3_ie_8</code><name>IE
 8 (WinXP)</name></platform-->
 <!--platform><code>winxp_sp3_opera_1162</code><name>Opera 11.62
 (WinXP)</name></platform-->
 <!--platform><code>winxp_sp3_safari_53455</code><name>Safari 5.34.55
 (WinXP)</name></platform-->

 <platform><code>winxp_sp3_firefox_110</code><name>Firefox 11.0
 (WinXP)</name></platform> </platforms>

 <!-- How many Selenium nodes should be used for each platform -->
 <nodes-count>3</nodes-count>

 <!-- Parameters related to the transfer of the tests from Jenkins to Nerrvana
 --> <!-- Folder in the workspace of Jenkins job where Selenium tests will be
 located. It is presumed that build step of SCM plug-in, which always occurs
 BEFORE other steps, puts tests in there. -->
 <folder-with-tests>src</folder-with-tests> <!-- Nerrvana space previously
 created by you through Nerrvana web interface --> <space> <id>4028</id>
 <name>demo_space</name> <ftp-path>demo_space/_files</ftp-path> </space> <!--
 Address and credentials of the Nerrvana FTPS connection. Note that a system
 running Jenkins should have LFTP application installed. --> <ftp>
 <server>ftp.nerrvana.com</server> <!-- Your username -->
 <username>wise</username> <!-- Replace this value with your password!! -->
 <password>24VZLXSP</password> </ftp>

 <!-- Execution-specific parameters of the plugin --> <plugin-settings> <!--
 Maximum execution time (in seconds). Defines how long Nerrvana plug-in will
 wait for the tests to complete. Set to quite big value first and adjust after
 few runs to avoid indefinite loops, for example.-->
 <max-execution-time>3600</max-execution-time> <!-- How often Nerrvana plug-in
 will update tests execution status from Nerrvana (seconds) -->
 <poll-period>20</poll-period> </plugin-settings>

 <!-- Optional parameter. Default value is true -->
 <use-messages-to-set-build-status>true</use-messages-to-set-build-status>
 <!-- Message threshold level. If user message level exceeds this level -
 Nerrvana execution will be marked as FAILURE, and, consequently, full build
 will be marked as failure --> <message_threshold>warn</message_threshold>
 </nerrvana-plugin> 
 

Version:
1.00
Author:
Deep Shift Labs, Victor Orlov

Field Summary
 String apikey
          Key, which identifies Nerrvana user
 String executable_file
          Name of the file Nerrvana should start to run Selenium tests
 String executionResultsFilename
          Name of the file in the build folder where to the plugin should store test run execution results.
 String folder_with_tests
          Local folder in the workspace of the Jenkins job, this plugin belongs to.
 String ftpspass
          Password of the FTPS user FTPS credentials are the same as the credentials for the website
 String ftpsurl
          FTPS URL - address of the Nerrvana FTPS server
 String ftpsuser
          Name of the FTPS user FTPS credentials are the same as the credentials for the website
 String httpurl
          Nerrvana address.
 int maxtime
          Maximum execution time for the plugin in seconds.
 UserMessageLevel messageThreshold
           
 int nodes_count
          Count of nodes (Selenium RC instances) Nerrvana should start for the given tests set.
 List<Platform> platforms
          List of platforms (where platform is combination of the OS and browser of the certain version)
 int poll
          Poll period - amount of time between calls from plugin to Nerrvana.
 String secretkey
          Secret key, the plugin uses to encrypt request (and Nerrvana API uses to decrypt it)
 boolean skipUpload
          Flag which commands to plugin to skip upload step (Which means that files were uploaded to Nerrvana cloud in some alternate way)
 String space_id
          Nerrvana space ID.
 String space_name
          Nerrvana space name.
 String space_path
          Nerrvana space path - folder in Nerrvana FTPS server where plugin should put tests.
 String test_run_descr
          Test run description - static part of
 String test_run_descr_file
          Name of the file containing dynamic part of the test run description.
 String test_run_name
          Name of the test run.
 boolean testExecutionResults
          This flag determines should this plugin instance evaluate results of the Nerrvana execution or not.
 boolean validation
          Should Nerrvana validate code or not So far Nerrvana supports validation of the PHP (by lint) and Java (by compiling the code)
 
Constructor Summary
NerrvanaPluginSettings()
           
 
Method Summary
 boolean checkSettings()
          Validates plugin settings
 long getMaxtimeMillis()
          Checks maxtime range, adjusts it if needed and converts to milliseconds
 long getPollMillis()
          Checks poll range, adjusts it if needed and converts to milliseconds
static NerrvanaPluginSettings parse(Document doc)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpurl

public String httpurl
Nerrvana address.


apikey

public String apikey
Key, which identifies Nerrvana user


secretkey

public String secretkey
Secret key, the plugin uses to encrypt request (and Nerrvana API uses to decrypt it)


nodes_count

public int nodes_count
Count of nodes (Selenium RC instances) Nerrvana should start for the given tests set. Makes sense for the tests which support parallelizing (TestNG)


test_run_name

public String test_run_name
Name of the test run. Nerrvana creates folder in the user space with such name


test_run_descr

public String test_run_descr
Test run description - static part of


test_run_descr_file

public String test_run_descr_file
Name of the file containing dynamic part of the test run description. It is presumed that file and its content has been created by some external means prior the plugin start. Plugin appends content of this file to the test_run_descr


executable_file

public String executable_file
Name of the file Nerrvana should start to run Selenium tests


validation

public boolean validation
Should Nerrvana validate code or not So far Nerrvana supports validation of the PHP (by lint) and Java (by compiling the code)


platforms

public List<Platform> platforms
List of platforms (where platform is combination of the OS and browser of the certain version)


folder_with_tests

public String folder_with_tests
Local folder in the workspace of the Jenkins job, this plugin belongs to. Plugin presumes that this folder contains code of the tests to be transferred to Nerrvana


space_id

public String space_id
Nerrvana space ID. Space should be created manually by Nerrvana user through web interface.


space_name

public String space_name
Nerrvana space name. Space should be created manually by Nerrvana user through web interface.


space_path

public String space_path
Nerrvana space path - folder in Nerrvana FTPS server where plugin should put tests. Space should be created manually by Nerrvana user through web interface.


ftpsurl

public String ftpsurl
FTPS URL - address of the Nerrvana FTPS server


ftpsuser

public String ftpsuser
Name of the FTPS user FTPS credentials are the same as the credentials for the website


ftpspass

public String ftpspass
Password of the FTPS user FTPS credentials are the same as the credentials for the website


maxtime

public int maxtime
Maximum execution time for the plugin in seconds. Time count starts after creation and starting of the test run


poll

public int poll
Poll period - amount of time between calls from plugin to Nerrvana. Polling process starts after creation and starting of the test run


executionResultsFilename

public final String executionResultsFilename
Name of the file in the build folder where to the plugin should store test run execution results. Also see testExecutionResults

See Also:
Constant Field Values

testExecutionResults

public boolean testExecutionResults
This flag determines should this plugin instance evaluate results of the Nerrvana execution or not. If this flag=true and there were errors during this or any previous Nerrvana plugin execution - NerrvanaPlugin.perform(hudson.model.AbstractBuild, hudson.Launcher, hudson.model.BuildListener) will return false. Otherwise (this flag=false or there were no errors) it returns true.


messageThreshold

public UserMessageLevel messageThreshold

skipUpload

public boolean skipUpload
Flag which commands to plugin to skip upload step (Which means that files were uploaded to Nerrvana cloud in some alternate way)

Constructor Detail

NerrvanaPluginSettings

public NerrvanaPluginSettings()
Method Detail

parse

public static NerrvanaPluginSettings parse(Document doc)
                                    throws Exception
Throws:
Exception

checkSettings

public boolean checkSettings()
Validates plugin settings

Returns:
true if settings are correct

getMaxtimeMillis

public long getMaxtimeMillis()
Checks maxtime range, adjusts it if needed and converts to milliseconds

Returns:
adjusted maxtime in milliseconds

getPollMillis

public long getPollMillis()
Checks poll range, adjusts it if needed and converts to milliseconds

Returns:
adjusted poll in milliseconds


Copyright © 2004-2012 Deep Shift Labs. All Rights Reserved.