Search in sources :

Example 1 with SplitStoreFromRDDOfElements

use of uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements in project Gaffer by gchq.

the class SplitStoreFromRDDOfElementsHandlerTest method throwsExceptionWhenMaxSampleSizeIsLessThanOne.

@Test
public void throwsExceptionWhenMaxSampleSizeIsLessThanOne() throws OperationException {
    final SplitStoreFromRDDOfElements splitStoreHandler = new SplitStoreFromRDDOfElements.Builder().input(rdd).maxSampleSize(-1).build();
    assertThatIllegalArgumentException().isThrownBy(() -> graph.execute(splitStoreHandler, user)).withMessageContaining("maxSampleSize must be null or greater than 0");
}
Also used : SplitStoreFromRDDOfElements(uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements) Test(org.junit.jupiter.api.Test)

Example 2 with SplitStoreFromRDDOfElements

use of uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements in project Gaffer by gchq.

the class SplitStoreFromRDDOfElementsHandlerTest method throwsExceptionWhenNumSplitPointsIsLessThanOne.

@Test
public void throwsExceptionWhenNumSplitPointsIsLessThanOne() throws OperationException {
    final SplitStoreFromRDDOfElements splitStoreHandler = new SplitStoreFromRDDOfElements.Builder().input(rdd).numSplits(-1).build();
    assertThatIllegalArgumentException().isThrownBy(() -> graph.execute(splitStoreHandler, user)).withMessageContaining("numSplits must be null or greater than 0");
}
Also used : SplitStoreFromRDDOfElements(uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements) Test(org.junit.jupiter.api.Test)

Example 3 with SplitStoreFromRDDOfElements

use of uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements in project Gaffer by gchq.

the class SplitStoreFromRDDOfElementsHandlerTest method throwsExceptionWhenFractionToSampleIsGreaterThanOne.

@Test
public void throwsExceptionWhenFractionToSampleIsGreaterThanOne() throws OperationException {
    final SplitStoreFromRDDOfElements splitStoreHandler = new SplitStoreFromRDDOfElements.Builder().input(rdd).fractionToSample(1.000000001d).build();
    assertThatIllegalArgumentException().isThrownBy(() -> graph.execute(splitStoreHandler, user)).withMessageContaining("fractionToSample must be null or between 0 exclusive and 1 inclusive");
}
Also used : SplitStoreFromRDDOfElements(uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements) Test(org.junit.jupiter.api.Test)

Example 4 with SplitStoreFromRDDOfElements

use of uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements in project Gaffer by gchq.

the class SplitStoreFromRDDOfElementsHandlerTest method throwsExceptionWhenFractionToSampleIsZero.

@Test
public void throwsExceptionWhenFractionToSampleIsZero() throws OperationException {
    final SplitStoreFromRDDOfElements splitStoreHandler = new SplitStoreFromRDDOfElements.Builder().input(rdd).fractionToSample(0d).build();
    assertThatIllegalArgumentException().isThrownBy(() -> graph.execute(splitStoreHandler, user)).withMessageContaining("fractionToSample must be null or between 0 exclusive and 1 inclusive");
}
Also used : SplitStoreFromRDDOfElements(uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements) Test(org.junit.jupiter.api.Test)

Example 5 with SplitStoreFromRDDOfElements

use of uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements in project Gaffer by gchq.

the class SplitStoreFromRDDOfElementsHandlerTest method throwsExceptionWhenFractionToSampleLessThanZero.

@Test
public void throwsExceptionWhenFractionToSampleLessThanZero() throws OperationException {
    final SplitStoreFromRDDOfElements splitStoreHandler = new SplitStoreFromRDDOfElements.Builder().input(rdd).fractionToSample(-0.00000001d).build();
    assertThatIllegalArgumentException().isThrownBy(() -> graph.execute(splitStoreHandler, user)).withMessageContaining("fractionToSample must be null or between 0 exclusive and 1 inclusive");
}
Also used : SplitStoreFromRDDOfElements(uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)5 SplitStoreFromRDDOfElements (uk.gov.gchq.gaffer.spark.operation.scalardd.SplitStoreFromRDDOfElements)5