use of junitparams.Parameters in project geode by apache.
the class RebalanceDUnitTest method returnCorrectResultsWhenMoveBucketHappensOnQuery.
@Test
@Parameters(method = "getListOfRegionTestTypes")
public void returnCorrectResultsWhenMoveBucketHappensOnQuery(RegionTestableType regionTestType) throws InterruptedException {
final DistributedMember member2 = dataStore2.invoke(() -> getCache().getDistributedSystem().getDistributedMember());
addCallbackToMovePrimaryOnQuery(dataStore1, member2);
putEntriesAndValidateQueryResults(regionTestType);
}
use of junitparams.Parameters in project apex-core by apache.
the class AbstractReservoirTest method testAddAndSweepTuple.
@Test
@Parameters(method = "defaultTestParameters")
public void testAddAndSweepTuple(final AbstractReservoir reservoir, final Class<? extends Throwable> type) {
final Tuple t = new Tuple(BEGIN_WINDOW, 0L);
assertTrue(reservoir.add(t));
assertFalse(reservoir.isEmpty());
assertEquals(1, reservoir.size());
assertEquals(1, reservoir.size(false));
assertEquals(t, reservoir.peek());
assertEquals(t, reservoir.sweep());
assertEquals(t, reservoir.sweep());
assertEquals(0, reservoir.getCount(false));
assertEquals(0, reservoir.getSink().getCount(false));
assertFalse(reservoir.isEmpty());
assertEquals(t, reservoir.remove());
assertNull(reservoir.peek());
assertNull(reservoir.poll());
assertNull(reservoir.sweep());
exception.expect(type);
reservoir.remove();
}
use of junitparams.Parameters in project protoman by spotify.
the class SemverSchemaVersionerTest method testDetermineVersion.
@Test
@Parameters(method = "testParams")
public void testDetermineVersion(final Path root, final String protoPackage, final SchemaVersion currentVersion, final SchemaVersion expectedVersion) throws Exception {
final SemverSchemaVersioner sut = SemverSchemaVersioner.create();
final DescriptorSetPair descriptorSetPair = DescriptorSetUtils.buildDescriptorSetPair(root);
final SchemaVersion version = sut.determineVersion(protoPackage, currentVersion, descriptorSetPair.current(), descriptorSetPair.candidate());
assertThat(version, equalTo(expectedVersion));
}
use of junitparams.Parameters in project protoman by spotify.
the class EnumDefaultValueTest method testDisallowedName.
@Parameters(method = "disallowedNames")
@Test
public void testDisallowedName(final String name) throws Exception {
final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format(TEMPLATE, name));
final ImmutableList<ValidationViolation> violations = schemaValidator.validate(DescriptorSet.empty(), candidate);
assertThat(violations, contains(validationViolation().description(equalTo("enum value 0 should be used for unknown value, e.g. AN_ENUM_UNSPECIFIED")).type(equalTo(ViolationType.BEST_PRACTICE_VIOLATION)).current(nullValue(GenericDescriptor.class)).candidate(genericDescriptor().sourceCodeInfo(optionalWithValue(sourceCodeInfo().start(filePosition().line(2).column(1)))))));
}
use of junitparams.Parameters in project protoman by spotify.
the class EnumNamingRuleTest method testDisallowedName_existing.
@Parameters(method = "disallowedNames")
@Test
public void testDisallowedName_existing(final String name) throws Exception {
final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format(TEMPLATE, name));
final ImmutableList<ValidationViolation> violations = schemaValidator.validate(candidate, candidate);
assertThat(violations, is(empty()));
}
Aggregations