Coder Social home page Coder Social logo

solution's Introduction

Processing Huge Transactions CSV challenges

  • csv/transactions.csv is small set data of given transactions.zip for running test cases
  • please run intellij test with coverage and mvn clean surefire-report:report and then replacing the real transactions.csv
  • we build fat jar file (application) without test for avoiding failing test cases

Tech Stacks

  • java 8
  • maven 3
  • intellij

Sub libraries

  • picocli for command line parsing
  • okhttp for fetch exchange rate API
  • fastjson alibaba for processing JSON return from API
  • junit 5 for boundary test context

Setup for MacOS

Java 8

    brew tap adoptopenjdk/openjdk
    brew install --cask adoptopenjdk8

alt text

Maven 3.8.6

    brew install maven

alt text

Build fat jar file

    mvn clean install -DskipTests

Move fat jar file to root folder/directory

    mv target/solution-1.0.0.jar .
    

Run jar file with arguments - default CSV file path at ./csv/transactions.csv

We do not have option for changing CSV file path in our challenge

    
    # no argument
    java -jar solution-1.0.0.jar 

    # given token
    java -jar solution-1.0.0.jar -t BTC
    
    # given date
    java -jar solution-1.0.0.jar -d 2019-10-25
    
    # given token & date
    java -jar solution-1.0.0.jar -t BTC -d 2019-10-25
    
    # with testing exchange rate
    # BTC USD is 30_000
    # ETH USD is 1_000
    # XRP USD is 0.3
    java -jar solution-1.0.0.jar -test 
    

Run test cases by Intellij

  • Right click on src/test/java -> More Run/Debug -> Run 'All Tests' with Coverage

alt text

Run test by Commandline

    mvn clean test
    
    mvn clean surefire-report:report
  • Please refer ./docs/surefire-report.html

alt text

Final Result

alt text

solution's People

Contributors

lamlephamngoc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.