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 833D11794D for ; Wed, 1 Apr 2015 12:55:26 +0000 (UTC) Received: (qmail 11628 invoked by uid 500); 1 Apr 2015 12:55:26 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 11552 invoked by uid 500); 1 Apr 2015 12:55:26 -0000 Mailing-List: contact commits-help@ignite.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.incubator.apache.org Delivered-To: mailing list commits@ignite.incubator.apache.org Received: (qmail 11424 invoked by uid 99); 1 Apr 2015 12:55:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2015 12:55:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 01 Apr 2015 12:55:23 +0000 Received: (qmail 10792 invoked by uid 99); 1 Apr 2015 12:55:03 -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; Wed, 01 Apr 2015 12:55:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C029EE1832; Wed, 1 Apr 2015 12:55:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.incubator.apache.org Date: Wed, 01 Apr 2015 12:55:05 -0000 Message-Id: <809e549aa2ff4f5b89fe914e44098463@git.apache.org> In-Reply-To: <01ec5f625791434f807e29d5a9fca527@git.apache.org> References: <01ec5f625791434f807e29d5a9fca527@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/25] incubator-ignite git commit: ignite-615 ignite-616 partial test implementation X-Virus-Checked: Checked by ClamAV on apache.org ignite-615 ignite-616 partial test implementation Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/1d77b1b2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/1d77b1b2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/1d77b1b2 Branch: refs/heads/ignite-662 Commit: 1d77b1b2bef3ba9aa16f981d3a0a78571a5c0275 Parents: d19e6c6 Author: avinogradov Authored: Fri Mar 27 18:06:41 2015 +0300 Committer: avinogradov Committed: Fri Mar 27 18:06:41 2015 +0300 ---------------------------------------------------------------------- ...bernateBlobStoreNodeRestartAbstractTest.java | 40 +++++++++ ...IgniteCacheStoreNodeRestartAbstractTest.java | 92 ++++++++++++++++++++ 2 files changed, 132 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d77b1b2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheHibernateBlobStoreNodeRestartAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheHibernateBlobStoreNodeRestartAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheHibernateBlobStoreNodeRestartAbstractTest.java new file mode 100644 index 0000000..6efe423 --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheHibernateBlobStoreNodeRestartAbstractTest.java @@ -0,0 +1,40 @@ +/* + * 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.integration; + +import org.apache.ignite.cache.*; +import org.apache.ignite.cache.store.*; +import org.apache.ignite.configuration.*; + +public class IgniteCacheHibernateBlobStoreNodeRestartAbstractTest extends IgniteCacheStoreNodeRestartAbstractTest { + @Override protected CacheStore getStore() { + return null; + } + + @Override protected CacheMode cacheMode() { + return null; + } + + @Override protected CacheAtomicityMode atomicityMode() { + return null; + } + + @Override protected NearCacheConfiguration nearConfiguration() { + return null; + } +} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1d77b1b2/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreNodeRestartAbstractTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreNodeRestartAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreNodeRestartAbstractTest.java new file mode 100644 index 0000000..89a203f --- /dev/null +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/integration/IgniteCacheStoreNodeRestartAbstractTest.java @@ -0,0 +1,92 @@ +/* + * 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.integration; + +import org.apache.ignite.cache.store.*; +import org.apache.ignite.configuration.*; +import org.apache.ignite.internal.processors.cache.*; + +import java.io.*; + +public abstract class IgniteCacheStoreNodeRestartAbstractTest extends IgniteCacheAbstractTest { + + /** */ + protected static final String CACHE_NAME1 = "cache1"; + + /** {@inheritDoc} */ + @SuppressWarnings("unchecked") + @Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { + IgniteConfiguration cfg = super.getConfiguration(gridName); + + CacheStore store = getStore(); // Use the same store instance for both caches. + + assert cfg.getCacheConfiguration().length == 1; + + CacheConfiguration ccfg0 = cfg.getCacheConfiguration()[0]; + + ccfg0.setReadThrough(true); + ccfg0.setWriteThrough(true); + + ccfg0.setCacheStoreFactory(singletonFactory(store)); + + CacheConfiguration ccfg1 = cacheConfiguration(gridName); + + ccfg1.setReadThrough(true); + ccfg1.setWriteThrough(true); + + ccfg1.setName(CACHE_NAME1); + + ccfg1.setCacheStoreFactory(singletonFactory(store)); + + cfg.setCacheConfiguration(ccfg0, ccfg1); + + return cfg; + } + + @Override protected int gridCount() { + return 2; + } + + /** */ + protected abstract CacheStore getStore(); + + /** + * @throws Exception If failed. + */ + public void testStoreSession() throws Exception { + grid(0).cache(CACHE_NAME1).put("key1", new UserObject("key1")); + stopGrid(0); + startGrid(0); + grid(1).cache(CACHE_NAME1).get("key1"); + } + + private static class UserObject implements Serializable{ + private String field; + + public UserObject(String field) { + this.field = field; + } + + public UserObject() { + } + + public String getField() { + return field; + } + } +}