-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the dhis2-android-sdk wiki!
Program rule functions already implemented:
Ceil: Rounds the input argument up to the nearest whole number.
DaysBetween: Produces the number of days between the first and second argument. If the second argument date is before the first argument the return value will be the negative number of days between the two dates. The static date format is 'yyyy-MM-dd'.
Floor: Rounds the input argument down to the nearest whole number.
HasValue: Evaluates to true of the argument source field contains a value, false if no value is entered.
WeeksBetween: Produces the number of full weeks between two data elements/attributes of type date. The static date format is 'yyyy-MM-dd'.
Not implemented at the moment of the creation of this wiki: addDays, condition, zpvc, addControlDigits, checkControlDigits, concatenate, count, countIfValue, countIfZeroPos, lastEventDate, left, length, modulus, monthsBetween, oizp, right, round, split, substring, validatePattern, yearsBetween, zing.
Steps:
Add a .gitmodules file with the follow content:
[submodule "sdk"]
path = sdk
url = https://github.com/EyeSeeTea/dhis2-android-sdk
branch = development
then run: git submodule update
This should clone the repository in a "sdk" folder in the root path of your project.
Add in your settings.gradle the follow lines:
include ':app', ':core'
project(':core').projectDir = new File(settingsDir, 'sdk/core')
And add in app/build.gradle:
dependencies { compile project(':core') }
How run the test:
For run the instrumental tests is necessary a real android device, or a android emulator connected.
For the unitary tests only is necessary click right button and click on run test.
The instrumental tests are placed in the folder androidTest, and the unitary test in the folder test.
To run the tests:
You can select Whole project in android studio ide to run all the tests. Or select a specify test, class, package, or module, clicking with the right button of the mouse and selecting "run test".
For the instrumental test you need open a virtual machine. (Click on tool, android, and open AVD manager, to configure and launch a android emulator).
Some used these test libraries:
Mockserver:
Moquito:
The sdk is developed using the Test-Driven Development methodology.
The team is following a standard naming test methods and classes.
The most important points are:
The class and test name should be read as a full sentence.
The class should express what the class should be able to do.
And the test should start with a verb.
You can read more about this standards reading the article codurance article.
The internal structure of the test is simple and have three blocks: Given, When, Then.
The sdk is developed using the Test-Driven Development methodology.