Polish and format source code.

This commit is contained in:
John Blum
2019-06-09 18:30:47 -07:00
parent dae841aff6
commit 868d168b5b
4 changed files with 17 additions and 12 deletions

View File

@@ -60,18 +60,16 @@ public abstract class ForkingClientServerIntegrationTestsSupport extends ClientS
int availablePort = setAndGetPoolPortProperty(setAndGetCacheServerPortProperty(findAvailablePort()));
List<String> argumentList = new ArrayList<>();
List<String> argumentList = new ArrayList<>(Arrays.asList(nullSafeArray(arguments, String.class)));
argumentList.addAll(Arrays.asList(nullSafeArray(arguments, String.class)));
argumentList.add(String.format("-D%s=%d", GEMFIRE_CACHE_SERVER_PORT_PROPERTY, availablePort));
setGemFireServerProcess(run(gemfireServerConfigurationClass,
argumentList.toArray(new String[argumentList.size()])));
setGemFireServerProcess(run(gemfireServerConfigurationClass, argumentList.toArray(new String[0])));
waitForServerToStart("localhost", availablePort);
}
protected static int setAndGetCacheServerPortProperty(int port) throws IOException {
protected static int setAndGetCacheServerPortProperty(int port) {
System.setProperty(GEMFIRE_CACHE_SERVER_PORT_PROPERTY, String.valueOf(port));

View File

@@ -18,6 +18,7 @@ package org.springframework.data.gemfire.tests.integration.config;
import static org.springframework.data.gemfire.tests.integration.ClientServerIntegrationTestsSupport.GEMFIRE_CACHE_SERVER_PORT_PROPERTY;
import java.util.Collections;
import java.util.List;
import org.apache.geode.cache.client.ClientCache;
import org.apache.geode.cache.client.Pool;
@@ -96,8 +97,13 @@ public class ClientServerIntegrationTestsConfiguration {
ClientCacheConfigurer clientCachePoolPortConfigurer(
@Value("${" + GEMFIRE_CACHE_SERVER_PORT_PROPERTY + ":" + DEFAULT_PORT + "}") int port) {
return (beanName, clientCacheFactoryBean) -> clientCacheFactoryBean.setServers(
Collections.singletonList(new ConnectionEndpoint("localhost", port)));
return (beanName, clientCacheFactoryBean) -> {
List<ConnectionEndpoint> servers =
Collections.singletonList(new ConnectionEndpoint("localhost", port));
clientCacheFactoryBean.setServers(servers);
};
}
@Configuration

View File

@@ -13,7 +13,6 @@
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package org.springframework.data.gemfire.tests.mock.annotation;
import java.lang.annotation.Documented;

View File

@@ -77,10 +77,10 @@ public class GemFireMockObjectsBeanPostProcessor implements BeanPostProcessor {
@Nullable @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return (isGemFireProperties(bean, beanName) ? set((Properties) bean)
: (bean instanceof CacheFactoryBean ? spyOnCacheFactoryBean((CacheFactoryBean) bean, this.useSingletonCache)
: (bean instanceof PoolFactoryBean ? mockThePoolFactoryBean((PoolFactoryBean) bean)
: bean)));
return isGemFireProperties(bean, beanName) ? set((Properties) bean)
: bean instanceof CacheFactoryBean ? spyOnCacheFactoryBean((CacheFactoryBean) bean, this.useSingletonCache)
: bean instanceof PoolFactoryBean ? mockThePoolFactoryBean((PoolFactoryBean) bean)
: bean;
}
@Nullable @Override
@@ -101,7 +101,9 @@ public class GemFireMockObjectsBeanPostProcessor implements BeanPostProcessor {
}
private Object set(Properties gemfireProperties) {
this.gemfireProperties.set(gemfireProperties);
return gemfireProperties;
}