http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/StringId.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/StringId.java index 74a237b,0000000..fc5fe52 mode 100755,000000..100755 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/StringId.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/StringId.java @@@ -1,49 -1,0 +1,58 @@@ - /*========================================================================= - * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * more patents listed at http://www.pivotal.io/patents. - *========================================================================= ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You 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 com.gemstone.gemfire.internal.i18n; + +/** + * This class forms the basis of the i18n strategy. Its primary function is to + * be used as a key to be passed to an instance of StringIdResourceBundle. + * @author kbanks + * @since 6.0 + */ +public interface StringId { + /** + * Accessor for the raw (unformatted) text of this StringId + * @return unformated text + **/ + public String getRawText(); + + /** + * @return the English translation of this StringId + **/ + @Override + public String toString(); + + + /** + * Substitutes parameter Objects into the text + * @see java.text.MessageFormat + * @return the English translation of this StringId + **/ + public String toString(Object ... params); + + /** + * @return the translation of this StringId based on the current {@link java.util.Locale} + **/ + public String toLocalizedString(); + + /** + * Substitutes parameter Objects into the text + * @see java.text.MessageFormat + * @return the translation of this StringId based on the current {@link java.util.Locale} + **/ + public String toLocalizedString(Object ... params); +}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/DebugLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/InternalLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogFileParser.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LogWriterImpl.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/LoggingThreadGroup.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/PureLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/SecurityLocalLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/SecurityLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/SecurityManagerLogWriter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/log4j/LocalizedMessage.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/logging/log4j/LogWriterLogger.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/process/StartupStatus.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/RegionProvider.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/RegionProvider.java index 20fe173,a845230..d568386 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/RegionProvider.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/redis/RegionProvider.java @@@ -378,7 -394,7 +394,7 @@@ public class RegionProvider implements r = cache.getRegion(key); if (r != null) return r; do { - Result result = cliCmds.createRegion(key, defaultRegionType, null, null, true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); - Result result = cliCmds.createRegion(key, defaultRegionType, null, null, true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); ++ Result result = cliCmds.createRegion(key, defaultRegionType, null, null, true, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); r = cache.getRegion(key); if (result.getStatus() == Status.ERROR && r == null) { String err = ""; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/Connection.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/ConnectionTable.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/tcp/TCPConduit.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/Breadcrumbs.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/util/PluckStacks.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/JmxManagerLocatorRequest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/MBeanJMXAdapter.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/ManagementStrings.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/beans/MemberMBeanBridge.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/ClientCommands.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java index 1bba887,1a8920a..bf1fdf0 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/CreateAlterDestroyRegionCommands.java @@@ -324,7 -319,7 +324,7 @@@ public class CreateAlterDestroyRegionCo prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies, prStartupRecoveryDelay, prTotalMaxMemory, prTotalNumBuckets, - offHeap, hdfsStoreName , hdfsWriteOnly, mcastEnabled, regionAttributes); - offHeap, regionAttributes); ++ offHeap, mcastEnabled, regionAttributes); if (regionAttributes.getPartitionAttributes() == null && regionFunctionArgs.hasPartitionAttributes()) { @@@ -344,7 -339,7 +344,7 @@@ concurrencyChecksEnabled, cloningEnabled, concurrencyLevel, prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies, prStartupRecoveryDelay, - prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap , hdfsStoreName , hdfsWriteOnly, mcastEnabled); - prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap); ++ prTotalMaxMemory, prTotalNumBuckets, null,compressor, offHeap , mcastEnabled); if (!regionShortcut.name().startsWith("PARTITION") && regionFunctionArgs.hasPartitionAttributes()) { throw new IllegalArgumentException( http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/commands/MiscellaneousCommands.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionCreateFunction.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionFunctionArgs.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionFunctionArgs.java index 6cd4856,0ebe5e4..9dc8fab --- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionFunctionArgs.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/functions/RegionFunctionArgs.java @@@ -226,8 -188,7 +194,8 @@@ public class RegionFunctionArgs impleme Integer prLocalMaxMemory, Long prRecoveryDelay, Integer prRedundantCopies, Long prStartupRecoveryDelay, Long prTotalMaxMemory, Integer prTotalNumBuckets, - Boolean offHeap, String hdfsStoreName , Boolean hdfsWriteOnly , - Boolean offHeap, RegionAttributes<?, ?> regionAttributes) { ++ Boolean offHeap, + Boolean mcastEnabled, RegionAttributes<?, ?> regionAttributes) { this(regionPath, null, useAttributesFrom, skipIfExists, keyConstraint, valueConstraint, statisticsEnabled, entryExpirationIdleTime, entryExpirationTTL, regionExpirationIdleTime, regionExpirationTTL, @@@ -237,7 -198,7 +205,7 @@@ concurrencyChecksEnabled, cloningEnabled, concurrencyLevel, prColocatedWith, prLocalMaxMemory, prRecoveryDelay, prRedundantCopies, prStartupRecoveryDelay, - prTotalMaxMemory, prTotalNumBuckets, null, null, offHeap , hdfsStoreName , hdfsWriteOnly, mcastEnabled); - prTotalMaxMemory, prTotalNumBuckets, null, null, offHeap); ++ prTotalMaxMemory, prTotalNumBuckets, null, null, offHeap , mcastEnabled); this.regionAttributes = regionAttributes; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/i18n/CliStrings.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/result/ResultBuilder.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/result/ResultBuilder.java index c8649f2,a121805..a121805 mode 100755,100644..100755 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/result/ResultBuilder.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/cli/result/ResultBuilder.java http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/admin/internal/BindDistributedSystemJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/Bug42039JUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientServerTimeSyncDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/ClientServerRegisterInterestsDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/client/internal/AutoConnectionSourceDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java index 8895e8d,a6f24d0..fcaf99d --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/management/MemoryThresholdsOffHeapDUnitTest.java @@@ -1374,9 -1393,12 +1384,11 @@@ public class MemoryThresholdsOffHeapDUn final Host host = Host.getHost(0); final VM server = host.getVM(0); final VM client = host.getVM(1); + final Object bigKey = -1; + final Object smallKey = -2; final int port = AvailablePortHelper.getRandomAvailableTCPPort(); - final int mcastPort = AvailablePortHelper.getRandomAvailableUDPPort(); - startCacheServer(server, port, mcastPort, 0f, 90f, + startCacheServer(server, port, 0f, 90f, regionName, createPR, false, 0); startClient(client, server, port, regionName); doPuts(client, regionName, false/*catchServerException*/, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/data/PortfolioPdx.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/QueryUsingPoolDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/RemoteQueryDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/dunit/ResourceManagerWithQueryMonitorDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/functional/IndexCreationJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java index 5ad8537,18e4f3e..938c69a --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/CopyOnReadIndexDUnitTest.java @@@ -118,13 -127,8 +127,7 @@@ public class CopyOnReadIndexDUnitTest e //Querying the data will result in deserialization of portfolio objects. //In cases where index is present, the objects will be deserialized in the cache public void helpTestPRQueryOnLocalNode(final String queryString, final int numPortfolios, final int numExpectedResults, final boolean hasIndex) throws Exception { - - final int[] port = AvailablePortHelper.getRandomAvailableTCPPorts(2); -- final int numPortfoliosPerVM = numPortfolios / 2; - - startCacheServer(vm0, port[0]); - startCacheServer(vm1, port[1]); - + resetInstanceCount(vm0); resetInstanceCount(vm1); @@@ -558,10 -583,9 +582,9 @@@ } }); } - private void startCacheServer(VM server, final int port, final int mcastPort) throws Exception { + private void startCacheServer(VM server, final int port) throws Exception { server.invoke(new SerializableCallable() { public Object call() throws Exception { - disconnectFromDS(); getSystem(getServerProperties()); GemFireCacheImpl cache = (GemFireCacheImpl)getCache(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/MultiIndexCreationDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PdxCopyOnReadQueryJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache/query/internal/index/PutAllWithIndexPerfDUnitDisabledTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java index 836aad7,23bb89d..a627620 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheTestCase.java @@@ -42,6 -56,10 +53,7 @@@ import com.gemstone.gemfire.internal.ca import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.xmlcache.CacheCreation; import com.gemstone.gemfire.internal.cache.xmlcache.CacheXmlGenerator; + import com.gemstone.gemfire.internal.logging.LogService; -import com.gemstone.org.jgroups.Event; -import com.gemstone.org.jgroups.JChannel; -import com.gemstone.org.jgroups.stack.Protocol; import dunit.DistributedTestCase; import dunit.Host; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientMembershipDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ClientServerTestCase.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedAckRegionCCEDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/DistributedNoAckRegionCCEDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/GlobalRegionCCEDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/MultiVMRegionTestCase.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/PRBucketSynchronizationDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/ReconnectedCacheServerDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/RegionMembershipListenerDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/TXDistributedDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/AnalyzeSerializablesJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/codeAnalysis/decode/CompiledClass.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/ConsoleDistributionManagerDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/DistributionManagerDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/InternalDistributedSystemJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/ProductUseLogDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/MembershipJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java index 8330c07,0000000..b2c67e0 mode 100644,000000..100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/MembershipManagerHelper.java @@@ -1,161 -1,0 +1,170 @@@ - /*========================================================================= - * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * one or more patents listed at http://www.pivotal.io/patents. - *========================================================================= ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You 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 com.gemstone.gemfire.distributed.internal.membership.gms; + +import com.gemstone.gemfire.CancelException; +import com.gemstone.gemfire.ForcedDisconnectException; +import com.gemstone.gemfire.distributed.DistributedMember; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.DistributionManager; +import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem; +import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; +import com.gemstone.gemfire.distributed.internal.membership.MembershipManager; +import com.gemstone.gemfire.distributed.internal.membership.gms.interfaces.Manager; +import com.gemstone.gemfire.distributed.internal.membership.gms.mgr.GMSMembershipManager; + +import dunit.DistributedTestCase; +import dunit.DistributedTestCase.WaitCriterion; + +/** + * This helper class provides access to membership manager information that + * is not otherwise public + * @author bruce + * @since 5.5 + */ +public class MembershipManagerHelper +{ + + /** returns the JGroupMembershipManager for the given distributed system */ + public static MembershipManager getMembershipManager(DistributedSystem sys) { + InternalDistributedSystem isys = (InternalDistributedSystem)sys; + DistributionManager dm = (DistributionManager)isys.getDistributionManager(); + MembershipManager mgr = dm.getMembershipManager(); + return mgr; + } + + /** act sick. don't accept new connections and don't process ordered + * messages. Use beHealthyMember() to reverse the effects.<p> + * Note that part of beSickMember's processing is to interrupt and + * stop any reader threads. A slow listener in a reader thread should + * eat this interrupt. + * @param sys + */ + public static void beSickMember(DistributedSystem sys) { + ((Manager)getMembershipManager(sys)).beSick(); + } + + /** + * inhibit failure detection responses. This can be used in conjunction + * with beSickMember + */ + public static void playDead(DistributedSystem sys) { + try { + ((Manager)getMembershipManager(sys)).playDead(); + } + catch (CancelException e) { + // really dead is as good as playing dead + } + } + + public static void beHealthyMember(DistributedSystem sys) { + ((Manager)getMembershipManager(sys)).beHealthy(); + } + + /** returns the current coordinator address */ + public static DistributedMember getCoordinator(DistributedSystem sys) { + return ((Manager)getMembershipManager(sys)).getCoordinator(); + } + + /** returns the current lead member address */ + public static DistributedMember getLeadMember(DistributedSystem sys) { + return ((Manager)getMembershipManager(sys)).getLeadMember(); + } + + /** register a test hook with the manager */ + public static void addTestHook(DistributedSystem sys, + com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook) { + getMembershipManager(sys).registerTestHook(hook); + } + + /** remove a registered test hook */ + public static void removeTestHook(DistributedSystem sys, + com.gemstone.gemfire.distributed.internal.membership.MembershipTestHook hook) { + getMembershipManager(sys).unregisterTestHook(hook); + } + +// /** +// * returns the view lock. Holding this lock will prevent the processing +// * of new views, and will prevent other threads from being able to access +// * the view +// */ +// public static Object getViewLock(DistributedSystem sys) { +// return getMembershipManager(sys).latestViewLock; +// } + + /** returns true if the given member is shunned */ + public static boolean isShunned(DistributedSystem sys, DistributedMember mbr) { + return ((Manager)getMembershipManager(sys)).isShunned(mbr); + } + + /** returns true if the given member is a surprise member */ + public static boolean isSurpriseMember(DistributedSystem sys, DistributedMember mbr) { + return getMembershipManager(sys).isSurpriseMember(mbr); + } + + /** + * add a member id to the surprise members set, with the given millisecond + * clock birth time + */ + public static void addSurpriseMember(DistributedSystem sys, + DistributedMember mbr, long birthTime) { + ((Manager)getMembershipManager(sys)).addSurpriseMemberForTesting(mbr, birthTime); + } + + /** + * inhibits/enables logging of forced-disconnect messages. + * For quorum-lost messages this adds expected-exception annotations + * before and after the messages to make them invisible to greplogs + */ + public static void inhibitForcedDisconnectLogging(boolean b) { + GMSMembershipManager.inhibitForcedDisconnectLogging(b); + } + + /** + * wait for a member to leave the view. Throws an assertionerror + * if the timeout period elapses before the member leaves + */ + public static void waitForMemberDeparture(final DistributedSystem sys, + final DistributedMember member, final long timeout) { + WaitCriterion ev = new WaitCriterion() { + public boolean done() { + return !getMembershipManager(sys).getView().contains((InternalDistributedMember)member); + } + public String description() { + String assMsg = "Waited over " + timeout + " ms for " + member + + " to depart, but it didn't"; + return assMsg; + } + }; + DistributedTestCase.waitForCriterion(ev, timeout, 200, true); + } + + public static void crashDistributedSystem(final DistributedSystem msys) { + MembershipManagerHelper.inhibitForcedDisconnectLogging(true); + MembershipManagerHelper.playDead(msys); + GMSMembershipManager mgr = ((GMSMembershipManager)getMembershipManager(msys)); + mgr.forceDisconnect("for testing"); + while (msys.isConnected()) { + try { Thread.sleep(1000); } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return; + } + } + MembershipManagerHelper.inhibitForcedDisconnectLogging(false); + } + +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerBackwardCompatDUnitDisabledTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java index 77bd004,0000000..4594889 mode 100644,000000..100644 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/tcpserver/TcpServerJUnitTest.java @@@ -1,205 -1,0 +1,221 @@@ ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You 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 com.gemstone.gemfire.distributed.internal.tcpserver; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.net.ConnectException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.Properties; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +import junit.framework.Assert; + +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.DataSerializable; +import com.gemstone.gemfire.cache.GemFireCache; +import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.distributed.internal.PoolStatHelper; +import com.gemstone.gemfire.distributed.internal.SharedConfiguration; +import com.gemstone.gemfire.internal.AvailablePort; +//import com.gemstone.org.jgroups.stack.GossipClient; +//import com.gemstone.org.jgroups.stack.IpAddress; +import com.gemstone.gemfire.test.junit.categories.UnitTest; + +@Category(UnitTest.class) +public class TcpServerJUnitTest { + + protected/*GemStoneAddition*/ InetAddress localhost; + protected/*GemStoneAddition*/ int port; + private SimpleStats stats; + private TcpServer server; + + public void start(TcpHandler handler) throws IOException { + localhost = InetAddress.getLocalHost(); + port = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET); + + stats = new SimpleStats(); + server = new TcpServer(port, localhost , new Properties(), null, handler, stats, Thread.currentThread().getThreadGroup(), "server thread"); + server.start(); + } + + @Test + public void test() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException { + EchoHandler handler = new EchoHandler(); + start(handler); + + TestObject test = new TestObject(); + test.id = 5; + TestObject result = (TestObject) TcpClient.requestToServer(localhost, port, test, 60 * 1000 ); + Assert.assertEquals(test.id, result.id); + + String[] info = TcpClient.getInfo(localhost, port); + Assert.assertNotNull(info); + Assert.assertTrue(info.length > 1); + + try { + TcpClient.stop(localhost, port); + } catch ( ConnectException ignore ) { + // must not be running + } + server.join(60 * 1000); + Assert.assertFalse(server.isAlive()); + Assert.assertTrue(handler.shutdown); + + Assert.assertEquals(4, stats.started.get()); + Assert.assertEquals(4, stats.ended.get()); + + } + + @Test + public void testConcurrency() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + DelayHandler handler = new DelayHandler(latch); + start(handler); + + final AtomicBoolean done = new AtomicBoolean(); + Thread delayedThread = new Thread() { + public void run() { + Boolean delay = Boolean.valueOf(true); + try { + TcpClient.requestToServer(localhost, port, delay, 60 * 1000 ); + } catch (IOException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + done.set(true); + } + }; + delayedThread.start(); + try { + Thread.sleep(500); + Assert.assertFalse(done.get()); + TcpClient.requestToServer(localhost, port, Boolean.valueOf(false), 60 * 1000 ); + Assert.assertFalse(done.get()); + + latch.countDown(); + Thread.sleep(500); + Assert.assertTrue(done.get()); + } finally { + latch.countDown(); + delayedThread.join(60 * 1000); + Assert.assertTrue(!delayedThread.isAlive()); // GemStoneAddition + try { + TcpClient.stop(localhost, port); + } catch ( ConnectException ignore ) { + // must not be running + } + server.join(60 * 1000); + } + } + + public static class TestObject implements DataSerializable { + int id; + + public TestObject() { + + } + + public void fromData(DataInput in) throws IOException { + id = in.readInt(); + } + + public void toData(DataOutput out) throws IOException { + out.writeInt(id); + } + + } + + protected/*GemStoneAddition*/ static class EchoHandler implements TcpHandler { + + protected/*GemStoneAddition*/ boolean shutdown; + + + public void init(TcpServer tcpServer) { + // TODO Auto-generated method stub + + } + + public Object processRequest(Object request) throws IOException { + return request; + } + + public void shutDown() { + shutdown = true; + } + + public void restarting(DistributedSystem ds, GemFireCache cache, SharedConfiguration sharedConfig) { } + public void endRequest(Object request,long startTime) { } + public void endResponse(Object request,long startTime) { } + + } + + private static class DelayHandler implements TcpHandler { + + private CountDownLatch latch; + + public DelayHandler(CountDownLatch latch) { + this.latch = latch; + } + + public void init(TcpServer tcpServer) { + } + + public Object processRequest(Object request) throws IOException { + Boolean delay = (Boolean) request; + if(delay.booleanValue()) { + try { + latch.await(120 * 1000, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + return delay; + } + else { + return delay; + } + } + + public void shutDown() { + } + public void restarting(DistributedSystem ds, GemFireCache cache, SharedConfiguration sharedConfig) { } + public void endRequest(Object request,long startTime) { } + public void endResponse(Object request,long startTime) { } + } + + protected/*GemStoneAddition*/ static class SimpleStats implements PoolStatHelper { + AtomicInteger started = new AtomicInteger(); + AtomicInteger ended = new AtomicInteger(); + + + public void endJob() { + started.incrementAndGet(); + } + + public void startJob() { + ended.incrementAndGet(); + } + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/AvailablePortHelper.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java index 752f2f7,0000000..d730b9e mode 100755,000000..100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/BackwardCompatibilitySerializationDUnitTest.java @@@ -1,298 -1,0 +1,307 @@@ - /*========================================================================= - * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * one or more patents listed at http://www.pivotal.io/patents. - *========================================================================= ++/* ++ * Licensed to the Apache Software Foundation (ASF) under one or more ++ * contributor license agreements. See the NOTICE file distributed with ++ * this work for additional information regarding copyright ownership. ++ * The ASF licenses this file to You 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 com.gemstone.gemfire.internal; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.DataOutput; +import java.io.DataOutputStream; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; +import java.util.ArrayList; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; + +import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.internal.cache.DistributedPutAllOperation.EntryVersionsList; +import com.gemstone.gemfire.test.junit.categories.IntegrationTest; + +import dunit.DistributedTestCase; + +/** + * Test the DSFID serialization framework added for rolling upgrades in 7.1 + * + * @author tnomulwar + * + * + */ +public class BackwardCompatibilitySerializationDUnitTest extends DistributedTestCase { + + private transient ByteArrayOutputStream baos; + private transient ByteArrayInputStream bais; + + public static boolean toDataCalled = false; + public static boolean toDataPre66Called = false; + public static boolean toDataPre70called = false; + public static boolean fromDataCalled = false; + public static boolean fromDataPre66Called = false; + public static boolean fromDataPre70Called = false; + + public TestMessage msg = new TestMessage(); + + public BackwardCompatibilitySerializationDUnitTest(String name) { + super(name); + } + + @Before + public void setUp() { + baos = new ByteArrayOutputStream(); + // register TestMessage using an existing dsfid + DSFIDFactory.registerDSFID(DataSerializableFixedID.PUTALL_VERSIONS_LIST, + TestMessage.class); + } + + @After + public void tearDown2() { + resetFlags(); + // reset the class mapped to the dsfid + DSFIDFactory.registerDSFID(DataSerializableFixedID.PUTALL_VERSIONS_LIST, + EntryVersionsList.class); + this.baos = null; + this.bais = null; + } + + /** + * Test if correct toData/toDataPreXXX is called when changes are made to the + * TestMessage in 66 and 70 and version of peer is 56 + * + * @throws Exception + */ + @Test + public void testToDataFromHigherVersionToLower() throws Exception { + DataOutputStream dos = new VersionedDataOutputStream(new DataOutputStream( + baos), Version.GFE_56); + InternalDataSerializer.writeDSFID(msg, dos); + assertTrue(toDataPre66Called); + assertFalse(toDataCalled); + } + + /** + * Test if correct toData/toDataXXX is called when changes are made to the + * TestMessage in 66 and 70 and version of peer is 70 + * + * @throws Exception + */ + @Test + public void testToDataFromLowerVersionToHigher() throws Exception { + DataOutputStream dos = new VersionedDataOutputStream(new DataOutputStream( + baos), Version.GFE_701); + InternalDataSerializer.writeDSFID(msg, dos); + assertTrue(toDataCalled); + } + + /** + * Test if correct fromData/fromDataXXX is called when changes are made to the + * TestMessage in 66 and 70 and version of peer is 70 + * + * @throws Exception + */ + @Test + public void testFromDataFromHigherVersionToLower() throws Exception { + InternalDataSerializer.writeDSFID(msg, new DataOutputStream(baos)); + this.bais = new ByteArrayInputStream(baos.toByteArray()); + + DataInputStream dis = new VersionedDataInputStream( + new DataInputStream(bais), Version.GFE_701); + Object o = InternalDataSerializer.basicReadObject(dis); + assertTrue(o instanceof TestMessage); + assertTrue(fromDataCalled); + } + + /** + * Test if correct fromData/fromDataXXX is called when changes are made to the + * TestMessage in 66 and 70 and version of peer is 56 + * + * @throws Exception + */ + @Test + public void testFromDataFromLowerVersionToHigher() throws Exception { + InternalDataSerializer.writeDSFID(msg, new DataOutputStream(baos)); + this.bais = new ByteArrayInputStream(baos.toByteArray()); + + DataInputStream dis = new VersionedDataInputStream( + new DataInputStream(bais), Version.GFE_56); + Object o = InternalDataSerializer.basicReadObject(dis); + assertTrue(o instanceof TestMessage); + assertTrue(fromDataPre66Called); + } + + /** + * Test if all messages implement toDataPreXXX and fromDataPreXXX if the + * message has been upgraded in any of the versions + * + * @throws Exception + */ + @Test + public void testAllMessages() throws Exception { + // list of msgs not created using reflection + // taken from DSFIDFactory.create() + ArrayList<Integer> constdsfids = new ArrayList<Integer>(); + constdsfids.add(new Byte(DataSerializableFixedID.REGION).intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.END_OF_STREAM_TOKEN) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.DLOCK_REMOTE_TOKEN) + .intValue()); + constdsfids + .add(new Byte(DataSerializableFixedID.TRANSACTION_ID).intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.INTEREST_RESULT_POLICY) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.UNDEFINED).intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.RESULTS_BAG).intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.GATEWAY_EVENT_IMPL_66) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.SQLF_TYPE).intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.SQLF_DVD_OBJECT) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.SQLF_GLOBAL_ROWLOC) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.SQLF_GEMFIRE_KEY) + .intValue()); + constdsfids.add(new Byte(DataSerializableFixedID.SQLF_FORMATIBLEBITSET) + .intValue()); + constdsfids + .add(new Short(DataSerializableFixedID.TOKEN_INVALID).intValue()); + constdsfids.add(new Short(DataSerializableFixedID.TOKEN_LOCAL_INVALID) + .intValue()); + constdsfids.add(new Short(DataSerializableFixedID.TOKEN_DESTROYED) + .intValue()); + constdsfids + .add(new Short(DataSerializableFixedID.TOKEN_REMOVED).intValue()); + constdsfids.add(new Short(DataSerializableFixedID.TOKEN_REMOVED2) + .intValue()); + constdsfids.add(new Short(DataSerializableFixedID.TOKEN_TOMBSTONE) + .intValue()); + + for (int i = 0; i < 256; i++) { + Constructor<?> cons = DSFIDFactory.getDsfidmap()[i]; + if (!constdsfids.contains(i - Byte.MAX_VALUE - 1) && cons != null) { + Object ds = cons.newInstance((Object[]) null); + checkSupportForRollingUpgrade(ds); + } + } + + // some msgs require distributed system + Cache c = new CacheFactory().set("locators", "localhost["+getDUnitLocatorPort()+"]").create(); + for (Object o : DSFIDFactory.getDsfidmap2().values()) { + Constructor<?> cons = (Constructor<?>) o; + if (cons != null) { + DataSerializableFixedID ds = (DataSerializableFixedID) cons + .newInstance((Object[]) null); + checkSupportForRollingUpgrade(ds); + } + } + c.close(); + } + + private void checkSupportForRollingUpgrade(Object ds) { + Version[] versions = null; + if (ds instanceof SerializationVersions) { + versions = ((SerializationVersions)ds).getSerializationVersions(); + } + if (versions != null && versions.length > 0) { + for (int i = 0; i < versions.length; i++) { + try { + ds.getClass().getMethod( + "toDataPre_" + versions[i].getMethodSuffix(), + new Class[] { DataOutput.class }); + + ds.getClass().getMethod( + "fromDataPre_" + versions[i].getMethodSuffix(), + new Class[] { DataInput.class }); + } catch (NoSuchMethodException e) { + fail("toDataPreXXX or fromDataPreXXX for previous versions not found " + + e.getMessage()); + } + } + } else { + for(Method method : ds.getClass().getMethods()) { + if(method.getName().startsWith("toDataPre")) { + fail("Found backwards compatible toData, but class does not implement getSerializationVersions()" + method); + } else if(method.getName().startsWith("fromDataPre")) { + fail("Found backwards compatible fromData, but class does not implement getSerializationVersions()" + method); + } + } + + } + } + + private void resetFlags() { + toDataCalled = false; + toDataPre66Called = false; + toDataPre70called = false; + fromDataCalled = false; + fromDataPre66Called = false; + fromDataPre70Called = false; + } + + public static final class TestMessage implements DataSerializableFixedID { + /** The versions in which this message was modified */ + private static final Version[] dsfidVersions = new Version[] { + Version.GFE_66, Version.GFE_70 }; + + public TestMessage() { + } + + @Override + public Version[] getSerializationVersions() { + return dsfidVersions; + } + + @Override + public void toData(DataOutput out) throws IOException { + toDataCalled = true; + } + + public void toDataPre_GFE_6_6_0_0(DataOutput out) throws IOException { + toDataPre66Called = true; + } + + public void toDataPre_GFE_7_0_0_0(DataOutput out) throws IOException { + toDataPre70called = true; + } + + @Override + public void fromData(DataInput in) throws IOException { + fromDataCalled = true; + } + + public void fromDataPre_GFE_6_6_0_0(DataInput out) throws IOException { + fromDataPre66Called = true; + } + + public void fromDataPre_GFE_7_0_0_0(DataInput out) throws IOException { + fromDataPre70Called = true; + } + + @Override + public int getDSFID() { + return DataSerializableFixedID.PUTALL_VERSIONS_LIST; + } + + } +} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/FDDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxDeleteFieldDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/PdxRenameDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug33726JUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/Bug41957DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientMessagesRegionCreationAndDestroyJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerGetAllDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ClientServerTransactionDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConcurrentMapOpsDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java index fc7ab03,b8c8b00..483d44f mode 100755,100644..100755 --- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java +++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ConnectDisconnectDUnitTest.java http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/Bug51193DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/execute/PRFunctionExecutionTimeOutDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48571DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/ha/Bug48879DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug43684DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/Bug51400DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/PartitionedRegionLoadModelJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/partitioned/ShutdownAllDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug36829DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/Bug37805DUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/CacheServerTestUtil.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientQueueSizeDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientReconnectDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableClientStatsDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/DurableRegistrationDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/InterestListFailoverDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/UnregisterInterestDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/versions/RegionVersionVectorJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/i18n/BasicI18nJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/logging/log4j/LocalizedMessageJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/stats50/AtomicStatsJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/internal/util/concurrent/ReentrantSemaphoreJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/management/ClientHealthStatsDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/management/LocatorManagementDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/memcached/IntegrationJUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/com/gemstone/gemfire/redis/RedisDistDUnitTest.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/dunit/DistributedTestCase.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/dunit/standalone/DUnitLauncher.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java ---------------------------------------------------------------------- diff --cc gemfire-core/src/test/java/dunit/standalone/ProcessManager.java index 3dc0678,814a48e..f8a4da7 --- a/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java +++ b/gemfire-core/src/test/java/dunit/standalone/ProcessManager.java @@@ -149,17 -168,12 +169,15 @@@ public class ProcessManager "-D" + DUnitLauncher.WORKSPACE_DIR_PARAM + "=" + new File(".").getAbsolutePath(), "-DlogLevel=" + DUnitLauncher.LOG_LEVEL, "-Djava.library.path=" + System.getProperty("java.library.path"), - "-Xrunjdwp:transport=dt_socket,server=y,suspend=n", + "-Xrunjdwp:transport=dt_socket,server=y,suspend=" + jdkSuspend + jdkDebug, "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx512m", - "-XX:MaxPermSize=256M", "-Dgemfire.DEFAULT_MAX_OPLOG_SIZE=10", "-Dgemfire.disallowMcastDefaults=true", - "-XX:MaxPermSize=256M", "-ea", + // use IPv4 on Windows + // see https://github.com/belaban/JGroups/wiki/FAQ +// (IS_WINDOWS?"-Djava.net.preferIPv4Stack=true":""), agent, "dunit.standalone.ChildVM" }; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e41f260e/gemfire-core/src/test/java/hydra/log/AnyLogWriter.java ----------------------------------------------------------------------
