Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIOT-GDA-01-001: Set up your GDA dev environment using the java-components repository #40

Open
labbenchstudios opened this issue Aug 25, 2020 · 1 comment
Labels
build Build / DevOps specific requirement
Milestone

Comments

@labbenchstudios
Copy link
Contributor

labbenchstudios commented Aug 25, 2020

Description

  • Set up your GDA dev environment using either the java-components repository (this one) or your related GitHub Classroom repository.
    • NOTE: The downloaded code repository will include many different module shells, which you can use as is, or you can create your own.

NOTE: If you're a student of Connected Devices, we may be using GitHub Classroom; however, be sure to double check during our first class session, as we may simply use the guidelines in Chapter 1 of Programming the Internet of Things.

Review the README

  • Please see README.md for further information on, and use of, this content.
  • License for embedded documentation and source codes: PIOT-DOC-LIC

Estimated effort may vary greatly

  • The estimated level of effort for this exercise shown in the 'Estimate' section below is a very rough approximation. The actual level of effort may vary greatly depending on your development and test environment, experience with the requisite technologies, and many other factors.

Actions

  • Read through the Preface and Chapter 1 of Programming the Internet of Things.
  • If you're a student of Connected Devices, use the instructions provided for importing 'java-components'.
  • If you're reading the book and want to manually import, use the following link to import 'java-components': https://github.com/programming-the-iot/java-components.git
  • Verify all sample code, unit / integration tests, and folder structure is the same as the online repo.
  • Create and checkout a new branch named 'labmodule01'
    • git checkout -b labmodule01
  • Run all tests in the next section and ensure they work correctly. Add new tests as appropriate.
  • Review / verify any code updates within the new branch.
  • Perform a git merge between labmodule01 and the default branch, then push the merged work to your remote.

Estimate

  • Small

Tests

IMPORTANT NOTE on GDA TESTING

  • Unit tests and integration tests that do NOT involve running the GDA app:

    • In general, the easiest way to run unit tests (and some integration tests that do NOT require running the GDA app directly) is to simply right click on the Java test class within your IDE and select the option to execute it as a unit test.
    • If you prefer to run GDA unit tests from the command line, please see the JUnit documentation for details.
  • Application tests (running the GDA app):

    • In general, the easiest way to run the GDA instance (as an application) is to run it directly from the command line as a Java app after running a Maven build. If the build succeeds, you'll have an executable jar file that can be run within the root directory path as the GDA project. Be sure to setup the configuration file PdtConfig.props and your operating environment according to the integration test instructions.
      • Build example: mvn install -DskipTests
        • NOTE: You may need to run a clean build as well
      • Run example: java -jar target/gateway-device-app-0.0.1-jar-with-dependencies.jar

TESTS

  • Run git branch. You'll see the following branches listed:
    • primary
    • labmodule01
  • Unit tests (in ./src/test/java/programmingtheiot/part01/unit)
    • Run ./common/ConfigUtilTest. All unit tests should pass.
  • Integration tests (in ./src/test/java/programmingtheiot/part01/integration)
    • Run ./app/GatewayDeviceAppTest. Integration test should pass and generate output similar to the following:
Sep 05, 2020 5:48:10 PM programmingtheiot.gda.app.GatewayDeviceApp <init>
INFO: Initializing GDA...
Sep 05, 2020 5:48:10 PM programmingtheiot.gda.app.GatewayDeviceApp parseArgs
INFO: No command line args to parse.
Sep 05, 2020 5:48:10 PM programmingtheiot.gda.app.GatewayDeviceApp initConfig
INFO: Attempting to load configuration: Default.
Sep 05, 2020 5:48:10 PM programmingtheiot.gda.app.GatewayDeviceApp startApp
INFO: Starting GDA...
Sep 05, 2020 5:48:10 PM programmingtheiot.gda.app.GatewayDeviceApp startApp
INFO: GDA started successfully.
Sep 05, 2020 5:49:15 PM programmingtheiot.gda.app.GatewayDeviceApp stopApp
INFO: Stopping GDA...
Sep 05, 2020 5:49:15 PM programmingtheiot.gda.app.GatewayDeviceApp stopApp
INFO: GDA stopped successfully with exit code 0.
@labbenchstudios labbenchstudios transferred this issue from programming-the-iot/java-components Sep 7, 2020
@labbenchstudios labbenchstudios added the build Build / DevOps specific requirement label Sep 7, 2020
@labbenchstudios labbenchstudios added this to the Chapter 01 milestone Sep 7, 2020
@labbenchstudios labbenchstudios changed the title PIOT-GDA-01-001: Clone the java-components repository PIOT-GDA-01-001: Set up your GDA dev environment using the java-components repository Sep 7, 2020
@YahuiLiu007
Copy link

Hi Professor,

For the second and third bullets of Action, I think they are "java-components".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build / DevOps specific requirement
Projects
Status: Lab Module 01 - Applications
Development

No branches or pull requests

2 participants