SGF-186 - fixed BeanFactoryLocator issue

This commit is contained in:
David Turanski
2013-07-11 16:01:57 -04:00
parent 36df54e5b5
commit 6b523a064e
5 changed files with 78 additions and 19 deletions

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package org.springframework.data.gemfire.function.config;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.gemfire.test.GemfireTestApplicationContextInitializer;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author David Turanski
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers = GemfireTestApplicationContextInitializer.class)
public class FunctionsWithClientCacheTests {
@Test
public void test() {
//Just make sure this comes up for SGF-186
}
}

View File

@@ -34,27 +34,23 @@ import com.gemstone.gemfire.cache.Region;
*
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(initializers=GemfireTestApplicationContextInitializer.class)
@ContextConfiguration(initializers = GemfireTestApplicationContextInitializer.class)
public class XmlConfiguredFunctionExecutionIntegrationTests {
@Autowired
ApplicationContext context;
ApplicationContext context;
@Test
public void testProxyFactoryBeanCreated() throws Exception {
OnRegionFunctionProxyFactoryBean factoryBean = (OnRegionFunctionProxyFactoryBean)context.getBean("&testFunction");
Class<?> serviceInterface = TestUtils.readField("serviceInterface",factoryBean);
OnRegionFunctionProxyFactoryBean factoryBean = (OnRegionFunctionProxyFactoryBean) context
.getBean("&testFunction");
Class<?> serviceInterface = TestUtils.readField("serviceInterface", factoryBean);
assertEquals(serviceInterface, TestOnRegionFunction.class);
Region<?,?> r1 = context.getBean("r1",Region.class);
GemfireOnRegionFunctionTemplate template = TestUtils.readField("gemfireFunctionOperations",factoryBean);
assertSame(r1, TestUtils.readField("region",template));
Region<?, ?> r1 = context.getBean("r1", Region.class);
GemfireOnRegionFunctionTemplate template = TestUtils.readField("gemfireFunctionOperations", factoryBean);
assertSame(r1, TestUtils.readField("region", template));
}
}

View File

@@ -0,0 +1,10 @@
package org.springframework.data.gemfire.function.config.four;
import org.springframework.data.gemfire.function.annotation.FunctionId;
import org.springframework.data.gemfire.function.annotation.OnServer;
@OnServer
public interface TestFunctionExecution {
@FunctionId("f1")
public String getString(Object arg1);
}