Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E59EB190FC for ; Mon, 11 Apr 2016 14:26:26 +0000 (UTC) Received: (qmail 47442 invoked by uid 500); 11 Apr 2016 14:26:25 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 47373 invoked by uid 500); 11 Apr 2016 14:26:24 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 45202 invoked by uid 99); 11 Apr 2016 14:25:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2016 14:25:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A94D0EAB62; Mon, 11 Apr 2016 14:25:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: vozerov@apache.org To: commits@ignite.apache.org Date: Mon, 11 Apr 2016 14:26:04 -0000 Message-Id: <5526cff8f885479d9efdc786d24ec75d@git.apache.org> In-Reply-To: <15dbdc0d71374accaf29cbb3b7b59af4@git.apache.org> References: <15dbdc0d71374accaf29cbb3b7b59af4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [37/50] [abbrv] ignite git commit: IGNITE-2947 BinaryContext doesn't honor custom loader set through IgniteConfiguration.classLoader Rollback IGNITE-2947 BinaryContext doesn't honor custom loader set through IgniteConfiguration.classLoader Rollback Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d3569f7c Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d3569f7c Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d3569f7c Branch: refs/heads/ignite-1786 Commit: d3569f7ccc9ed0b8ca761c0337a12f7d291be9cf Parents: f970c11 Author: Anton Vinogradov Authored: Thu Apr 7 17:55:15 2016 +0300 Committer: Anton Vinogradov Committed: Thu Apr 7 17:55:15 2016 +0300 ---------------------------------------------------------------------- .../ignite/internal/binary/BinaryContext.java | 2 +- ...acheBinaryObjectUserClassloaderSelfTest.java | 147 ------------------- .../IgniteBinaryObjectsTestSuite.java | 3 - 3 files changed, 1 insertion(+), 151 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d3569f7c/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java index 9a9ef10..4d8c293 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryContext.java @@ -992,7 +992,7 @@ public class BinaryContext { Class cls = null; try { - cls = U.resolveClassLoader(configuration()).loadClass(clsName); + cls = Class.forName(clsName); } catch (ClassNotFoundException | NoClassDefFoundError ignored) { // No-op. http://git-wip-us.apache.org/repos/asf/ignite/blob/d3569f7c/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectUserClassloaderSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectUserClassloaderSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectUserClassloaderSelfTest.java deleted file mode 100644 index ca09e4c..0000000 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/binary/GridCacheBinaryObjectUserClassloaderSelfTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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 org.apache.ignite.internal.processors.cache.binary; - -import java.util.Collections; -import org.apache.ignite.Ignite; -import org.apache.ignite.IgniteCache; -import org.apache.ignite.binary.BinaryObjectException; -import org.apache.ignite.binary.BinaryReader; -import org.apache.ignite.binary.BinarySerializer; -import org.apache.ignite.binary.BinaryTypeConfiguration; -import org.apache.ignite.binary.BinaryWriter; -import org.apache.ignite.configuration.BinaryConfiguration; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.configuration.IgniteConfiguration; -import org.apache.ignite.internal.binary.BinaryMarshaller; -import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; -import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder; -import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; -import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; - -import static org.apache.ignite.cache.CacheMode.REPLICATED; -import static org.apache.ignite.cache.CacheWriteSynchronizationMode.FULL_SYNC; - -/** - * - */ -public class GridCacheBinaryObjectUserClassloaderSelfTest extends GridCommonAbstractTest { - /** */ - private static volatile boolean customBinaryConf = false; - - /** */ - private static volatile boolean deserialized = false; - - /** */ - private TcpDiscoveryIpFinder ipFinder = new TcpDiscoveryVmIpFinder(true); - - /** {@inheritDoc} */ - @Override protected void afterTest() throws Exception { - super.afterTest(); - - stopAllGrids(); - } - - /** {@inheritDoc} */ - @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { - IgniteConfiguration cfg = super.getConfiguration(gridName); - - TcpDiscoverySpi disco = new TcpDiscoverySpi(); - - disco.setIpFinder(ipFinder); - - cfg.setDiscoverySpi(disco); - - cfg.setCacheConfiguration(cacheConfiguration(gridName)); - - cfg.setMarshaller(new BinaryMarshaller()); - - cfg.setClassLoader(getExternalClassLoader()); - - if (customBinaryConf) { - BinaryTypeConfiguration btcfg = new BinaryTypeConfiguration(); - - btcfg.setTypeName("org.apache.ignite.tests.p2p.CacheDeploymentTestValue3"); - - btcfg.setSerializer(new BinarySerializer() { - /** {@inheritDoc} */ - @Override public void writeBinary(Object obj, BinaryWriter writer) throws BinaryObjectException { - //No-op. - } - - /** {@inheritDoc} */ - @Override public void readBinary(Object obj, BinaryReader reader) throws BinaryObjectException { - deserialized = true; - } - }); - - BinaryConfiguration bcfg = new BinaryConfiguration(); - - bcfg.setTypeConfigurations(Collections.singletonList(btcfg)); - - cfg.setBinaryConfiguration(bcfg); - } - - return cfg; - } - - /** - * Gets cache configuration for grid with specified name. - * - * @param gridName Grid name. - * @return Cache configuration. - */ - CacheConfiguration cacheConfiguration(String gridName) { - CacheConfiguration cacheCfg = defaultCacheConfiguration(); - - cacheCfg.setCacheMode(REPLICATED); - cacheCfg.setWriteSynchronizationMode(FULL_SYNC); - - return cacheCfg; - } - - /** - * @throws Exception If test failed. - */ - public void testConfigurationRegistration() throws Exception { - try { - customBinaryConf = true; - - Ignite i1 = startGrid(1); - Ignite i2 = startGrid(2); - - IgniteCache cache1 = i1.cache(null); - IgniteCache cache2 = i2.cache(null); - - ClassLoader ldr = i1.configuration().getClassLoader(); - - Object v1 = ldr.loadClass("org.apache.ignite.tests.p2p.CacheDeploymentTestValue3").newInstance(); - - cache1.put(1, v1); - - deserialized = false; - - cache2.get(1); - - assertTrue(deserialized); - } - finally { - customBinaryConf = false; - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d3569f7c/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java index cedf9a7..73c22e4 100644 --- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java +++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteBinaryObjectsTestSuite.java @@ -47,7 +47,6 @@ import org.apache.ignite.internal.binary.noncompact.BinaryObjectBuilderNonCompac import org.apache.ignite.internal.binary.streams.BinaryHeapStreamByteOrderSelfTest; import org.apache.ignite.internal.binary.streams.BinaryOffheapStreamByteOrderSelfTest; import org.apache.ignite.internal.processors.cache.BinaryObjectOffHeapUnswapTemporaryTest; -import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryObjectUserClassloaderSelfTest; import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreBinariesDefaultMappersSelfTest; import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreBinariesSimpleNameMappersSelfTest; import org.apache.ignite.internal.processors.cache.binary.GridCacheBinaryStoreObjectsSelfTest; @@ -141,8 +140,6 @@ public class IgniteBinaryObjectsTestSuite extends TestSuite { suite.addTestSuite(BinaryHeapStreamByteOrderSelfTest.class); suite.addTestSuite(BinaryOffheapStreamByteOrderSelfTest.class); - suite.addTestSuite(GridCacheBinaryObjectUserClassloaderSelfTest.class); - return suite; } }