Search in sources :

Example 46 with Parameters

use of junitparams.Parameters in project protoman by spotify.

the class MethodIdempotencyChangeRuleTest method testIdempotencyChange_allowed.

@Parameters(method = "allowedIdempotencyChanges")
@Test
public void testIdempotencyChange_allowed(final String from, final String to) throws Exception {
    final DescriptorSet current = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format("syntax = 'proto3';\n" + "service Foo {\n" + "  rpc GetFoo(Derp) returns (Derp) { option idempotency_level = %s; };\n" + "}\n" + "message Derp {}", from));
    final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format("syntax = 'proto3';\n" + "service Foo {\n" + "  rpc GetFoo(Derp) returns (Derp) { option idempotency_level = %s; };\n" + "}\n" + "message Derp {}", to));
    final ImmutableList<ValidationViolation> violations = schemaValidator.validate(current, candidate);
    assertThat(violations, is(empty()));
}
Also used : ValidationViolation(com.spotify.protoman.validation.ValidationViolation) DescriptorSet(com.spotify.protoman.descriptor.DescriptorSet) Parameters(junitparams.Parameters) Test(org.junit.Test)

Example 47 with Parameters

use of junitparams.Parameters in project protoman by spotify.

the class OneofNamingRuleTest method testAllowedName_new.

@Parameters(method = "allowedNames")
@Test
public void testAllowedName_new(final String name) throws Exception {
    final DescriptorSet current = DescriptorSet.empty();
    final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format(TEMPLATE, name));
    final ImmutableList<ValidationViolation> violations = schemaValidator.validate(current, candidate);
    assertThat(violations, is(empty()));
}
Also used : ValidationViolation(com.spotify.protoman.validation.ValidationViolation) DescriptorSet(com.spotify.protoman.descriptor.DescriptorSet) Parameters(junitparams.Parameters) Test(org.junit.Test)

Example 48 with Parameters

use of junitparams.Parameters in project protoman by spotify.

the class OneofNamingRuleTest method testAllowedName_existing.

@Parameters(method = "allowedNames")
@Test
public void testAllowedName_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()));
}
Also used : ValidationViolation(com.spotify.protoman.validation.ValidationViolation) DescriptorSet(com.spotify.protoman.descriptor.DescriptorSet) Parameters(junitparams.Parameters) Test(org.junit.Test)

Example 49 with Parameters

use of junitparams.Parameters in project protoman by spotify.

the class PackageNamingRuleTest method testAllowedName.

@Parameters(method = "allowedNames")
@Test
public void testAllowedName(final String name) throws Exception {
    final DescriptorSet current = DescriptorSet.empty();
    final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", String.format(TEMPLATE, name));
    final ImmutableList<ValidationViolation> violations = schemaValidator.validate(current, candidate);
    assertThat(violations, is(empty()));
}
Also used : ValidationViolation(com.spotify.protoman.validation.ValidationViolation) DescriptorSet(com.spotify.protoman.descriptor.DescriptorSet) Parameters(junitparams.Parameters) Test(org.junit.Test)

Example 50 with Parameters

use of junitparams.Parameters in project protoman by spotify.

the class ServiceNamingRuleTest method testDisallowedName_existing.

@Parameters(method = "disallowedNames")
@Test
public void testDisallowedName_existing(final String name) throws Exception {
    final DescriptorSet candidate = DescriptorSetUtils.buildDescriptorSet("a.proto", "syntax = 'proto3';\n" + String.format("service %s {\n", name) + "}");
    final ImmutableList<ValidationViolation> violations = schemaValidator.validate(candidate, candidate);
    assertThat(violations, is(empty()));
}
Also used : ValidationViolation(com.spotify.protoman.validation.ValidationViolation) DescriptorSet(com.spotify.protoman.descriptor.DescriptorSet) Parameters(junitparams.Parameters) Test(org.junit.Test)

Aggregations

Parameters (junitparams.Parameters)121 Test (org.junit.Test)121 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)55 DescriptorSet (com.spotify.protoman.descriptor.DescriptorSet)43 ValidationViolation (com.spotify.protoman.validation.ValidationViolation)43 SerializableRunnableIF (org.apache.geode.test.dunit.SerializableRunnableIF)41 CommandResult (org.apache.geode.management.internal.cli.result.CommandResult)11 Region (org.apache.geode.cache.Region)10 Cache (org.apache.geode.cache.Cache)9 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)9 DistributedMember (org.apache.geode.distributed.DistributedMember)8 UnitTest (org.apache.geode.test.junit.categories.UnitTest)7 ArrayList (java.util.ArrayList)6 SecurityTest (org.apache.geode.test.junit.categories.SecurityTest)5 List (java.util.List)4 ResultCollector (org.apache.geode.cache.execute.ResultCollector)4 LuceneDestroyIndexFunction (org.apache.geode.cache.lucene.internal.cli.functions.LuceneDestroyIndexFunction)4 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)4 CliFunctionResult (org.apache.geode.management.internal.cli.functions.CliFunctionResult)4 AsyncInvocation (org.apache.geode.test.dunit.AsyncInvocation)4