integration-testing

Create LocalDB for testing from Visual Studio SQL project

坚强是说给别人听的谎言 提交于 2019-12-04 07:26:31
I'm trying to create an integration tests for my project. I need to test a controller that makes call to stored procedure through repository. An empty database should be created on each runs of certain scope of tests. So I'm going to implement the following steps: Create LocalDB Run some Pre-scripts(to add test data) Run test Run some Post-scripts (if needed to run other test on this database) Remove LocalDB In my solution I have .sqlproj with all tables and SPs. How can I create LocalDB with the same structure as in .sqlproj from C# code? Or how can I generate the script with all objects to

Can a test user 'LIKE' a brand page?

痴心易碎 提交于 2019-12-04 06:45:19
I'm building an tab for a brand page, which I am testing via Cucumber/Selenium. I have created several test users in different states, but am hanging up on creating a test user who LIKEs my brand. When I visit my own brand page logged in as my real facebook user, I see a LIKE button. When I visit my brand page logged in as a test user, I do not see an option to LIKE the page. I have had no trouble creating or testing users who have given my tab/app permissions. All test users are associated with the brand page in the developers app. Is it possible to have a test user like an existing brand

Integration tests broken after migrating to ASP.NET Core RC2

旧巷老猫 提交于 2019-12-04 06:18:15
In my integration tests, I use a TestServer class to work towards a test server instance for my integration tests. In RC1, I instanciated it using the following code: var server = new TestServer(TestServer.CreateBuilder().UseStartup<Startup>()); On RC2, TestServer.CreateBuilder() was removed. Therefore, I tried to create a new TestServer using the following code: var server = new TestServer(new WebHostBuilder().UseStartup<Startup>()); The problem I'm facing is that after RC2, the runtime is unable to resolve dependencies for DI, so that it throws exceptions on the Configure method for the

Protractor+Mocha fails suite with TypeError before browser loads SUT

冷暖自知 提交于 2019-12-04 06:07:39
问题 Context I'm exploring angular2 + angular-cli + typescript. My objective is to ensure that if I am doing an angular app or a node app in typescript I would be using the same testing technologies as legacy node apps that use mocha. To this end I am trying to reconfigure the angular-cli generated protractor.conf.js to use mocha instead of jasmine. Question How do you properly integrate angular-cli + mocha + protractor so that tests will execute with protractor actually providing the mocha specs

Multi-language integration testing framework

孤者浪人 提交于 2019-12-04 05:58:16
Imagine that you have a fairly complex service-oriented architecture made by different components. Components are written in different languages (Java, PHP, Ruby) and communicate with each other in different ways (i.e. UI, REST API, in some cases sharing some DB tables, etc). I am trying to design an integration testing framework for some end-to-end testing. We already have unit/integration tests for the single components, but we would like to build something that fully tests our deployed system (in a real environment) end-to-end to make sure the functionalities (in terms of expected

Error setting database config property for IDatabaseConnection (HSQLDB)

假如想象 提交于 2019-12-04 04:08:00
问题 I've included fully testable code below, which generates the following error when supplied with a dataset xml containing empty fields. A sample dataset.xml is also below. java.lang.IllegalArgumentException: table.column=places.CITY value is empty but must contain a value (to disable this feature check, set DatabaseConfig.FEATURE_ALLOW_EMPTY_FIELDS to true) The thread here is similar but is different since it uses multiple dbTester.getConnection() whereas my code only uses one, yet has the

JUnit custom runner with Spring application context

泪湿孤枕 提交于 2019-12-04 03:57:22
I am fairly new to Spring and am working with a suite of JUnit 4.7 integration tests for a web application. I have a number of working test cases of the form: import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/META-INF/spring/testContext.xml" }) public class myTest { @Test public void testCreate() { //execute tests .... } } My application has a number of external dependencies that

session object in rspec integration test

雨燕双飞 提交于 2019-12-04 03:44:54
I am using rspec and capybara for integration testing. Is their a way to make session objects in request specs? I have a view page in which I use a session object to check its value to display selective content. The problem am facing is that I cannot create a session object in request spec. Here is an example of the view: <% if session[:role] == "Role" %> ---content--- <% else %> --content-- <% end %> And inside my request spec session[:role] = "Role" visit my_path But it throws me an error "undefined method `session' for nil:NilClass". I also tried looking into creating session objects of

Java-written embedded Kerberos server for testing

≯℡__Kan透↙ 提交于 2019-12-04 03:44:28
is anyone aware of any embeddable Kerberos servers (KDC / KAdmin), which are written in Java and may run just within the JVM process (something like Hadoop minicluster or embedded LDAP servers)? My goal it to let people run integ tests requiring Kerberos authentication without having to install local kerberos server/configure remote server and connection to it. kayyagari You can give Apache Directory Server ( http://directory.apache.org/ ) a try. It supports LDAP and Kerberos. See this example: http://svn.apache.org/repos/asf/directory/apacheds/trunk/kerberos-test/src/test/java/org/apache

Database integration tests

自古美人都是妖i 提交于 2019-12-04 03:14:25
When you are doing integration tests with either just your data access layer or the majority of the application stack. What is the best way prevent multiple tests from clashing with each other if they are run on the same database? Transactions. What the ruby on rails unit test framework does is this: Load all fixture data. For each test: BEGIN TRANSACTION # Yield control to user code ROLLBACK TRANSACTION End for each This means that Any changes your test makes to the database won't affect other threads while it's in-progress The next test's data isn't polluted by prior tests This is about a