Application that identifies the pair of employees who have worked together on common projects for the longest period of time.
- Clone the repository.
git clone https://github.com/vasilev02/Valentin-Vasilev-employees
- Run this command which will produce two jar files(artifacts). The name of the jars depends on the build configuration in the pom file, artifactId and name of project.
mvn assembly:single
- Go to target directory and to start the jar either use this command in terminal or if you navigate to the absolute path you can double click it and it will start.
java -jar employees-1.0-SNAPSHOT-jar-with-dependencies.jar
- Upload CSV file and see the result.
The user picks up a file from the file system and, after selecting it, all common projects of the pair who have worked together on common projects for the longest period of time are displayed in a brief information with datagrid. We support different Date formats. The calculation is being computed in days.
UI is simple structure from Java Swing API. It contains button for uploading csv files which listens all the time for interact with files. After we upload file
we will see information about longest working pair in two containers. First container inludes all common projects of the pair are displayed in datagrid with the following
columns: Employee ID #1, Employee ID #2, Project ID, Days worked
. Second is text area with infomration about the employees id, total count projects, respectively
total days count calculated in days. There is a info also about the weeks, months and years if there are employees working for a very long time. The last one shows
every project with it's id and worked days related to it.
For this part we have simple error handling coded. If you try to upload CSV file which is empty, with invalid dates or invalid structure like row without employee key or without either start date or end date it will throw exception with the related message.
Comprehensive unit tests using a framework Junit to ensure code correctness and reliability.