Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Supporting code for the tutorials onhttps://www.baeldung.com/scala

License

NotificationsYou must be signed in to change notification settings

Baeldung/scala-tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala Steward badge

scala-tutorials

This is the main repo for all the sample code used in the scala tutorials.

Pre-requisites

Suggested JDK version : JDK 17

Compiling and Running Tests

This repo uses a multi-module build with many sub modules.To compile the entire module, you may use the commandsbt compile. However, this loads all the modules and compiles all of them, which might take some time.If you are interested in only a particular module, you can compile it by starting sbt shell and using the command<sub-module-name>/compile.Similarly, you can run the tests per module as<module-name>/test.

Here are some of the useful commands that can be used within tbe sbt shell

SBT CommandDescriptionExample
project <sub-module-name>Switch to a particular module. After this, the commandcompile,test etc runs only on that moduleproject scala_core
<sub-module-name>/compileCompile only the provided modulescala_core/compile
projectsLists all the sub modules
<sub-module-name>/runRun the main class within the sub-modulescala_core/run

Note: The project name may not be same as directory name. Instead, it is thelay val variable used to define each module

Test Naming Standards

In this repository, we have classified the tests in 4 categories.

CategoryDescription
Unit TestsSmallest unit of testing, that are not dependent on external tools or services
Integration TestsIntegrationTests means those tests that use some automatic setup within our environment like in-memory Mongo, h2 database etc which don't need explicit setup
Live TestsTests that depends on some external services (like httpbin.org, or some internet-based links) or require a running component (eg: starting a Spring Boot application)
Manual TestsThe tests where we need to set up an environment explicitly(for e.g. docker), without which the tests can't be run

Here is a table describing about the different categories of tests and how they can be executed in this project.Note that these commands are defined at the root level of the project and hence are accessible only from the root project(not directly within each submodule).

CategorySbt commandTest class locationTest class name format
Unit Testssbt cisrc/test/scala orsrc/test/scala-2No particular format restriction, but as a standard, filename ends withTest
Integration Test (Only)sbt integrationTestssrc/it/scala orsrc/it/scala-2No format restriction, but as a standard, filename ends withIntegrationTest
Unit & Integration Testsbt ciFullsrc/it/scala orsrc/it/scala-2No format restriction, but as a standard, filename ends withIntegrationTest. These exclude manual and live tests
Live Testsbt liveTestssrc/it/scala orsrc/it/scala-2Test class name must end withLiveTest
Manual Testsbt manualTestssrc/it/scala orsrc/it/scala-2Test class name must end withManualTest

Code formatting

Before creating a PR, runsbt scalafmtAll to automatically format the entire codebase. To check if there are any formatting issues(without fixing them), you may runsbt scalafmtCheckAll

Contributors91


[8]ページ先頭

©2009-2025 Movatter.jp