Skip to content

Commit

Permalink
HV-753 Rename areParametersConstrained to hasConstrainedParameters an…
Browse files Browse the repository at this point in the history
…d isReturnValueConstrained to hasConstrainedReturnValue in ExecutableDescriptorImpl
  • Loading branch information
hferentschik committed Mar 12, 2013
1 parent b6a4a7b commit 8a66333
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Expand Up @@ -82,25 +82,8 @@ public ReturnValueDescriptor getReturnValueDescriptor() {
return returnValueDescriptor;
}

public void assertCorrectnessOfConfiguration()
throws ConstraintDeclarationException {

if ( constraintDeclarationException != null ) {
throw constraintDeclarationException;
}
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "ExecutableDescriptorImpl" );
sb.append( "{name='" ).append( name ).append( '\'' );
sb.append( '}' );
return sb.toString();
}

@Override
public boolean areParametersConstrained() {
public boolean hasConstrainedParameters() {
if ( crossParameterDescriptor.hasConstraints() ) {
return true;
}
Expand All @@ -115,13 +98,30 @@ public boolean areParametersConstrained() {
}

@Override
public boolean isReturnValueConstrained() {
return returnValueDescriptor != null && ( returnValueDescriptor.hasConstraints() || returnValueDescriptor
.isCascaded() );
public boolean hasConstrainedReturnValue() {
return returnValueDescriptor != null && ( returnValueDescriptor.hasConstraints()
|| returnValueDescriptor.isCascaded() );
}

@Override
public CrossParameterDescriptor getCrossParameterDescriptor() {
return crossParameterDescriptor;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append( "ExecutableDescriptorImpl" );
sb.append( "{name='" ).append( name ).append( '\'' );
sb.append( '}' );
return sb.toString();
}

public void assertCorrectnessOfConfiguration()
throws ConstraintDeclarationException {

if ( constraintDeclarationException != null ) {
throw constraintDeclarationException;
}
}
}
Expand Up @@ -216,7 +216,7 @@ public void testIsReturnValueConstrainedForConstrainedMethod() {
CustomerRepositoryExt.class,
"baz"
);
assertThat( methodDescriptor.isReturnValueConstrained() ).isTrue();
assertThat( methodDescriptor.hasConstrainedReturnValue() ).isTrue();
}

@Test
Expand All @@ -225,7 +225,7 @@ public void testIsReturnValueConstrainedForCascadedMethod() {
CustomerRepositoryExt.class,
"foo"
);
assertThat( methodDescriptor.isReturnValueConstrained() ).isTrue();
assertThat( methodDescriptor.hasConstrainedReturnValue() ).isTrue();
}

@Test
Expand All @@ -236,7 +236,7 @@ public void testIsReturnValueConstrainedForParameterConstrainedMethod() {
CharSequence.class,
String.class
);
assertThat( methodDescriptor.isReturnValueConstrained() ).isFalse();
assertThat( methodDescriptor.hasConstrainedReturnValue() ).isFalse();
}

@Test
Expand All @@ -246,7 +246,7 @@ public void testIsReturnValueConstrainedForVoidMethod() {
"saveCustomer",
Customer.class
);
assertThat( methodDescriptor.isReturnValueConstrained() ).isFalse();
assertThat( methodDescriptor.hasConstrainedReturnValue() ).isFalse();
}

@Test
Expand All @@ -257,7 +257,7 @@ public void testAreParametersConstrainedForParameterConstrainedMethod() {
CharSequence.class,
String.class
);
assertThat( methodDescriptor.areParametersConstrained() ).isTrue();
assertThat( methodDescriptor.hasConstrainedParameters() ).isTrue();
}

@Test
Expand All @@ -267,7 +267,7 @@ public void testAreParametersConstrainedForParameterCascadedMethod() {
"saveCustomer",
Customer.class
);
assertThat( methodDescriptor.areParametersConstrained() ).isTrue();
assertThat( methodDescriptor.hasConstrainedParameters() ).isTrue();
}

@Test
Expand All @@ -276,7 +276,7 @@ public void testAreParametersConstrainedForCrossParameterConstrainedMethod() {
CustomerRepositoryExt.class,
"methodWithCrossParameterConstraint", DateMidnight.class, DateMidnight.class
);
assertThat( methodDescriptor.areParametersConstrained() ).isTrue();
assertThat( methodDescriptor.hasConstrainedParameters() ).isTrue();
}

@Test
Expand All @@ -286,7 +286,7 @@ public void testAreParametersConstrainedForNonParameterConstrainedMethod() {
"zip",
int.class
);
assertThat( methodDescriptor.areParametersConstrained() ).isFalse();
assertThat( methodDescriptor.hasConstrainedParameters() ).isFalse();
}

@Test
Expand All @@ -295,6 +295,6 @@ public void testAreParametersConstrainedForParameterlessMethod() {
CustomerRepositoryExt.class,
"zip"
);
assertThat( methodDescriptor.areParametersConstrained() ).isFalse();
assertThat( methodDescriptor.hasConstrainedParameters() ).isFalse();
}
}
Expand Up @@ -54,7 +54,7 @@ public void testArrayParametersAreConfigurableWithAndWithoutDefaultPackage() {
Set<MethodDescriptor> methodDescriptors = beanDescriptor.getConstrainedMethods();
assertTrue( "There should be two constrained methods", methodDescriptors.size() == 2 );
for ( MethodDescriptor methodDescriptor : methodDescriptors ) {
assertTrue( "Parameter should be constrained", methodDescriptor.areParametersConstrained() );
assertTrue( "Parameter should be constrained", methodDescriptor.hasConstrainedParameters() );
List<ParameterDescriptor> parameterDescriptorList = methodDescriptor.getParameterDescriptors();
for ( ParameterDescriptor parameterDescriptor : parameterDescriptorList ) {
assertTrue( "Parameter should be constrained", parameterDescriptor.isCascaded() );
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -88,7 +88,7 @@

<!-- Don't upgrade to 1.1.0 yet. Dependencies get copied to wrong location -->
<org.codehaus.mojo.chronos.version>1.0-beta-3</org.codehaus.mojo.chronos.version>
<bv.api.version>1.1.0.CR1</bv.api.version>
<bv.api.version>1.1.0-SNAPSHOT</bv.api.version>
<classmate.version>0.8.0</classmate.version>
<jbossas.version>7.1.1.Final</jbossas.version>
<arquillian.version>1.0.2.Final</arquillian.version>
Expand Down

0 comments on commit 8a66333

Please sign in to comment.