-
Notifications
You must be signed in to change notification settings - Fork 7
Unit Testing with MS SQL Server (based on TG Air project)
- Add user-specific testing profile in
ttgams-dao/pom.xml
-- e.g.
<profile>
<id>sqlServer-User1</id>
<properties>
<databaseUri.prefix>//localhost:1433;database=TG_AIR_TEST_DB_</databaseUri.prefix>
<fork.count>3</fork.count>
</properties>
</profile>
-
Create database
login
instance named junit as per expectations inttgams-dao/src/main/java/fielden/test_config/SqlServerDomainDrivenTestCaseRunner.java
-
Create required number of empty database instances according to naming pattern in added profile (i.e. TG_AIR_TEST_DB_1, TG_AIR_TEST_DB_2, TG_AIR_TEST_DB_3)
-
Create database
user
from junitlogin
instance in each database (i.e. TG_AIR_TEST_DB_1, TG_AIR_TEST_DB_2, TG_AIR_TEST_DB_3). Add database roledb_owner
for read / write access.
sqlcmd -U sa -d TG_AIR_TEST_DB_1 -I -Q "CREATE USER junit FOR LOGIN junit"
sqlcmd -U sa -d TG_AIR_TEST_DB_1 -I -Q "EXEC sp_addrolemember 'db_owner', 'junit'"
-
Execute script to create the required SP
sp_generate_inserts
(fromttgams-dao/src/main/resources/sql/sp_generate_inserts.sql
) -
Execute tests with
MsSql
driven testing profile --mvn clean compile test -PsqlServer-User1
(usemvn clean test -PsqlServer-User1 -DfailIfNoTests=false -Dtest=fielden.analysis.reliability.ReReliabilityTest
to run single test.)
Per aspera ad astra
- Web UI Design and Web API
- Safe Communication and User Authentication
- Gitworkflow
- JavaScript: Testing with Maven
- Java Application Profiling
-
TG Development Guidelines
- TLS and HAProxy for development
- TG Development Checklist
- Entities and their validation
- Entity Properties
- Entity Type Enhancement
- EQL
- Tooltip How To
- All about Matchers
- Streaming data
- Synthetic entities
- Activatable entities
- Jasper Reports
- Opening Compound Master from another Compound Master
- Window management test plan
- Multi Time Zone Environment
- GraphQL Web API
- Guice
- Maven
- Full Text Search
- Deployment recipes
- Application Configuration
- JRebel Installation and Integration
- Compile-time mechanisms