changeset 68:24d02ec4784c

editing javadoc for testsuites
author Jana Fabrikova <jfabriko@redhat.com>
date Wed, 12 Jun 2013 16:08:32 +0200
parents cb5c8c4bd462
children 729e087395a1
files ChangeLog src/org/thermostat/qa/testsuites/CliClientDBModificationsSmokeTest.java src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java src/org/thermostat/qa/testsuites/GuiClientSmokeTest.java src/org/thermostat/qa/testsuites/SmokeTests.java src/org/thermostat/qa/testsuites/StorageSmokeTest.java
diffstat 6 files changed, 175 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jun 12 13:35:26 2013 +0200
+++ b/ChangeLog	Wed Jun 12 16:08:32 2013 +0200
@@ -1,3 +1,13 @@
+2013-06-12  Jana Fabrikova  <jfabriko@redhat.com>
+
+	* src/org/thermostat/qa/testsuites/SmokeTests.java:
+	* src/org/thermostat/qa/testsuites/StorageSmokeTest.java:
+	* src/org/thermostat/qa/testsuites/GuiClientSmokeTest.java:
+	* src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java:
+	* src/org/thermostat/qa/testsuites/CliClientDBModificationsSmokeTest.java:
+	added/modified javadoc comments
+
+
 2013-06-12  Jana Fabrikova  <jfabriko@redhat.com>
 
 	* src/org/thermostat/qa/testsuites/CliClientDBModificationsSmokeTest.java:
--- a/src/org/thermostat/qa/testsuites/CliClientDBModificationsSmokeTest.java	Wed Jun 12 13:35:26 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/CliClientDBModificationsSmokeTest.java	Wed Jun 12 16:08:32 2013 +0200
@@ -50,7 +50,12 @@
 import org.thermostat.qa.framework.ThermostatTest;
 
 
-
+/**
+ * Class CliClientDBModificationsSmokeTest
+ * tests if the changes made in the database are reflected in Thermostat 
+ * shell output. 
+ *
+ */
 @TestType(TestTypes.GUI_TEST)
 public class CliClientDBModificationsSmokeTest extends ThermostatTest {
     
@@ -64,6 +69,30 @@
         // TODO Auto-generated method stub
     }
     
+    /**
+     * Method testAddVMAndSeeItInShellTest
+     * tests if a virtual machine added to the thermostat database is visible
+     * in the shell if the command list-vms is issued.
+     * The method adds a vm and a host into the vm-info and host-info
+     * collections of the thermostat database respectively and deletes
+     * the new items after the tests.
+     *  
+     * This method uses scripts and files 
+     * <ul>
+     * <li><a href="../../../../../../scripts/find_mongo_port.sh">find_mongo_port.sh</a>,
+     * <li><a href="../../../../../../scripts/add_vm.sh">add_vm.sh</a>,
+     * <li><a href="../../../../../../scripts/add_vm_db_commands.txt">add_vm_db_commands.txt</a>, 
+     * <li><a href="../../../../../../scripts/list-vms_therm_shell.txt">list-vms_therm_shell.txt</a>,
+     * <li><a href="../../../../../../scripts/delete_added_vm.sh">delete_added_vm.sh</a>,
+     * <li><a href="../../../../../../scripts/remove_vm_db_commands.txt">remove_vm_db_commands.txt</a>
+     * <ul>
+     * and rewrites one text file 
+     * <a href="../../../../../../scripts/mongoPortNumber.txt">mongoPortNumber.txt</a>.
+     * and one script file
+     * <a href="../../../../../../scripts/run_thermostat_shell_with_commands.sh">run_thermostat_shell_with_commands.sh</a>.
+     * @throws IOException
+     * @throws AWTException
+     */
     public void testAddVMAndSeeItInShellTest() throws IOException, AWTException {
         // start storage
         startStorage();
--- a/src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java	Wed Jun 12 13:35:26 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/GuiClientDBModificationsSmokeTest.java	Wed Jun 12 16:08:32 2013 +0200
@@ -50,7 +50,10 @@
 import org.thermostat.qa.framework.ThermostatGuiTest;
 
 
-
+/**
+ * Class GuiClientDBModificationsSmokeTest
+ * tests if the changes made in the database are reflected in Thermostat gui.
+ */
 @TestType(TestTypes.GUI_TEST)
 public class GuiClientDBModificationsSmokeTest extends ThermostatGuiTest {
     
@@ -64,6 +67,35 @@
         // TODO Auto-generated method stub
     }
     
+    /**
+     * Method testAddAgentAndSeeItInGuiTest
+     * tests if an agent added to the thermostat database is visible in 
+     * the gui in the All Agents Dialog.
+     * 
+     * Following patterns are checked for its presence:<br /><br />
+     * Text antialiasing enabled:<br />
+     * <img src="patterns/AA/AllAgentsDialog/added_agent.png"><br /><br />
+     * <img src="patterns/AA/AllAgentsDialog/added_agent2.png"><br /><br />
+     * <img src="patterns/AA/AllAgentsDialog/close_button.png"><br /><br />
+     * <img src="patterns/AA/AllAgentsDialog/close_button2.png"><br /><br />
+     * Text antialiasing disabled:<br />
+     * <img src="patterns/noAA/AllAgentsDialog/added_agent.png"><br /><br />
+     * <img src="patterns/noAA/AllAgentsDialog/added_agent2.png"><br /><br />
+     * <img src="patterns/noAA/AllAgentsDialog/close_button.png"><br /><br />
+     * <img src="patterns/noAA/AllAgentsDialog/close_button2.png"><br /><br /> 
+     * This method uses scripts and files 
+     * <ul>
+     * <li><a href="../../../../../../scripts/find_mongo_port_and_add_agent.sh">find_mongo_port_and_add_agent.sh</a>,
+     * <li><a href="../../../../../../scripts/add_agent_db_commands.txt">add_agent_db_commands.txt</a>, 
+     * <li><a href="../../../../../../scripts/delete_added_agent.sh">delete_added_agent.sh</a>,
+     * <li><a href="../../../../../../scripts/remove_agent_db_commands.txt">remove_agent_db_commands.txt</a>
+     * <ul>
+     * and rewrites text file 
+     * <a href="../../../../../../scripts/mongoPortNumber.txt">mongoPortNumber.txt</a>.
+     * 
+     * @throws IOException
+     * @throws AWTException
+     */
     public void testAddAgentAndSeeItInGUITest() throws IOException, AWTException {
         // start storage
         GuiRobot robot = startStorageOnly();
--- a/src/org/thermostat/qa/testsuites/GuiClientSmokeTest.java	Wed Jun 12 13:35:26 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/GuiClientSmokeTest.java	Wed Jun 12 16:08:32 2013 +0200
@@ -408,9 +408,11 @@
      *
      * Following patterns are checked for its presence:<br /><br />
      * Text antialiasing enabled:<br />
-     * <img src="patterns/AA/AllAgentsDialog/close_button-v2.png"><br /><br />
+     * <img src="patterns/AA/AllAgentsDialog/close_button.png"><br /><br />
+     * <img src="patterns/AA/AllAgentsDialog/close_button2.png"><br /><br />
      * Text antialiasing disabled:<br />
-     * <img src="patterns/noAA/AllAgentsDialog/close_button-v2.png"><br /><br />
+     * <img src="patterns/noAA/AllAgentsDialog/close_button.png"><br /><br />
+     * <img src="patterns/noAA/AllAgentsDialog/close_button2.png"><br /><br />
      */
     public void testAllAgentsDialog() throws IOException, AWTException
     {
--- a/src/org/thermostat/qa/testsuites/SmokeTests.java	Wed Jun 12 13:35:26 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/SmokeTests.java	Wed Jun 12 16:08:32 2013 +0200
@@ -46,7 +46,13 @@
 import org.thermostat.qa.framework.ThermostatTest;
 
 
-
+/**
+ * Class SmokeTests contains basic smoke tests for testing if the thermostat
+ * executable works properly. Thermostat executable should
+ * exist as a file, be readable, executable, exit with the right
+ * value, and have nonempty output. 
+ * 
+ */
 @TestType(TestTypes.OTHER_TEST)
 public class SmokeTests extends ThermostatTest
 {
@@ -67,31 +73,58 @@
         return new File(this.configuration.getThermostatExecutable());
     }
 
+    /**
+     * Method testCheckPathToThermostatExecutable
+     * tests if the string describing path to thermostat is not null,
+     * and if the file thermostat really exists.
+     */
     public void testCheckPathToThermostatExecutable()
     {
         File f = getThermostatExecutableAsFile();
-        Assert.assertNotNull(f, this.configuration.getThermostatExecutable() + " does not exists");
-        Assert.assertTrue(f.exists(), this.configuration.getThermostatExecutable() + " does not exists");
+        Assert.assertNotNull(f, this.configuration.getThermostatExecutable() + " does not exist");
+        Assert.assertTrue(f.exists(), this.configuration.getThermostatExecutable() + " does not exist");
     }
 
+    /**
+     * Method testCheckIfThermostatExecutableCanBeRead
+     * tests if thermostat executable is readable by the application.
+     */
     public void testCheckIfThermostatExecutableCanBeRead()
     {
         File f = getThermostatExecutableAsFile();
         Assert.assertTrue(f.canRead(), this.configuration.getThermostatExecutable() + " is not readable");
     }
 
+    /**
+     * Method testCheckIfThermostatExecutableCanBeExecuted
+     * tests if application is allowed to execute thermostat executable.
+     */
     public void testCheckIfThermostatExecutableCanBeExecuted()
     {
         File f = getThermostatExecutableAsFile();
         Assert.assertTrue(f.canExecute(), this.configuration.getThermostatExecutable() + " is not executable");
     }
 
+    /**
+     * Method testTryToRunThermostatExecutable
+     * runs (exec) the thermostat executable, no assert, problems can be
+     * errors and exceptions.
+     * 
+     * @throws IOException
+     */
     public void testTryToRunThermostatExecutable() throws IOException
     {
         Process process = runThermostatInNewProcess();
         waitForExternalProcess(process);
     }
 
+    /**
+     * Method testCheckExitValue
+     * tries to run thermostat executable and tests if the exit value
+     * is the same as expected exit value.
+     * 
+     * @throws IOException
+     */
     public void testCheckExitValue() throws IOException
     {
         Process process = runThermostatInNewProcess();
@@ -100,6 +133,13 @@
         Assert.assertEquals(exitValue, EXPECTED_EXIT_VALUE, "Bad thermostat exit value " + exitValue);
     }
 
+    /**
+     * Method testCheckStandardMessage
+     * runs thermostat in a new process, tests if the process output
+     * is not null and if the output size is nonzero.
+     *  
+     * @throws IOException
+     */
     public void testCheckStandardMessage() throws IOException
     {
         Process process = runThermostatInNewProcess();
--- a/src/org/thermostat/qa/testsuites/StorageSmokeTest.java	Wed Jun 12 13:35:26 2013 +0200
+++ b/src/org/thermostat/qa/testsuites/StorageSmokeTest.java	Wed Jun 12 16:08:32 2013 +0200
@@ -45,7 +45,14 @@
 import org.thermostat.qa.framework.ThermostatTest;
 
 
-
+/**
+ * Class StorageSmokeTest
+ * contains basic smoke tests for testing thermostat storage. 
+ * The storage is started and stopped. 
+ * Contents of the output in both cases and presence / absence 
+ * of the mongo processes are checked. 
+ *
+ */
 @TestType(TestTypes.STORAGE_TEST)
 public class StorageSmokeTest extends ThermostatTest
 {
@@ -92,6 +99,15 @@
         return processOutput;
     }
 
+    /**
+     * Method testCheckIfMongoDBIsNotRunningBeforeTest
+     * tries to list all mongo processes without starting thermostat storage.
+     * The output of the script should not be null, but it should empty.
+     * This method uses script 
+     * <a href="../../../../../../scripts/ps_mongo_daemon.sh">ps_mongo_daemon.sh</a>.
+     * 
+     * @throws IOException
+     */
     public void testCheckIfMongoDBIsNotRunningBeforeTest() throws IOException
     {
         List<String> out = runHelperBashScript("ps_mongo_daemon.sh");
@@ -99,6 +115,12 @@
         Assert.assertEquals(out.size(), 0, "at least mongod instance are running!");
     }
 
+    /**
+     * Method testStartStorage starts thermostat storage and
+     * tests that the output is not null.
+     * 
+     * @throws IOException
+     */
     public void testStartStorage() throws IOException
     {
         List<String> processOutput = startStorageAndGetOutput();
@@ -106,6 +128,12 @@
         Assert.assertNotNull(processOutput, "error getting standard output");
     }
 
+    /**
+     * Method testStopStorage stops thermostat storage and
+     * tests if the output is not null. 
+     * 
+     * @throws IOException
+     */
     public void testStopStorage() throws IOException
     {
         List<String> processOutput = stopStorageAndGetOutput();
@@ -113,6 +141,15 @@
         Assert.assertNotNull(processOutput, "error getting standard output");
     }
 
+    /**
+     * Method testCheckIfMongoDBIsStarted
+     * lists all mongo processes and tests if this list is not null and there
+     * is exactly one mongo process. 
+     * This method uses script 
+     * <a href="../../../../../../scripts/ps_mongo_daemon.sh">ps_mongo_daemon.sh</a>.
+     * 
+     * @throws IOException
+     */
     public void testCheckIfMongoDBIsStarted() throws IOException
     {
         startStorage();
@@ -123,6 +160,15 @@
         stopStorage();
     }
 
+    /**
+     * Method testStartStorageMessage
+     * starts the thermostat storage and checks the contents of the output.
+     * The output should not be null, should have at least 3 lines,
+     * the content of first and second line has to be as given, 
+     * the prefixes of third and fourth line have to be as given.   
+     * 
+     * @throws IOException
+     */
     public void testStartStorageMessage() throws IOException
     {
         List<String> processOutput = startStorageAndGetOutput();
@@ -139,6 +185,14 @@
         compareTwoLines(processOutput.get(3).substring(0, STORAGE_MESSAGE_PID.length()), STORAGE_MESSAGE_PID);
     }
 
+    /**
+     * Method testStopStorageMessage
+     * starts the thermostat storage and checks the contents of the output.
+     * The output should not be null, the prefixes of first and second line
+     * have to be as given.
+     * 
+     * @throws IOException
+     */
     public void testStopStorageMessage() throws IOException
     {
         List<String> processOutput = stopStorageAndGetOutput();