Skip to content

Commit 16ca523

Browse files
committed
Fixed test exclusions and added missing tests.
1 parent 1639ead commit 16ca523

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

libraries-data-2/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,13 @@
189189
<groupId>org.apache.maven.plugins</groupId>
190190
<artifactId>maven-compiler-plugin</artifactId>
191191
<configuration>
192-
<!-- Excludes FastR classes from compilations since they require GraalVM -->
192+
<!-- Excludes FastR classes from compilations since they require GraalVM -->
193193
<excludes>
194194
<exclude>com/baeldung/r/FastRMean.java</exclude>
195195
</excludes>
196+
<testExcludes>
197+
<exclude>com/baeldung/r/FastRMeanUnitTest.java</exclude>
198+
</testExcludes>
196199
</configuration>
197200
</plugin>
198201
</plugins>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.baeldung.r;
2+
3+
import org.junit.Assert;
4+
import org.junit.Ignore;
5+
import org.junit.Test;
6+
import org.rosuda.REngine.REXPMismatchException;
7+
import org.rosuda.REngine.REngineException;
8+
9+
/**
10+
* Test for {@link RserveMean}.
11+
*
12+
* @author Donato Rimenti
13+
*/
14+
@Ignore
15+
public class RserveMeanIntegrationTest {
16+
17+
/**
18+
* Object to test.
19+
*/
20+
private RserveMean rserveMean = new RserveMean();
21+
22+
/**
23+
* Test for {@link RserveMeanIntegrationTest#mean(int[])}.
24+
*
25+
* @throws REXPMismatchException if an error occurs
26+
* @throws REngineException if an error occurs
27+
*/
28+
@Test
29+
public void givenValues_whenMean_thenCorrect() throws REngineException, REXPMismatchException {
30+
int[] input = { 1, 2, 3, 4, 5 };
31+
double result = rserveMean.mean(input);
32+
Assert.assertEquals(3.0, result, 0.000001);
33+
}
34+
}

0 commit comments

Comments
 (0)