Domain and business logic, services for sending emails and generating PDFs
SpringBatch configuration (Jobs/Steps/Reader/Writers/Processors/Listeners definitions). More info here
Api of all services that are needed in the presentation layer so that we can easily switch to another Batch implementation if needed.
InfrastructureConfig, PersistenceConfig and PropertyPlaceHolderConfig
Shows the employee table and allows the job to be run. Contains the AngularJs files and rest controllers (for retrieving employees/starting job).
Simulates the TaxPayment external service.
Install the following:
Java 8, Maven 3, Tomcat 7
NodeJS v0.10+ (tested on v0.10.28)
Install Karma, Jasmine and browser launchers by running the following commands:
npm install -g karma-ng-scenario karma-junit-reporter
npm install karma-chrome-launcher --save-dev
npm install karma-firefox-launcher --save-dev
npm install -g karma-jasmine
npm install karma-jasmine --save-dev
Set CHROME_BIN and FIREFOX_BIN as environment variables, pointing to the executables themselves.
Import the maven projects in IntelliJ/Eclipse and run:
mvn clean install
- Define JNDI resources in tomcat/conf/context.xml under
<Context>
root like this:
<Context>
<Environment name="smtp_server" value="your_smtp_server" type="java.lang.String" />
<Environment name="smtp_port" value="your_port" type="java.lang.String" />
<Environment name="smtp_username" value="your_username" type="java.lang.String" />
<Environment name="smtp_password" value="your_password" type="java.lang.String" />
</Context>
- Create one Run/Debug configuration for stubwebservice-war exploded on port 9091, context path: /stubwebservice. Or, use cd taxcalculator-stubwebservice && mvn jetty:run
- Create one Run/Debug configuration for presentation-war exploded (different port, preferably 9090), context path: /taxcalculator. Or, (does not pre-populate database with employees) : cd taxcalculator-presentation && mvn tomcat7:run
- Start both servers and connect to http://localhost:9090/taxcalculator/
There are two system properties that need to be set:
APP_ENV - either "default" (this is the default setting, using in-memory HSQLDB) or "staging" (using MySQL) (for staging you need to add in "/etc/hosts" on GNU/Linux operating systems or in "C:\Windows\System32\drivers\etc\hosts" a entry named batchersmaster that points to the IP of the MySQL database)
log_dir - having "target/logs" as default
You can set these at tomcat startup: -DAPP_ENV=... -Dlog_dir=...
It can be configured to timeout and/or fail for specific employees: taxcalculator-stubwebservice.properties
stubwebservice.blacklistemployees - employee ids for which the server responds with a 500 internal server error, and how many times
stubwebservice.timeoutemployees - employee ids for which the server times out