From 16ca52363cef9a05a32113654ae290854cb27866 Mon Sep 17 00:00:00 2001 From: Donato Rimenti Date: Mon, 20 Apr 2020 20:11:06 +0200 Subject: [PATCH] Fixed test exclusions and added missing tests. --- libraries-data-2/pom.xml | 5 ++- .../baeldung/r/RserveMeanIntegrationTest.java | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java diff --git a/libraries-data-2/pom.xml b/libraries-data-2/pom.xml index ce15ef6c07..0dadcbd8d4 100644 --- a/libraries-data-2/pom.xml +++ b/libraries-data-2/pom.xml @@ -189,10 +189,13 @@ org.apache.maven.plugins maven-compiler-plugin - + com/baeldung/r/FastRMean.java + + com/baeldung/r/FastRMeanUnitTest.java + diff --git a/libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java b/libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java new file mode 100644 index 0000000000..95b344cb02 --- /dev/null +++ b/libraries-data-2/src/test/java/com/baeldung/r/RserveMeanIntegrationTest.java @@ -0,0 +1,34 @@ +package com.baeldung.r; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.rosuda.REngine.REXPMismatchException; +import org.rosuda.REngine.REngineException; + +/** + * Test for {@link RserveMean}. + * + * @author Donato Rimenti + */ +@Ignore +public class RserveMeanIntegrationTest { + + /** + * Object to test. + */ + private RserveMean rserveMean = new RserveMean(); + + /** + * Test for {@link RserveMeanIntegrationTest#mean(int[])}. + * + * @throws REXPMismatchException if an error occurs + * @throws REngineException if an error occurs + */ + @Test + public void givenValues_whenMean_thenCorrect() throws REngineException, REXPMismatchException { + int[] input = { 1, 2, 3, 4, 5 }; + double result = rserveMean.mean(input); + Assert.assertEquals(3.0, result, 0.000001); + } +} \ No newline at end of file