It is important that we test our custom SQL for specific vendor vendors.
So you must create a test suite for each vendor database.
@RunWith(Suite.class)
@Suite.SuiteClasses({})
public class SQLServerTestSuite {
@BeforeClass
public static void setUpClass() throws Exception {
}
@AfterClass
public static void tearDownClass() throws Exception {
}
}
Should one database be allocated for all running tests, but without commits?
It is recommended that you execute SQL commands , but with a rollback command , because when using commit, you can change the state of the current test, as well as change the state of other tests. Otherwise, you may be dealing with unexpected behavior.
sandbox. , , , .
?
public class PersonTest {
@Before
public void setUp() {
}
@After
public void teardown() {
}
}
, , , ,
DBUnit ?
DBUnit XML ,
. , DBUnit . , , . , .
Spring?
Spring (SqlParameterSource), plain jdbc XML ,
<?xml version="1.0" encoding="UTF-8"?>
<queries>
<query name="PERSON_BY_ID">
<![CDATA[
select
*
from
PERSON
where
PERSON.ID = :integerId
]]>
</query>
</queries>
. JavaScript-, . ,
public class SQLServerQuery {
public static final String PERSON_BY_ID = "PERSON_BY_ID";
}
, < < =. , , , , . , .