Mercurial > hg > ThermostatQA
changeset 147:7fa8af3d3e7d
renaming DBHeapDumpTest testsuite to DBGuiHeapDumpTest, adding DBCommandsHeapDumpTest testsuite
author | Jana Fabrikova <jfabriko@redhat.com> |
---|---|
date | Mon, 24 Feb 2014 17:50:01 +0100 |
parents | 28a547a9cfb4 |
children | 7a0957d2b202 |
files | ChangeLog Makefile src/org/thermostat/qa/testsuites/DBCommandsHeapDumpTest.java src/org/thermostat/qa/testsuites/DBGuiHeapDumpTest.java src/org/thermostat/qa/testsuites/DBHeapDumpTest.java |
diffstat | 5 files changed, 513 insertions(+), 284 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Mon Feb 24 17:37:11 2014 +0100 +++ b/ChangeLog Mon Feb 24 17:50:01 2014 +0100 @@ -1,4 +1,18 @@ -2014-02-24 Jana Fabrikova <jfabriko@redhat.com> +2014-02-24 Jana Fabrikova <jfabriko@redhat.com> + + * src/org/thermostat/qa/framework/ThermostatUtilities.java: + adding methods (thermostatListVms), (createDBLoginTextFile), + (thermostatDumpHeap) + * src/org/thermostat/qa/testsuites/DBHeapDumpTest.java: + renaming this testsuite to DBGuiHeapDumpTest + * src/org/thermostat/qa/testsuites/DBCommandsHeapDumpTest.java: + adding new testsuite for checking the db scheme after heapdump + performed via thermostat commands + * Makefile: + adding DBGuiHeapDumpTest, DBCommandsHeapDumpTest testsuites, + removing DBHeapDumpTest testsuite + +2014-02-24 Jana Fabrikova <jfabriko@redhat.com> * scripts/delete_longlist_from_db.sh: * scripts/remove_alldata_db_commands.txt:
--- a/Makefile Mon Feb 24 17:37:11 2014 +0100 +++ b/Makefile Mon Feb 24 17:50:01 2014 +0100 @@ -49,7 +49,8 @@ CommandChannelSmokeTest \ CommandChannelWebStorageTest \ DBSchemeSmokeTest \ - DBHeapDumpTest + DBGuiHeapDumpTest \ + DBCommandsHeapDumpTest ALL_CLASSES = \ $(BUILD_DIR)/$(ANNOTATIONS_PACKAGE)/TestTypes.class \ @@ -99,7 +100,8 @@ $(BUILD_DIR)/$(TEST_PACKAGE)/CommandChannelSmokeTest.class \ $(BUILD_DIR)/$(TEST_PACKAGE)/CommandChannelWebStorageTest.class \ $(BUILD_DIR)/$(TEST_PACKAGE)/DBSchemeSmokeTest.class \ - $(BUILD_DIR)/$(TEST_PACKAGE)/DBHeapDumpTest.class + $(BUILD_DIR)/$(TEST_PACKAGE)/DBGuiHeapDumpTest.class \ + $(BUILD_DIR)/$(TEST_PACKAGE)/DBCommandsHeapDumpTest.class all: build runtests
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/thermostat/qa/testsuites/DBCommandsHeapDumpTest.java Mon Feb 24 17:50:01 2014 +0100 @@ -0,0 +1,210 @@ +/* + + ThermostatQA - test framework for Thermostat Monitoring Tool + + Copyright 2014 Red Hat, Inc. + +This file is part of ThermostatQA + +ThermostatQA is distributed under the GNU General Public License, +version 2 or any later version (with a special exception described +below, commonly known as the "Classpath Exception"). + +A copy of GNU General Public License (GPL) is included in this +distribution, in the file COPYING. + +Linking ThermostatQA code with other modules is making a combined work +based on ThermostatQA. Thus, the terms and conditions of the GPL +cover the whole combination. + +As a special exception, the copyright holders of ThermostatQA give you +permission to link this code with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on ThermostatQA code. If you modify ThermostatQA, you may +extend this exception to your version of the software, but you are +not obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.thermostat.qa.testsuites; + +import java.io.IOException; +import java.util.List; + +import org.thermostat.qa.annotations.StorageType; +import org.thermostat.qa.annotations.StorageTypes; +import org.thermostat.qa.framework.Assert; +import org.thermostat.qa.framework.ThermostatTest; + +/** + * Class DBCommandsHeapDumpTest + * contains tests for checking the db scheme for thermostat mongodb + * storage after a heap dump performed as a standalone command. + * The test starts storage and one agent and performs commands + * thermostat list-vms and thermostat dump-heap -a running-vm-host-id + * -v running-vm-id. + * Then all the collections that should not be empty after these + * steps are checked - there should be a non-null record in each + * (findOne() in the js script for mongo shell), and + * its elements should be of the right types. + * + */ +@StorageType(StorageTypes.MONGODB_STORAGE) +public class DBCommandsHeapDumpTest extends ThermostatTest +{ + + private List<String> scriptOutput; + + @Override + protected void tearDown() + { + + } + + @Override + protected void setUp() + { + // TODO + //start storage and agent + startStorage(); + new AgentThread().start(); + logInfo("runAgentThread", "Thermostat Agent started"); + + sleep(2*ONE_SEC); + + //list-vms, find a running vm, dump a heap + try + { + List<String> vms = thermostatListVms("", ""); + boolean foundRunning = false; + int index = -1; + for(String vm : vms) + { + if(vm.contains("RUNNING")) + { + foundRunning = true; + index = vms.indexOf(vm); + break; + } + } + + Assert.assertTrue(foundRunning, "Problem finding a running vm!"); + + String hostId = (vms.get(index).split(" "))[0]; + String vmId = (vms.get(index).split(" "))[2]; + thermostatDumpHeap(hostId, vmId, "", ""); + + } + catch (IOException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + //run js test script, get output + try + { + scriptOutput = runCommandsInMongoShell("check-collection-heap-dump.js"); + } + catch (IOException e) + { + e.printStackTrace(); + } + + //stop the agent and storage + try + { + //ADD END OF THE SITUATION HERE + + runHelperBashScript("stop_all_therm_agents.sh"); + stopStorage(); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void testAgentConfig(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for agent-config is OK"); + } + public void testBackendInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for backend-info is OK"); + } + public void testCpuStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for cpu-stats is OK"); + } + /*public void testFs.chunks(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.chunks is OK"); + } + public void testFs.files(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.files is OK"); + }*/ + public void testHostInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for host-info is OK"); + } + public void testMemoryStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for memory-stats is OK"); + } + public void testNetworkInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for network-info is OK"); + } + public void testNumaHostInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-host-info is OK"); + } + public void testNumaStat(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-stat is OK"); + } + public void testVmClassStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-class-stats is OK"); + } + public void testVmCpuStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-cpu-stats is OK"); + } + public void testVmGcStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-gc-stats is OK"); + } + public void testVmHeapInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-heap-info is OK"); + } + public void testVmInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-info is OK"); + } + public void testVmMemoryStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-memory-stats is OK"); + } + public void testVmThreadCapabilities(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-capabilities is OK"); + } + public void testVmThreadHarvesting(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-harvesting is OK"); + } + + public static void main(String[] args) { + new DBCommandsHeapDumpTest().doTests(args); + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/thermostat/qa/testsuites/DBGuiHeapDumpTest.java Mon Feb 24 17:50:01 2014 +0100 @@ -0,0 +1,284 @@ +/* + + ThermostatQA - test framework for Thermostat Monitoring Tool + + Copyright 2014 Red Hat, Inc. + +This file is part of ThermostatQA + +ThermostatQA is distributed under the GNU General Public License, +version 2 or any later version (with a special exception described +below, commonly known as the "Classpath Exception"). + +A copy of GNU General Public License (GPL) is included in this +distribution, in the file COPYING. + +Linking ThermostatQA code with other modules is making a combined work +based on ThermostatQA. Thus, the terms and conditions of the GPL +cover the whole combination. + +As a special exception, the copyright holders of ThermostatQA give you +permission to link this code with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on ThermostatQA code. If you modify ThermostatQA, you may +extend this exception to your version of the software, but you are +not obligated to do so. If you do not wish to do so, delete this +exception statement from your version. +*/ + +package org.thermostat.qa.testsuites; + +import java.awt.AWTException; +import java.awt.Rectangle; +import java.io.IOException; +import java.util.List; + + + + + + +import org.thermostat.qa.annotations.StorageType; +import org.thermostat.qa.annotations.StorageTypes; +import org.thermostat.qa.annotations.TestType; +import org.thermostat.qa.annotations.TestTypes; +import org.thermostat.qa.framework.Assert; +import org.thermostat.qa.framework.GuiRobot; +import org.thermostat.qa.framework.Patterns; +import org.thermostat.qa.framework.ThermostatGuiTest; + +/** + * Class DBGuiHeapDumpTest + * contains tests for checking the db scheme for thermostat mongodb + * storage after a heap dump performed via thermostat gui. + * The test starts storage and one agent and gui, opens a vm view + * and clicks on the "dump a heap" button. + * Then all the collections that should not be empty after these + * steps are checked - there should be a non-null record in each + * (findOne() in the js script for mongo shell), and + * its elements should be of the right types. + * + */ +@TestType(TestTypes.GUI_TEST) +@StorageType(StorageTypes.MONGODB_STORAGE) +public class DBGuiHeapDumpTest extends ThermostatGuiTest +{ + + private List<String> scriptOutput; + private GuiRobot robot; + + private GuiRobot clickOnVMView() throws IOException, AWTException{ + //start storage + GuiRobot robot = startStorageOnly(); + //start agent + new AgentThread().start(); + logInfo("runAgentThread", "Thermostat Agent started"); + + if (this.configuration.useDummyGfxTests()) + { + robot.loadScreenshot("GuiStarted1"); + } + else + { + //start gui + runThermostatGuiInANewThread(); + sleep(15000); + robot.createScreenCapture(); + robot.saveScreenshot("GuiStarted1"); + } + + //if only host icon is visible, click the '>' icon to see all its vms + Rectangle r = findPattern(robot, Patterns.MainWindow.HOST_ICON_WITH_ARROW, "host view icon with arrow"); + if(r != null) + { + r.width = 6; + robot.clickToRectangle(r); + sleep(ONE_SEC); + robot.createScreenCapture(); + robot.saveScreenshot("GuiStarted2"); + } + + r = checkForPattern(robot, Patterns.MainWindow.VM_VIEW_ICON, "vm view icon"); + robot.clickToRectangle(r); + + if (this.configuration.useDummyGfxTests()) + { + robot.loadScreenshot("VMViewActive1"); + } + else + { + sleep(2000); + robot.createScreenCapture(); + robot.saveScreenshot("VMViewActive1"); + } + + checkForPattern(robot, Patterns.MainWindow.VM_VIEW_ICON_ACTIVE, "vm view active icon"); + robot.saveScreenshot("VMViewActive2"); + + return robot; + } + + private GuiRobot dumpAHeap() throws IOException, AWTException { + + robot = clickOnVMView(); + + //click on Heap Analyzer tab + Rectangle r = checkForPattern(robot, Patterns.VMView.HEAP_ANALYZER_TAB, "heap analyzer tab"); + robot.clickToRectangle(r); + + if (this.configuration.useDummyGfxTests()) + { + robot.loadScreenshot("VMViewHeapAnalyzer1"); + } + else + { + sleep(2000); + robot.createScreenCapture(); + robot.saveScreenshot("VMViewHeapAnalyzer1"); + } + + checkForPattern(robot, Patterns.VMView.HEAP_ANALYZER_TAB_CHOSEN, "heap analyzer tab chosen"); + robot.saveScreenshot("VMViewHeapAnalyzer2"); + + //click on Heap Dump button + r = checkForPattern(robot, Patterns.VMViewHeapAnalyzerTab.HEAP_DUMP_LABEL, "vm view icon"); + robot.clickToRectangle(r); + + return robot; + } + + @Override + protected void tearDown() + { + + } + + @Override + protected void setUp() + { + // TODO + //start storage and agent + try + { + this.robot = dumpAHeap(); + } + catch (IOException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + catch (AWTException e1) + { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + + + //run js test script, get output + try + { + scriptOutput = runCommandsInMongoShell("check-collection-heap-dump.js"); + } + catch (IOException e) + { + e.printStackTrace(); + } + + //stop the agent and storage + try + { + //ADD END OF THE SITUATION HERE + stopGUI(robot); + runHelperBashScript("stop_all_therm_agents.sh"); + stopStorage(); + } + catch (IOException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void testAgentConfig(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for agent-config is OK"); + } + public void testBackendInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for backend-info is OK"); + } + public void testCpuStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for cpu-stats is OK"); + } + /*public void testFs.chunks(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.chunks is OK"); + } + public void testFs.files(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.files is OK"); + }*/ + public void testHostInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for host-info is OK"); + } + public void testMemoryStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for memory-stats is OK"); + } + public void testNetworkInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for network-info is OK"); + } + public void testNumaHostInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-host-info is OK"); + } + public void testNumaStat(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-stat is OK"); + } + public void testVmClassStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-class-stats is OK"); + } + public void testVmCpuStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-cpu-stats is OK"); + } + public void testVmGcStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-gc-stats is OK"); + } + public void testVmHeapInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-heap-info is OK"); + } + public void testVmInfo(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-info is OK"); + } + public void testVmMemoryStats(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-memory-stats is OK"); + } + public void testVmThreadCapabilities(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-capabilities is OK"); + } + public void testVmThreadHarvesting(){ + Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); + checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-harvesting is OK"); + } + + public static void main(String[] args) { + new DBGuiHeapDumpTest().doTests(args); + } + +}
--- a/src/org/thermostat/qa/testsuites/DBHeapDumpTest.java Mon Feb 24 17:37:11 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* - - ThermostatQA - test framework for Thermostat Monitoring Tool - - Copyright 2014 Red Hat, Inc. - -This file is part of ThermostatQA - -ThermostatQA is distributed under the GNU General Public License, -version 2 or any later version (with a special exception described -below, commonly known as the "Classpath Exception"). - -A copy of GNU General Public License (GPL) is included in this -distribution, in the file COPYING. - -Linking ThermostatQA code with other modules is making a combined work -based on ThermostatQA. Thus, the terms and conditions of the GPL -cover the whole combination. - -As a special exception, the copyright holders of ThermostatQA give you -permission to link this code with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on ThermostatQA code. If you modify ThermostatQA, you may -extend this exception to your version of the software, but you are -not obligated to do so. If you do not wish to do so, delete this -exception statement from your version. -*/ - -package org.thermostat.qa.testsuites; - -import java.awt.AWTException; -import java.awt.Rectangle; -import java.io.IOException; -import java.util.List; - - - - - - -import org.thermostat.qa.annotations.StorageType; -import org.thermostat.qa.annotations.StorageTypes; -import org.thermostat.qa.annotations.TestType; -import org.thermostat.qa.annotations.TestTypes; -import org.thermostat.qa.framework.Assert; -import org.thermostat.qa.framework.GuiRobot; -import org.thermostat.qa.framework.Patterns; -import org.thermostat.qa.framework.ThermostatGuiTest; - -/** - * Class DBSchemeSmokeTest - * contains basic smoke tests for checking the db scheme for thermostat mongodb - * storage. The test starts storage and one agent. Then all the collections - * that should not be empty after these steps are checked - there should be - * a non-null record in each (findOne() in the js script for mongo shell), and - * its elements should be of the right types. - * - */ -@TestType(TestTypes.GUI_TEST) -@StorageType(StorageTypes.MONGODB_STORAGE) -public class DBHeapDumpTest extends ThermostatGuiTest -{ - - private List<String> scriptOutput; - private GuiRobot robot; - - private GuiRobot clickOnVMView() throws IOException, AWTException{ - //start storage - GuiRobot robot = startStorageOnly(); - //start agent - new AgentThread().start(); - logInfo("runAgentThread", "Thermostat Agent started"); - - if (this.configuration.useDummyGfxTests()) - { - robot.loadScreenshot("GuiStarted1"); - } - else - { - //start gui - runThermostatGuiInANewThread(); - sleep(15000); - robot.createScreenCapture(); - robot.saveScreenshot("GuiStarted1"); - } - - //if only host icon is visible, click the '>' icon to see all its vms - Rectangle r = findPattern(robot, Patterns.MainWindow.HOST_ICON_WITH_ARROW, "host view icon with arrow"); - if(r != null) - { - r.width = 6; - robot.clickToRectangle(r); - sleep(ONE_SEC); - robot.createScreenCapture(); - robot.saveScreenshot("GuiStarted2"); - } - - r = checkForPattern(robot, Patterns.MainWindow.VM_VIEW_ICON, "vm view icon"); - robot.clickToRectangle(r); - - if (this.configuration.useDummyGfxTests()) - { - robot.loadScreenshot("VMViewActive1"); - } - else - { - sleep(2000); - robot.createScreenCapture(); - robot.saveScreenshot("VMViewActive1"); - } - - checkForPattern(robot, Patterns.MainWindow.VM_VIEW_ICON_ACTIVE, "vm view active icon"); - robot.saveScreenshot("VMViewActive2"); - - return robot; - } - - private GuiRobot dumpAHeap() throws IOException, AWTException { - - robot = clickOnVMView(); - - //click on Heap Analyzer tab - Rectangle r = checkForPattern(robot, Patterns.VMView.HEAP_ANALYZER_TAB, "heap analyzer tab"); - robot.clickToRectangle(r); - - if (this.configuration.useDummyGfxTests()) - { - robot.loadScreenshot("VMViewHeapAnalyzer1"); - } - else - { - sleep(2000); - robot.createScreenCapture(); - robot.saveScreenshot("VMViewHeapAnalyzer1"); - } - - checkForPattern(robot, Patterns.VMView.HEAP_ANALYZER_TAB_CHOSEN, "heap analyzer tab chosen"); - robot.saveScreenshot("VMViewHeapAnalyzer2"); - - //click on Heap Dump button - r = checkForPattern(robot, Patterns.VMViewHeapAnalyzerTab.HEAP_DUMP_LABEL, "vm view icon"); - robot.clickToRectangle(r); - - return robot; - } - - @Override - protected void tearDown() - { - - } - - @Override - protected void setUp() - { - // TODO - //start storage and agent - try - { - this.robot = dumpAHeap(); - } - catch (IOException e1) - { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - catch (AWTException e1) - { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - - - //run js test script, get output - try - { - scriptOutput = runCommandsInMongoShell("check-collection-heap-dump.js"); - } - catch (IOException e) - { - e.printStackTrace(); - } - - //stop the agent and storage - try - { - //ADD END OF THE SITUATION HERE - stopGUI(robot); - runHelperBashScript("stop_all_therm_agents.sh"); - stopStorage(); - } - catch (IOException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - public void testAgentConfig(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for agent-config is OK"); - } - public void testBackendInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for backend-info is OK"); - } - public void testCpuStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for cpu-stats is OK"); - } - /*public void testFs.chunks(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.chunks is OK"); - } - public void testFs.files(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for fs.files is OK"); - }*/ - public void testHostInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for host-info is OK"); - } - public void testMemoryStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for memory-stats is OK"); - } - public void testNetworkInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for network-info is OK"); - } - public void testNumaHostInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-host-info is OK"); - } - public void testNumaStat(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for numa-stat is OK"); - } - public void testVmClassStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-class-stats is OK"); - } - public void testVmCpuStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-cpu-stats is OK"); - } - public void testVmGcStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-gc-stats is OK"); - } - public void testVmHeapInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-heap-info is OK"); - } - public void testVmInfo(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-info is OK"); - } - public void testVmMemoryStats(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-memory-stats is OK"); - } - public void testVmThreadCapabilities(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-capabilities is OK"); - } - public void testVmThreadHarvesting(){ - Assert.assertNotNull(scriptOutput, "problems running auxiliary script"); - checkPresenceOfPatternInTexts(scriptOutput, "schema for vm-thread-harvesting is OK"); - } - - public static void main(String[] args) { - new DBHeapDumpTest().doTests(args); - } - -}