Search in sources :

Example 36 with ScaleMeasurement

use of com.health.openscale.core.datatypes.ScaleMeasurement in project openScale by oliexdev.

the class CsvHelperTest method oldVersion16SingleEntry.

@Test
public void oldVersion16SingleEntry() throws Exception {
    final String data = "01.03.2018 12:45,8.0,2.0,7.0,5.0,4.0,1.0,6.0,3.0,some text\n";
    List<ScaleMeasurement> list = CsvHelper.importFrom(new BufferedReader(new StringReader(data)));
    assertEquals(1, list.size());
    validateEntry(list.get(0), 4);
}
Also used : ScaleMeasurement(com.health.openscale.core.datatypes.ScaleMeasurement) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 37 with ScaleMeasurement

use of com.health.openscale.core.datatypes.ScaleMeasurement in project openScale by oliexdev.

the class CsvHelperTest method oldVersion13SingleEntry.

@Test
public void oldVersion13SingleEntry() throws Exception {
    final String data = "01.03.2018 12:45,8.0,2.0,7.0,5.0,6.0,3.0,some text\n";
    List<ScaleMeasurement> list = CsvHelper.importFrom(new BufferedReader(new StringReader(data)));
    assertEquals(1, list.size());
    validateEntry(list.get(0), 2);
}
Also used : ScaleMeasurement(com.health.openscale.core.datatypes.ScaleMeasurement) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 38 with ScaleMeasurement

use of com.health.openscale.core.datatypes.ScaleMeasurement in project openScale by oliexdev.

the class CsvHelperTest method oldVersion155SingleEntry.

@Test
public void oldVersion155SingleEntry() throws Exception {
    final String data = "01.03.2018 12:45,8.0,2.0,7.0,5.0,1.0,6.0,3.0,some text\n";
    List<ScaleMeasurement> list = CsvHelper.importFrom(new BufferedReader(new StringReader(data)));
    assertEquals(1, list.size());
    validateEntry(list.get(0), 3);
}
Also used : ScaleMeasurement(com.health.openscale.core.datatypes.ScaleMeasurement) BufferedReader(java.io.BufferedReader) StringReader(java.io.StringReader) Test(org.junit.Test)

Example 39 with ScaleMeasurement

use of com.health.openscale.core.datatypes.ScaleMeasurement in project openScale by oliexdev.

the class MeasurementTest method initData.

@Before
public void initData() {
    measurementA = new ScaleMeasurement();
    measurementB = new ScaleMeasurement();
    measurementA.setWeight(80.0f);
    measurementA.setBone(3.0f);
    measurementA.setMuscle(55.0f);
    measurementB.setWeight(90.0f);
    measurementB.setBone(10.0f);
    measurementB.setHip(5.0f);
    measurementB.setWater(12.0f);
}
Also used : ScaleMeasurement(com.health.openscale.core.datatypes.ScaleMeasurement) Before(org.junit.Before)

Aggregations

ScaleMeasurement (com.health.openscale.core.datatypes.ScaleMeasurement)39 Date (java.util.Date)13 ScaleUser (com.health.openscale.core.datatypes.ScaleUser)12 BufferedReader (java.io.BufferedReader)9 ParseException (java.text.ParseException)9 StringReader (java.io.StringReader)8 Test (org.junit.Test)8 ArrayList (java.util.ArrayList)7 Calendar (java.util.Calendar)7 MeasurementView (com.health.openscale.gui.views.MeasurementView)6 SimpleDateFormat (java.text.SimpleDateFormat)5 BMRMeasurementView (com.health.openscale.gui.views.BMRMeasurementView)4 FloatMeasurementView (com.health.openscale.gui.views.FloatMeasurementView)4 WeightMeasurementView (com.health.openscale.gui.views.WeightMeasurementView)4 IOException (java.io.IOException)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 Stack (java.util.Stack)2 SimpleLineChartValueFormatter (lecho.lib.hellocharts.formatter.SimpleLineChartValueFormatter)2 Axis (lecho.lib.hellocharts.model.Axis)2 AxisValue (lecho.lib.hellocharts.model.AxisValue)2