Skip to content

emmo78/parkingsystem

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Parking System

A command line app for managing the parking system. This app uses Java to run and stores the data in Mysql DB.

Before All

The login and password to connect database are no longer hardcoded. This to avoid anyone with access to either the source code or the compiled code easily learn the password. After installing and run the sql commands go to the folder that contains the pom.xml file and execute the below command :

$ mvn package

$ java -jar ./target/parking-system-1.0-SNAPSHOT-jar-with-dependencies.jar setDBConfig

Then chose 1 to enter the login and password and save them to db.properties file. This file name is in .gitignore

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

  • Java 1.8
  • Maven 3.6.2
  • Mysql 8.0.17

Installing

A step by step series of examples that tell you how to get a development env running:

1.Install Java:

https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html

2.Install Maven:

https://maven.apache.org/install.html

3.Install MySql:

https://dev.mysql.com/downloads/mysql/

After downloading the mysql 8 installer and installing it, you will be asked to configure the password for the default root account. This code uses the default root account to connect and the password can be set as rootroot. If you add another user/credentials make sure to change the same in the code base.

Running App

Post installation of MySQL, Java and Maven, you will have to set up the tables and data in the data base. For this, please run the sql commands present in the Data.sql file under the resources folder in the code base.

Finally, you will be ready to import the code into an IDE of your choice and run the App.java to launch the application.

Testing

The app has unit tests and integration tests written. More of these need to be added and in some places that can be seen mentioend as TODO comments. The existing tests need to be triggered from maven-surefire plugin while we try to generate the final executable jar file.

To run the tests from maven, go to the folder that contains the pom.xml file and execute the below command.

mvn test

mvn arguments

  • $ mvn clean → clean ./target
  • $ mvn test → run UT
  • $ mvn package → build .jar + Jacoco report in ./target/site/jacoco/index.html
  • $ mvn site → put project reports in ./target/site/index.html ( SpotBugs and JavaDocs )
  • $ mvn surefire-report:report → surefire report in ./target/site/ surefire-report

About

Project 4 Validé, Parking System App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 99.1%
  • Gherkin 0.9%