Skip to content

Latest commit

 

History

History
271 lines (174 loc) · 8.18 KB

GETTING_STARTED.md

File metadata and controls

271 lines (174 loc) · 8.18 KB

Getting Started with Slow Code kata in Java

Prerequisites

  • macOS, Linux or Windows

  • git client

  • curl command line utility

  • Java JDK-17

    Details

    The source code of this project is compatible with Java 17 and above. Remember to update the java version in the kata's pom.xml and/or build.gradle if you're planning to use a different version.

Getting ready

1 - Clone the kata repository

git clone https://github.com/philou/Kata-Slow-Code.git

2 - Go to the kata's java directory

cd Kata-Slow-Code/java

Running the kata

You can run the kata from the command line or from your IDE of choice.

You may also run it using TCR if you want to add a bit of spice.

Running the kata from a terminal with Gradle

Reminder: the command below should be run from Kata-Slow-Code/java directory

The kata comes with Gradle wrapper pre-installed. Just type the following to run it.

./gradlew clean test

Running the kata from a terminal with Maven

Reminder: the command below should be run from Kata-Slow-Code/java directory

The kata comes with Maven wrapper pre-installed. Just type the following to run it.

./mvnw clean test

Running the kata from a terminal with TCR

Note to Windows users

Use a git bash terminal for running the command below. Windows CMD and PowerShell are not supported

Type the following to start TCR:

./tcrw

Refer to Using TCR section for additional details about TCR and available options.

Running the kata from IntelliJ IDEA

Open Intellij IDEA and select:

File > Open > Kata-Slow-Code > java

After loading the project into IntelliJ, you can build the project using either the Maven or Gradle built-in build tools.

Run all the tests in the FizzBuzzTest class.

The "Run" tool window should display all the executed tests.

Running the kata from IntelliJ IDEA with TCR

TCR is provided as a command line utility running in a terminal. You can run it from IntelliJ IDEA directly, through leveraging on its built-in terminal.

1. Open the kata

Open Intellij IDEA and select:

File > Open > Kata-Slow-Code > java

2. Turn off auto-save

TCR is constantly watching the filesystem for changes. For this reason you need to turn off Intellij IDEA's auto-save in order for it to behave as expected.

File > Settings > Appearance & Behavior > System Settings

Under Autosave section, uncheck the 2 following options:

  • Save files if the IDE is idle for ___ seconds
  • Save files when switching to a different application or a built-in terminal

3. Configure the built-in terminal to run git bash

Windows Only

Skip this step if you're on macOS or Linux

Intellij IDEA for Windows is usually set up to run PowerShell by default in its built-in terminal. TCR does not run in PowerShell.

File > Settings > Tools > Terminal

Under Application Settings section, set the Shell path to C:\Program Files\Git\bin\bash.exe

The above path is for a default git installation location. You may need to adjust it in case you have installed git at a different location.

4. Open a built-in terminal

View > Tool Windows > Terminal

5. Launch TCR

Reminder: the command below should be run from Kata-Slow-Code/java directory

From the built-in terminal:

./tcrw

Refer to Using TCR section for additional details about TCR and available options.

Running the kata from Visual Studio Code

Open Visual Studio Code and select:

File > Open Folder > Kata-Slow-Code > java

After loading the project into Visual Studio Code, you can build the project using either the Maven or Gradle built-in build tools.

Run all the tests in the FizzBuzzTest class.

Open the Testing tab to view all the executed tests.

Running the kata from Visual Studio Code with TCR

1. Open the kata

Open Visual Studio Code and select:

File > Open Folder > Kata-Slow-Code > java

2. Turn off auto-save

TCR is constantly watching the filesystem for changes. For this reason you need to turn off the IDE's auto-save in order for it to behave as expected.

File > Preferences > Settings > Text Editor > Files

Ensure that Auto Save is set to off

3. Open a Git Bash terminal

Select View > Terminal or Terminal > New Terminal

If the opened terminal is not a "Git Bash" terminal, use the drop-down list next to the "+" button to open a new "Git Bash" terminal.

4. Launch TCR

Reminder: the command below should be run from Kata-Slow-Code/java directory

From the built-in terminal:

./tcrw

Refer to Using TCR section for additional details about TCR and available options.

Running the kata from Eclipse

Open the kata in Eclipse:

File > Open Projects from File System... > Kata-Slow-Code

After loading the project into Eclipse, you can build the project using either the Maven or Gradle built-in build tools.

Run all the tests in the FizzBuzzTest class.

Navigate to the test class then:

Right click > Run As > JUnit Test or Alt+Shift+X,T

A JUnit tab should be opened that displays all the executed tests.

Running the kata from Eclipse with TCR

1. Open the kata

Open the kata in Eclipse:

File > Open Projects from File System... > Kata-Slow-Code

2. Open a Git Bash terminal

Select Window > Show View > Terminal

A new Terminal window should be opened.

To start a git bash terminal:

  1. Click on the Open Terminal button or use the shortcut (Ctrl+Alt+Shift+T).
  2. From the opened pop-up window select Git Bash then OK
  3. From the terminal navigate to Kata-Slow-Code/java directory

3. Launch TCR

Reminder: the command below should be run from Kata-Slow-Code/java directory

From the built-in terminal:

./tcrw

Refer to Using TCR section for additional details about TCR and available options.

Using TCR

Cheat Sheet

Here are the main shortcuts available once TCR utility is running:

Shortcut Description
? List available options
d / D Enter driver role (from main menu)
n / N Enter navigator role (from main menu)
q / Q Quit current role - Quit TCR (from main menu)
t / T Query timer status (from driver role only)
p / P Toggle on/off git auto-push (from main menu)

Additional Details

Refer to TCR - Test && Commit || Revert page for additional details and explanations about TCR utility.