integration-testing

Junit: splitting integration test and Unit tests

一笑奈何 提交于 2019-11-29 19:02:53
I've inherited a load of Junit test, but these tests (apart from most not working) are a mixture of actual unit test and integration tests (requiring external systems, db etc). So I'm trying to think of a way to actually separate them out, so that I can run the unit test nice and quickly and the integration tests after that. The options are.. Split them into separate directories. Move to Junit4 (from v3) and annotate the classes to separate them. Use a file naming convention to tell what a class is , i.e. AdapterATest and AdapterAIntergrationTest. 3 has the issue that Eclipse has the option to

How to instantiate different versions of InternetExplorerDriver - Selenium 2?

拥有回忆 提交于 2019-11-29 17:57:09
问题 just wondering how I can instantiate different versions of InternetExplorerDriver. That's how I can create a IE driver: WebDriver ieWebDriver = new InternetExplorerDriver(); but I am not able to differentiate between IE6, IE7, IE8 and IE9. Cheers, 回答1: Windows only supports installing a single IE version. Although some hacks exist to run multiple versions, I'm pretty sure you won't get them working with WebDriver (although I'd love to be proven wrong). In your shoes, I would probably set up a

Mocha tests, clean disk database before every file runs

本秂侑毒 提交于 2019-11-29 17:21:01
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 everytime before test. But it takes a long time to lift. This is very simple to do. You just need to

How can we decide which testing method can be used?

一个人想着一个人 提交于 2019-11-29 16:50:54
i have project in .net , i want to test it. But i dont know anything about testing and its method. how can i go ahead with testing. which method is better for me for begining? Is there anything to decide which testing method is taken into account for better result? There is no "right" or "wrong" in testing. Testing is an art and what you should choose and how well it works out for you depends a lot from project to project and your experience. But as a professional Tester Expert my suggestion is that you have a healthy mix of automated and manual testing. AUTOMATED TESTING Unit Testing Use

In Maven is it possible to keep integration tests in a separate folder from unit tests?

末鹿安然 提交于 2019-11-29 16:25:40
问题 On the Maven and Integration Testing page it says: The Future Rumor has it that a future version of Maven will support something like src/it/java in the integration-test phase, in addition to src/test/java in the test phase. but that was back in 2011-12-11. Has this happened yet? In this answer to "Run maven test not in default src/test/java folder" it mentions setting the <testSourceDirectory> , is their some way of doing this just for integration test (ie. the integration-test phase)? I'm

Running integration tests with Cobertura Maven plugin

久未见 提交于 2019-11-29 16:01:11
问题 I am having trouble getting the Cobertura plugin to run integration tests in Maven. The closest answer to this question I have found is http://jira.codehaus.org/browse/MCOBERTURA-86. However, the issue remains an open bug. I tried the configuration suggested by Stevo on 03/Apr/09, it didn't work. My POM <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <version>2.3-SNAPSHOT</version> <reportSets> <reportSet> <reports> <report

Starting external process during integration testing in maven

断了今生、忘了曾经 提交于 2019-11-29 15:52:50
问题 I want completely automated integration testing for a Maven project. The integration tests require that an external (platform-dependent) program is started before running. Ideally, the external program would be killed after the unit tests are finished, but is not necessary. Is there a Maven plugin to accomplish this? Other ideas? 回答1: You could use the antrun plugin. Inside you would use ant's exec apply task. Something like this. <plugin> <groupId>org.apache.maven.plugins</groupId>

Integration tests with Gradle Kotlin DSL

旧城冷巷雨未停 提交于 2019-11-29 12:53:32
问题 I'm using this blog post to configure integration tests for a Spring Boot project, but I'm pretty stuck on declaring the source sets. I also found this post on StackOverflow, but I think I'm a bit further already. My project structure is project |_ src |_ main | |_ kotlin | |_ resources |_ testIntegration | |_ kotlin | |_ resources |_ test | |_ kotlin | |_ resources |_ build.gradle.kts |_ ... other files And build.gradle.kts import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins {

Integration tests with spring security

做~自己de王妃 提交于 2019-11-29 11:08:09
问题 I need to send a get request to the API, but despite having placed the administrator annotation get error @WithMockUser(roles="ADMINISTRADOR") . How do I send a request? API @RequestMapping(value = "/{id}", method = RequestMethod.GET) @PostAuthorize("returnObject.instancia == principal.instancia.instancia") public Validacao retrieve(@PathVariable("id") String id) { return validacaoService.retrieve(id); } Test @Test @WithMockUser(roles = "ADMINISTRADOR") public void testCRetrieve() throws

Spring: unit and integration tests

南笙酒味 提交于 2019-11-29 09:24:42
问题 I'm looking for best practices for setting up unit and integration tests using Spring. I usually use 3 kind of tests: "real" unit tests (no dependencies) tests run either as "unit" test (in-memory db, local calls, mock objects,...) or as integration test (persistent db, remote calls,...) tests run only as integration tests Currently I only have tests of the second category, which is the tricky part. I set-up a base test class like: @ContextConfiguration(locations = { "/my_spring_test.xml" })