Best way to reset a database to a known state between FlexUnit4 integration tests?

Background:

I have a Flex web application that communicates with a Java server through BlazeDS. The Flex client consists of a flex-client module that contains models of presentations and presentations and a separate flexible services module that contains models (value objects) and service objects.

I am writing asynchronous integration tests for the RemoteObjects Flex service module using FlexUnit4. In some tests, I modify the test data and request it to see if everything works (the method shown here: http://saturnboy.com/2010/02/async-testing-with-flexunit4 )

Question:

How can I put the database in a known state before each FlexUnit4 test method (or chain of test methods)? In my integration tests with the Java server, I did this using a combination of DBUnit and Spring test transactions that roll back after each testing method. But these Flexunit integrations span multiple queries and, therefore, multiple transactions.

With the exception of implementing the backend integration test service API, how can this be done. Have others come across this too? Similar questions were asked earlier ( Rollback the database after integration tests (Selenium) , but without satisfactory answers.

+3
source share
3

:

  • : , , , -1 . < 0. , .

    , timestamp created, . .

  • , (H2, ). API- , reset .

  • -. , .

  • , , Lotus Notes.

  • . -, . , , , .

    , . , .

    , .

  • " ", , . , , . , .

+5

/, , .

( ), .

+1

( ). , "API- ", .

, flexUnit "-", , , . : 1) - . 2) , ( ) " " " " ( db).

, , - , unit-test: unit test -, / /locale, [...] args. startTransaction. , false FE ( beginTransaction commitTransaction), , "response" unit test. db-rollback, unit test.

. , , , schtuff.

, . , . , --jeremy

0
source

Source: https://habr.com/ru/post/1771182/


All Articles