RADAR-base/RADAR-RestApi

Name: RADAR-RestApi

Owner: RADAR-CNS

Owner: RADAR-CNS

Description: RESTful interface to access near real-time data

Created: 2016-10-18 19:09:34.0

Updated: 2017-10-03 19:46:57.0

Pushed: 2018-02-05 14:50:24.0

Homepage:

Size: 78739

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

RADAR-CNS REST-API

Build Status Codacy Badge Codacy Badge

A REST-FULL Service using Tomcat 8.0.37, MongoDb 3.2.10, Swagger 2.0, Apache Avro 1.7.7 and Jersey 2.

Thi project implents the downstream REST API for the RADAR-CNS project'

Setup

This project uses git submodule. When cloning, please use the command git clone --recursive. For already cloned repos, use git submodule update --init --recursive to update modules.

To deploy the war do:

By default, log messages are redirected to the STDOUT.

The api documentation is located at <your-server-address>:<port>/radar/api/swagger.json

Dev Environment

Click here to see documentation of dev deploy instance.

Click here to see some mock data.

Clients

Swagger provides a tool to automatically generate a client in several programming language.

Integration test

Useful for testing the integration between RADAR-CNS Hotstorage and RADAR-CNS Rest API. Before running the test, add 127.0.0.1 hotstorage to the hosts file. To run the test:

gradlew integrationTest
End to end test

This project contains an end to end test for the RADAR-CNS platform covering:

Infrastructure settings are located at src/endToEndTest/resources/pipeline.yml. Test case settings are located at src/endToEndTest/resources/pipeline.yml. Each test case is specified as:

pic: android_empatica_e4_acceleration
nsor: ACCELEROMETER
equency: 32.0
le: accelerometer.csv
y_schema: org.radarcns.key.MeasurementKey
lue_schema: org.radarcns.empatica.EmpaticaE4Acceleration
lue_fields: [x, y, z]
nimum: -2.0
ximum: 2.0
ximum_difference: 1e-10

The test will generate random data between minimum and maximum, and stream it to the landing topic specified by topic having for key key_schema and for value value_schema. Data for the sensor type sensor are randomly generated according to the frequency: number of messages generated per second. value_fields is the variables list which will be tested against the RESTfull service. Since we are comparing doubles, magnitude represents the maximum delta between expected and actual values for which both numbers are still considered equal.

To run the test:

adlew endToEndTest
Contributing

Code should be formatted using the Google Java Code Style Guide. If you want to contribute a feature or fix, please make a pull request.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.