Search in sources :

Example 6 with LonerDistributionManager

use of org.apache.geode.distributed.internal.LonerDistributionManager in project geode by apache.

the class MyFunctionException method bug41118.

public static void bug41118() {
    InternalDistributedSystem ds = new DistributedRegionFunctionExecutionDUnitTest().getSystem();
    assertNotNull(ds);
    ds.disconnect();
    Properties props = new Properties();
    props.setProperty(MCAST_PORT, "0");
    ds = (InternalDistributedSystem) DistributedSystem.connect(props);
    DM dm = ds.getDistributionManager();
    assertEquals("Distributed System is not loner", true, dm instanceof LonerDistributionManager);
    Cache cache = CacheFactory.create(ds);
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setDataPolicy(DataPolicy.REPLICATE);
    assertNotNull(cache);
    region = cache.createRegion(REGION_NAME, factory.create());
    try {
        executeInlineFunction();
        ds.disconnect();
    } catch (Exception e) {
        LogWriterUtils.getLogWriter().info("Exception Occurred : " + e.getMessage());
        e.printStackTrace();
        Assert.fail("Test failed", e);
    }
}
Also used : AttributesFactory(org.apache.geode.cache.AttributesFactory) DM(org.apache.geode.distributed.internal.DM) InternalDistributedSystem(org.apache.geode.distributed.internal.InternalDistributedSystem) ConfigurationProperties(org.apache.geode.distributed.ConfigurationProperties) Properties(java.util.Properties) LonerDistributionManager(org.apache.geode.distributed.internal.LonerDistributionManager) IgnoredException(org.apache.geode.test.dunit.IgnoredException) FunctionInvocationTargetException(org.apache.geode.cache.execute.FunctionInvocationTargetException) IOException(java.io.IOException) DistribuedRegionFunctionFunctionInvocationException(org.apache.geode.internal.cache.functions.DistribuedRegionFunctionFunctionInvocationException) Cache(org.apache.geode.cache.Cache)

Aggregations

LonerDistributionManager (org.apache.geode.distributed.internal.LonerDistributionManager)6 Properties (java.util.Properties)4 ConfigurationProperties (org.apache.geode.distributed.ConfigurationProperties)4 DM (org.apache.geode.distributed.internal.DM)4 InternalDistributedSystem (org.apache.geode.distributed.internal.InternalDistributedSystem)4 InternalDistributedMember (org.apache.geode.distributed.internal.membership.InternalDistributedMember)3 IOException (java.io.IOException)2 AttributesFactory (org.apache.geode.cache.AttributesFactory)2 Cache (org.apache.geode.cache.Cache)2 Execution (org.apache.geode.cache.execute.Execution)2 FunctionAdapter (org.apache.geode.cache.execute.FunctionAdapter)2 FunctionContext (org.apache.geode.cache.execute.FunctionContext)2 FunctionException (org.apache.geode.cache.execute.FunctionException)2 FunctionInvocationTargetException (org.apache.geode.cache.execute.FunctionInvocationTargetException)2 ResultCollector (org.apache.geode.cache.execute.ResultCollector)2 DistributedMember (org.apache.geode.distributed.DistributedMember)2 IgnoredException (org.apache.geode.test.dunit.IgnoredException)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1