integration-testing

Set dummy IP address in integration test with Asp.Net Core TestServer

独自空忆成欢 提交于 2019-12-04 02:52:40
问题 I have a C# Asp.Net Core (1.x) project, implementing a web REST API, and its related integration test project, where before any test there's a setup similar to: // ... IWebHostBuilder webHostBuilder = GetWebHostBuilderSimilarToRealOne() .UseStartup<MyTestStartup>(); TestServer server = new TestServer(webHostBuilder); server.BaseAddress = new Uri("http://localhost:5000"); HttpClient client = server.CreateClient(); // ... During tests, the client is used to send HTTP requests to web API (the

Spring Boot. @DataJpaTest H2 embedded database create schema

末鹿安然 提交于 2019-12-04 02:48:49
问题 I have couple of entities in my data layer stored in particular schema. For example: @Entity @Table(name = "FOO", schema = "DUMMY") public class Foo {} I'm trying to setup H2 embedded database for integration testing of my data layer. I'm using @DataJpaTest annotation for my tests to get H2 embedded database configured automatically. However, the creation of tables fails because schema DUMMY is not created at DB initialization. Any ideas on how to create schema before creation of tables in

Configure Sonar to see Integration Tests (v6.2)

自作多情 提交于 2019-12-04 02:33:29
How to visualize Integration Tests in Sonar ? Currently I only see : the global coverage (UT + IT) the number of UT I read somewhere we had to configure a widget in the GUI : I didn't see any option which could do that. Documentation states : If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage. But in my case I see that the coverage is changing when I change my UTs (or ITs). Moreover I see jacoco reports in the targets : jacoco.exec jacoco-it.exec I finaly tryed the official Sonar samples : it is the same ! I didn't find any sample with a clear

embedded zookeeper for unit/integration test

左心房为你撑大大i 提交于 2019-12-04 01:30:33
Is there an embedded zookeeper so that we could use it in unit testing? It can be shipped with the test and run out of the box. Maybe we could mock some service and register to the embedded zookeeper The Curator framework has TestingServer and TestingCluster classes (see https://github.com/Netflix/curator/wiki/Utilities ) that are in a separate maven artifact (curator-test - see the Maven/Artifacts section of https://github.com/Netflix/curator/wiki ). They're pretty self explanatory, or you can download the curator code base and see how they're used internally in their own test cases. We've

Testing File uploads in Symfony2

人走茶凉 提交于 2019-12-03 23:33:46
In the Symfony2 documentation it gives the simple example of: $client->request('POST', '/submit', array('name' => 'Fabien'), array('photo' => '/path/to/photo')); To simulate a file upload. However in all my tests I am getting nothing in the $request object in the app and nothing in the $_FILES array. Here is a simple WebTestCase which is failing. It is self contained and tests the request that the $client constructs based on the parameters you pass in. It's not testing the app. class UploadTest extends WebTestCase { public function testNewPhotos() { $client = $this->createClient(); $client-

Title test failing for request specs in Michael Hartls tutorial for Rails 3

馋奶兔 提交于 2019-12-03 20:58:42
Im following the Ruby On Rails 3 tutorial by Michael Hartl and using Capybara for the integration specs. The integration specs so far are as follows require 'spec_helper' describe "StaticPages" do describe "Home page" do it "should have the h1 'Sample App'" do visit '/static_pages/home' page.should have_selector('h1',:text => 'Sample App') end it "should have the title 'Home'" do visit '/static_pages/home' page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Home") end end describe "Help page" do it "should have the h1 'Help'" do visit '/static_pages/help' page

Can we use JUNIT for Automated Integration Testing?

北战南征 提交于 2019-12-03 18:20:02
问题 How do you automate integration testing? I use JUnit for some of these tests. This is one of the solutions or is totally wrong? What do you suggest? 回答1: JUnit works. There are no limitations that restrict it to being unit tests only. We use JUnit, Maven and CruiseControl to do CI. There may be tools that are specific for integration testing, but I would think their usefulness is dependent on what type of system components you are integrating. JUnit will work fine for non UI type testing. 回答2

Mocha tests, clean disk database before every file runs

耗尽温柔 提交于 2019-12-03 18:14:35
问题 I am using Sails 1.x. Is it possible to reset the Sails.js database before each test file runs? I want it to be in state after sails.lift() completes before each run. I followed the docs here - https://sailsjs.com/documentation/concepts/testing - but did not end up with any solution like this. The only solution I'm having right now is to change the lifecyle.test.js before and after to run beforeEvery and afterEvery - https://sailsjs.com/documentation/concepts/testing - so this is lifting

How to write integration and system tests in Asp.net MVC

好久不见. 提交于 2019-12-03 17:45:29
问题 My application I have an application design that looks like this: web application layer - asp.net MVC app with controllers and views that use POCOs and call services service layer - business processes that use POCOs and call repositories data layer - repositories that use POCOs and communicate with the model in the form of EF model which is part of this same layer POCO layer - defines all classes that are used for inter communication between these layers So my data layer is completely

Integration testing an MVC application without the pain of UI automation

ぐ巨炮叔叔 提交于 2019-12-03 17:15:42
I'm starting development on a new MVC application that will be largely written using TDD. I'd like to add some integration tests to ensure that the fully wired application (I'm using StructureMap for IOC, NHibernate for persistence) works as expected. While I intend to write a few functional smoke tests with Selenium, for maintainability reasons, I'd rather do my most of integration testing by directly calling actions on my controllers using good old C#. There is surprisingly little guidance on how one would accomplish this, so I took a stab on a plan of attack Pull all bootstrapping code out