ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [37/50] [abbrv] ignite git commit: IGNITE-2947 BinaryContext doesn't honor custom loader set through IgniteConfiguration.classLoader Rollback
Date Mon, 11 Apr 2016 14:26:04 GMT
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 <av@apache.org>
Authored: Thu Apr 7 17:55:15 2016 +0300
Committer: Anton Vinogradov <av@apache.org>
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<Integer, Object> cache1 = i1.cache(null);
-            IgniteCache<Integer, Object> 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;
     }
 }


Mime
View raw message