Mercurial > hg > ThermostatQA
view src/org/thermostat/qa2/tests/CliClientSmokeTest.java @ 171:1d7ab9111fd2
- added tests ported to the new framework (package org.thermostat.qa2.tests)
- added/updated required targets in Makefile
- new info about dependecies added to README.md
- authorization and error checking code added to mongo js scripts
- done necessary changes to reporter, so it can be used with new framework
- updated keyrings
- added required pattern (for gui tests)
author | Zdenek Zambersky <zzambers@redhat.com> |
---|---|
date | Tue, 10 Mar 2015 13:48:12 +0100 |
parents | |
children |
line wrap: on
line source
/* ThermostatQA - test framework for Thermostat Monitoring Tool Copyright 2015 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.qa2.tests; import java.io.File; import java.util.List; import org.thermostat.qa2.framework.Assert; import org.thermostat.qa2.framework.NativeProcess; import org.thermostat.qa2.framework.Shell; import org.thermostat.qa2.framework.ThermostatQAConfig; import org.thermostat.qa2.framework.annotations.SetupStorage; import org.thermostat.qa2.framework.annotations.RunGnomeKeyring; import org.thermostat.qa2.framework.annotations.RunStorage; import org.thermostat.qa2.framework.annotations.Test; import org.thermostat.qa2.framework.utils.FileUtilities; import org.thermostat.qa2.framework.utils.ProcessUtilities; /** * Test class ported from old framework * @author Zdeněk Žamberský */ @SetupStorage(type = "mongo") @RunGnomeKeyring @RunStorage public class CliClientSmokeTest { String exitThermShellFile = ThermostatQAConfig.getThermostatOutputTextsDir() + File.separator + "output_of_exit_therm_shell.txt"; String helpThermShellFile = ThermostatQAConfig.getThermostatOutputTextsDir() + File.separator + "output_of_help_therm_shell.txt"; @Test public void startOutput() throws Exception { Shell thermostat = ProcessUtilities.createThermostatShell(); thermostat.setEnvironmentVariable("USER_THERMOSTAT_HOME", ThermostatQAConfig.getThermostatUserHome()); thermostat.setStdOutMode(NativeProcess.MODE_LOG_AND_BUFFER); thermostat.start(); thermostat.writeln("exit"); thermostat.waitFor(); List<String> output = thermostat.getStdoutLines(); List<String> expected = FileUtilities.getLineListFromFile(exitThermShellFile); Assert.assertEquals(output, expected); } @Test public void helpOutput() throws Exception { Shell thermostat = ProcessUtilities.createThermostatShell(); thermostat.setEnvironmentVariable("USER_THERMOSTAT_HOME", ThermostatQAConfig.getThermostatUserHome()); thermostat.setStdOutMode(NativeProcess.MODE_LOG_AND_BUFFER); thermostat.start(); thermostat.writeln("help"); thermostat.writeln("exit"); thermostat.waitFor(); List<String> output = thermostat.getStdoutLines(); List<String> expected = FileUtilities.getLineListFromFile(helpThermShellFile); //expected.set(0, expected.get(0) + "abcd"); Assert.assertEquals(output, expected); } }