Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
ELB fix binding for SetLoadBalancerPoliciesOfListener - EUCA-12593
Browse files Browse the repository at this point in the history
  • Loading branch information
sjones4 committed Jul 20, 2016
1 parent 452b5b0 commit 990e66f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*************************************************************************
* Copyright 2009-2014 Eucalyptus Systems, Inc.
* Copyright 2009-2016 Eucalyptus Systems, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -32,8 +32,10 @@ import com.eucalyptus.loadbalancing.common.msgs.Instances
import com.eucalyptus.loadbalancing.common.msgs.Listener
import com.eucalyptus.loadbalancing.common.msgs.Listeners
import com.eucalyptus.loadbalancing.common.msgs.LoadBalancerNames
import com.eucalyptus.loadbalancing.common.msgs.PolicyNames
import com.eucalyptus.loadbalancing.common.msgs.Ports
import com.eucalyptus.loadbalancing.common.msgs.RegisterInstancesWithLoadBalancerType
import com.eucalyptus.loadbalancing.common.msgs.SetLoadBalancerPoliciesOfListenerType
import com.eucalyptus.ws.protocol.QueryBindingTestSupport
import edu.ucsb.eucalyptus.msgs.BaseMessage
import org.junit.Test
Expand Down Expand Up @@ -131,6 +133,15 @@ class LoadBalancingQueryBindingTest extends QueryBindingTestSupport {
instances : new Instances( member: [new Instance(instanceId: 'i-abcdefgh'), new Instance(instanceId:'i-12345678')])
), 3);


// SetLoadBalancerPoliciesOfListener
bindAndAssertParameters( lbb, SetLoadBalancerPoliciesOfListenerType.class, "SetLoadBalancerPoliciesOfListener", new SetLoadBalancerPoliciesOfListenerType(
loadBalancerName: 'Name',
loadBalancerPort: 80,
policyNames: new PolicyNames( )
), [
'LoadBalancerName': 'Name',
'LoadBalancerPort': '80',
'PolicyNames': ''
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ private List<String> populateObject( final GroovyObject obj, final Map<String, S
subParams = params;
} else {
for ( final String item : Sets.newHashSet( params.keySet( ) ) ) {
if ( item.startsWith( e.getKey( ) + "." ) || item.equals( e.getKey( ) ) ) {
if ( item.startsWith( e.getKey( ) + "." ) || (item.equals( e.getKey( ) ) && isValueObject( declaredType ) )) {
subParams.put( item.replace( e.getKey( ) + ".", "" ), params.remove( item ) );
}
}
Expand Down Expand Up @@ -536,6 +536,10 @@ private Field findValueField( Class<?> targetType ) {
return null;
}

private boolean isValueObject( final Class<?> targetType ) {
return findValueField( targetType ) != null;
}

private Map<String, String> buildFieldMap( Class<?> targetType ) {
final Map<String, String> fieldMap = new HashMap<String, String>( );
while ( !BaseMessage.class.equals( targetType ) && !EucalyptusMessage.class.equals( targetType ) && !EucalyptusData.class.equals( targetType )
Expand Down

0 comments on commit 990e66f

Please sign in to comment.