testing

Integration Testing with a fake server

天涯浪子 提交于 2019-12-24 17:26:02
问题 I have a service which connects to a set of api's which i want to test. I would like to make a Fake Service for my integration tests (to simulate failure situations) I cannot simply use @RestController as they are not loaded during a test, and I looked into mockserver but I am unsure if it is what I am looking for, as I do not want my test to trigger a mock call, but rather my code should trigger the api call normally, simply using the mock server rather than an actual server (the base url is

UFT not identifying a window in some playback

一个人想着一个人 提交于 2019-12-24 17:23:15
问题 I am using descriptive programming in UFT. During playback, I want to check if the Windows print dialog does appear. Then I want to click the Cancel button in that dialog. My problem: Sporadically QTP fails to identify the printing dialog, so clicking on the cancel button fails. How can this possibly sometimes fail, sometimes succeed? My code syntax given below: Set Window_EnterMeter = browser_servicemanager.Window("regexpwndtitle:=Enter Meters.*") Set dialog_Print = Window_EnterMeter.Dialog(

Source code in SoapUI maven

情到浓时终转凉″ 提交于 2019-12-24 17:08:07
问题 How I can add my source code ( java code ) to project SoapUI running by maven? I wrote own assertion class and check response in this class. First i made dir ext and put there .jar file. Now I want do the same, but with source code. 回答1: By adding a jar in the \ext folder you made the compiled class available to SoapUI test runner. Instead of that you could include your code as a maven module in your project and add it as dependency. Your Java code should be a maven project for this to work.

Unit test with accessors

[亡魂溺海] 提交于 2019-12-24 16:35:11
问题 This is a two part question. Background: We moved our C# application from VS2005 to VS2008 and in the process moved the application from .net 2.0 to .net 3.5. The transition went smoothly except for Unit Tests. First: Is the unit test framework based off Visual Studios or .NET? Second: This question is derived from the issues we have with the unit tests. We have internal classes that need accessors in order to unit test them. When the application was in VS2005, all the accessors were auto

Hibernate executed queries and testing

痴心易碎 提交于 2019-12-24 16:16:27
问题 Is there a way to find out what queries are executed with hibernate? I would like to write a performance test to ensure only a specific query and amount are run. Update: Just a clarification, i would like to programatically find out how many queries are run, not just via visual-manual inspection, so it would easily testable. 回答1: Enable Hibernate statistics and use SessionFactory#getStatistics() to retrieve a Statistics and access the metrics related to queries. See getQueries(),

Test menu items

十年热恋 提交于 2019-12-24 16:14:03
问题 I found the following test (slightly modified) as an answer here. But I get an error that says that I need android.permission.INJECT_EVENT. I have added it both to the application-project and the test-project but the test still says it needs it. Have I missunderstood how the test should be written? public void testMenuItemAddDrink(){ Start activity = getActivity(); ActivityMonitor am = getInstrumentation().addMonitor(Start.class.getName(), null, false); getInstrumentation().sendKeyDownUpSync

Play 2.0 doesn't run all tests

两盒软妹~` 提交于 2019-12-24 15:57:53
问题 I'm porting an application over to Play 2.0 and for some reason it's not running all the tests. It finds all the test classes. But just doesn't run any tests in most of them. I tried moving the classes to the base of tests directory, but that didn't make a difference. The tests it doesn't run contain tests for the persistence using hibernate JPA. The classes have a common base class for managing the database state across tests. I'm expecting the persistence tests to blow up spectacularly but

bash: wrong behavior in for… loop together with a test statement

孤街浪徒 提交于 2019-12-24 15:24:59
问题 I am trying to test if certain files, called up in a list of textfiles, are in a certain directory. Every once in a while (and I am quite certain I use the same statements every time) I get an error, complaining that the echo command cannot be found. The textfiles I have in my directory /audio/playlists/ are named according to their date on which they are supposed to be used: 20130715.txt for example for today: me@computer:/some/dir# ls /audio/playlists/ 20130715.txt 20130802.txt 20130820.txt

How to test jQuery TokenInput field using Selenium

纵然是瞬间 提交于 2019-12-24 15:22:11
问题 I'm unable to test a Tokeninput field in a form using selenium. The situation is when we type something, it gives a list to options to select but those options aren't part of the DOM. The text fills the field but doesn't select the item. The code which I have written is: Given admin user is on schedule interview page And he select "obie[1]" and "DHH[1]" from the candidate name(s) auto sugget field **step defination** Given /^he select "([^"]*)" and "([^"]*)" from the candidate name\(s\) auto

Create Parent and Child with child presence validation Factory Girl

落爺英雄遲暮 提交于 2019-12-24 15:12:33
问题 Have a project that has Invoices with many Trips. New story came my way requesting that an Invoice MUST have a trip. I've added a validation validates :trips, presence: true but it is now blowing up a number of my tests since FactoryGirl is trying to save the invoice before creating the associated trip. FactoryGirl.define do factory :invoice do sequence(:invoice_id) { SecureRandom.uuid} merchant amount 100.00 item_count 1 paid false currency "GBP" invoice_type "pre-flight" service_rendered