integration-testing

Testing: How to test that view contains desired data

纵然是瞬间 提交于 2019-12-03 16:37:14
Say a Chef can make Recipes, and Sous-Chefs can create Recipes that must be approved by a Head Chef. You want to test that, when a Head Chef views her homepage, she sees Recipes that she herself created. You also want to test that she sees there are Recipes awaiting her approval. I can think of two ways to do this: Test that the view contains certain words, like "Your recipes" and "Recipes awaiting your approval" Add unnecessary attributes to the html elements you're using so that you can check for an element with "id=recipe_1" or "data-for-the-sake-of-testing=1" I very much dislike both of

Has anyone used Steve Sanderson’s MvcIntegrationTestFramework?

天大地大妈咪最大 提交于 2019-12-03 16:29:40
问题 I was looking into additional ways to test ASP.NET MVC applications and ran into Steve Sanderson’s MvcIntegrationTestFramework. The approach looks rather promising but I was wondering if anyone had any actual experience to share. 回答1: I'm having some really good results from it. I don't care what anyone else on here says about the need to test views, as soon as you add your first line of code to a view, even if the code is strictly presentation-related, you introduce a potential for errors

Problem with Nhibernate.Bytecode.Castle in MSBuild (TFS)

ぃ、小莉子 提交于 2019-12-03 16:15:29
We have a Fluent NHibernate mapping test that is passing on our local machines, but when we check in to TFS, the tests are failing on the build server. We are using MSTest. The error we get is: NHibernate.Bytecode.UnableToLoadProxyFactoryFactoryException: Unable to load type 'NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle' during configuration of proxy factory class. Possible causes are: - The NHibernate.Bytecode provider assembly was not deployed. - The typeName used to initialize the 'proxyfactory.factory_class' property of the session-factory section is not well

Integration Test Coverage in SonarQube from JaCoCo Maven plug-in showing 0%

旧巷老猫 提交于 2019-12-03 16:13:09
问题 We have a multi-module multi-language maven java project with coverage analysis with jacoco. The main part of the modules is backend (Java code) with a REST API and our webapp module contains the frontend (AngularJS) and the Integration-Tests in java. Our Jacoco-IT.exec file contains around 100Kb of data so we guess some Coverage data for the Integration tests could get collected. Nevertheless we cant see any coverage in SonarQube (using Version 5.0 and 4.5) We run build the Project and run

Supermarket dataset for Apriori algorithm

守給你的承諾、 提交于 2019-12-03 15:36:52
'I have to develop a software which is meant for Business Analyst of “Future Stores” Supermarket, the software performs the Association Rule Mining on given transitional data of supermarket sales transactions and prepares Discounting policy by preparing Combo. The software makes use of the data mining algorithms namely Apriori Algorithm. The Association Rules will be displayed in User friendly manner for generation of discounting policy based on positive association rules.' From where can I get the supermarket dataset to check the Apriori algorithm which i have coded? To get a market dataset,

Integration test per layer is a good practice?

纵饮孤独 提交于 2019-12-03 12:48:44
I have an application that use spring-mvc, basically we have a presentation layer (controllers), service layer (business units, helpers), integration layer and data access layer(jdbc/jpa repositories), we want to ensure using testing that future addition to the code won't break nothing that was previously working, to do this we are using unit testing(mockito) and integration testing (spring-test,spring-test-mvc). Unit testing is made per class/component, basically we tried to have a good coverage for the incoming inputs and possible flows within these components and this action is working fine

Why is [AssemblyInitialize] and [AssemblyCleanup] being called twice in same test project assembly?

大憨熊 提交于 2019-12-03 12:34:14
I thought the whole purpose of these attributes was to run them only once per assembly. I have a simple class as follows: [TestClass] public class AssemblyIntegrationTestSetup { public AssemblyIntegrationTestSetup() { } public TestContext TestContext { get; set; } [AssemblyInitialize] public static void SetupIntegrationTests(TestContext context) { WindowsServiceService.Instance.StartService("Distributed Transaction Coordinator"); } [AssemblyCleanup] public static void TeardownIntegrationTests() { WindowsServiceService.Instance.StopService("Distributed Transaction Coordinator"); } } However

Access ScalaTest test name from inside test?

依然范特西╮ 提交于 2019-12-03 12:30:37
Is it possible to access the name of the currently executing test, from within a ScalaTest test? (And how would I do it?) Background: I'm testing that my Data Access Object eventually throws an OverQuotaException if a user e.g. creates too many pages. These tests take rather long to run. To feel happier, I'd like to print the progress to stdout — and since there are quite many tests, I'd like to include the test name in the output, so I know what test is currently being run. (I didn't find any seemingly relevant function here: http://www.artima.com/docs-scalatest-2.0.M5/#org.scalatest.FreeSpec

Spring MockMVC inject mockHttpServletRequest when not in method signature

馋奶兔 提交于 2019-12-03 11:40:30
Given I have inherited some Spring MVC controller code with signature @RequestMapping(value = "/upload", method = RequestMethod.POST) public ModelAndView upload(HttpServletRequest request, HttpServletResponse response) { String remoteAddress = request.getRemotedAddr(); auditService.logAddress(remoteAddress); // do work... return mav; } and I have a Spring MockMvc test that performs the test public void someTest() { mockMvc().perform(fileUpload("/upload").file(FileFactory.stringContent("myFile"))); // do work... verify(auditService.logAddress("123456")); } I need to set the remote address to

Testing Snackbar show with Espresso

℡╲_俬逩灬. 提交于 2019-12-03 11:33:27
问题 Is there a way to test using Espresso that the snackbar shows up with the right text? I have a simple call to create a snackbar Snackbar.make(mView, "My text", Snackbar.LENGTH_LONG).show(); I have tried this without luck onView(withText("My text")).inRoot(withDecorView(not(is(mActivityRule.getActivity().getWindow().getDecorView())))).check(matches(isDisplayed())); 回答1: This worked for me, please try. onView(allOf(withId(android.support.design.R.id.snackbar_text), withText("My text"))) .check