Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A805E200C5C for ; Thu, 20 Apr 2017 11:35:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A6788160BB7; Thu, 20 Apr 2017 09:35:54 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 79A72160BB0 for ; Thu, 20 Apr 2017 11:35:53 +0200 (CEST) Received: (qmail 42367 invoked by uid 500); 20 Apr 2017 09:35:52 -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 42261 invoked by uid 99); 20 Apr 2017 09:35:52 -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; Thu, 20 Apr 2017 09:35:52 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61340DFF47; Thu, 20 Apr 2017 09:35:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Thu, 20 Apr 2017 09:35:52 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/7] ignite git commit: ignite-1794 archived-at: Thu, 20 Apr 2017 09:35:54 -0000 Repository: ignite Updated Branches: refs/heads/ignite-1794 be40f9377 -> d992b9497 http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreSessionListenerSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreSessionListenerSelfTest.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreSessionListenerSelfTest.java deleted file mode 100644 index 880d12a..0000000 --- a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/CacheHibernateStoreSessionListenerSelfTest.java +++ /dev/null @@ -1,238 +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.cache.store.hibernate; - -import java.io.Serializable; -import java.util.Map; -import javax.cache.Cache; -import javax.cache.configuration.Factory; -import javax.cache.integration.CacheLoaderException; -import javax.cache.integration.CacheWriterException; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Table; -import org.apache.ignite.cache.store.CacheStore; -import org.apache.ignite.cache.store.CacheStoreAdapter; -import org.apache.ignite.cache.store.CacheStoreSession; -import org.apache.ignite.cache.store.CacheStoreSessionListener; -import org.apache.ignite.cache.store.CacheStoreSessionListenerAbstractSelfTest; -import org.apache.ignite.cache.store.jdbc.CacheJdbcStoreSessionListener; -import org.apache.ignite.lang.IgniteBiInClosure; -import org.apache.ignite.resources.CacheStoreSessionResource; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; -import org.hibernate.cfg.Configuration; - -/** - * Tests for {@link CacheJdbcStoreSessionListener}. - */ -public class CacheHibernateStoreSessionListenerSelfTest extends CacheStoreSessionListenerAbstractSelfTest { - /** {@inheritDoc} */ - @Override protected Factory> storeFactory() { - return new Factory>() { - @Override public CacheStore create() { - return new Store(); - } - }; - } - - /** {@inheritDoc} */ - @Override protected Factory sessionListenerFactory() { - return new Factory() { - @Override public CacheStoreSessionListener create() { - CacheHibernateStoreSessionListener lsnr = new CacheHibernateStoreSessionListener(); - - SessionFactory sesFactory = new Configuration(). - setProperty("hibernate.connection.url", URL). - addAnnotatedClass(Table1.class). - addAnnotatedClass(Table2.class). - buildSessionFactory(); - - lsnr.setSessionFactory(sesFactory); - - return lsnr; - } - }; - } - - /** - */ - private static class Store extends CacheStoreAdapter { - /** */ - private static String SES_CONN_KEY = "ses_conn"; - - /** */ - @CacheStoreSessionResource - private CacheStoreSession ses; - - /** {@inheritDoc} */ - @Override public void loadCache(IgniteBiInClosure clo, Object... args) { - loadCacheCnt.incrementAndGet(); - - checkSession(); - } - - /** {@inheritDoc} */ - @Override public Integer load(Integer key) throws CacheLoaderException { - loadCnt.incrementAndGet(); - - checkSession(); - - return null; - } - - /** {@inheritDoc} */ - @Override public void write(Cache.Entry entry) - throws CacheWriterException { - writeCnt.incrementAndGet(); - - checkSession(); - - if (write.get()) { - Session hibSes = ses.attachment(); - - switch (ses.cacheName()) { - case "cache1": - hibSes.save(new Table1(entry.getKey(), entry.getValue())); - - break; - - case "cache2": - if (fail.get()) - throw new CacheWriterException("Expected failure."); - - hibSes.save(new Table2(entry.getKey(), entry.getValue())); - - break; - - default: - throw new CacheWriterException("Wring cache: " + ses.cacheName()); - } - } - } - - /** {@inheritDoc} */ - @Override public void delete(Object key) throws CacheWriterException { - deleteCnt.incrementAndGet(); - - checkSession(); - } - - /** {@inheritDoc} */ - @Override public void sessionEnd(boolean commit) { - assertNull(ses.attachment()); - } - - /** - */ - private void checkSession() { - Session hibSes = ses.attachment(); - - assertNotNull(hibSes); - - assertTrue(hibSes.isOpen()); - - Transaction tx = hibSes.getTransaction(); - - assertNotNull(tx); - - if (ses.isWithinTransaction()) - assertTrue(tx.isActive()); - else - assertFalse(tx.isActive()); - - verifySameInstance(hibSes); - } - - /** - * @param hibSes Session. - */ - private void verifySameInstance(Session hibSes) { - Map props = ses.properties(); - - Session sesConn = props.get(SES_CONN_KEY); - - if (sesConn == null) - props.put(SES_CONN_KEY, hibSes); - else { - assertSame(hibSes, sesConn); - - reuseCnt.incrementAndGet(); - } - } - } - - /** - */ - @Entity - @Table(name = "Table1") - private static class Table1 implements Serializable { - /** */ - @Id @GeneratedValue - @Column(name = "id") - private Integer id; - - /** */ - @Column(name = "key") - private int key; - - /** */ - @Column(name = "value") - private int value; - - /** - * @param key Key. - * @param value Value. - */ - private Table1(int key, int value) { - this.key = key; - this.value = value; - } - } - - /** - */ - @Entity - @Table(name = "Table2") - private static class Table2 implements Serializable { - /** */ - @Id @GeneratedValue - @Column(name = "id") - private Integer id; - - /** */ - @Column(name = "key") - private int key; - - /** */ - @Column(name = "value") - private int value; - - /** - * @param key Key. - * @param value Value. - */ - private Table2(int key, int value) { - this.key = key; - this.value = value; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml ---------------------------------------------------------------------- diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml deleted file mode 100644 index 3822b31..0000000 --- a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/hibernate.cfg.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - true - - - jdbc:h2:mem:example;DB_CLOSE_DELAY=-1 - - - update - - - org.hibernate.dialect.H2Dialect - - - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/package-info.java ---------------------------------------------------------------------- diff --git a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/package-info.java b/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/package-info.java deleted file mode 100644 index 8af9886..0000000 --- a/modules/hibernate/src/test/java/org/apache/ignite/cache/store/hibernate/package-info.java +++ /dev/null @@ -1,22 +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. - */ - -/** - * - * Contains internal tests or test related classes and interfaces. - */ -package org.apache.ignite.cache.store.hibernate; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteBinaryHibernateTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteBinaryHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteBinaryHibernateTestSuite.java deleted file mode 100644 index 3791bae..0000000 --- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteBinaryHibernateTestSuite.java +++ /dev/null @@ -1,37 +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.testsuites; - -import junit.framework.TestSuite; -import org.apache.ignite.internal.binary.BinaryMarshaller; -import org.apache.ignite.testframework.config.GridTestProperties; - -/** - * - */ -public class IgniteBinaryHibernateTestSuite extends TestSuite { - /** - * @return Test suite. - * @throws Exception If failed. - */ - public static TestSuite suite() throws Exception { - GridTestProperties.setProperty(GridTestProperties.MARSH_CLASS_NAME, BinaryMarshaller.class.getName()); - - return IgniteHibernateTestSuite.suite(); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java ---------------------------------------------------------------------- diff --git a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java b/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java deleted file mode 100644 index 99fea56..0000000 --- a/modules/hibernate/src/test/java/org/apache/ignite/testsuites/IgniteHibernateTestSuite.java +++ /dev/null @@ -1,57 +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.testsuites; - -import junit.framework.TestSuite; -import org.apache.ignite.cache.hibernate.HibernateL2CacheConfigurationSelfTest; -import org.apache.ignite.cache.hibernate.HibernateL2CacheSelfTest; -import org.apache.ignite.cache.hibernate.HibernateL2CacheTransactionalSelfTest; -import org.apache.ignite.cache.hibernate.HibernateL2CacheTransactionalUseSyncSelfTest; -import org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreNodeRestartTest; -import org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreSelfTest; -import org.apache.ignite.cache.store.hibernate.CacheHibernateStoreFactorySelfTest; -import org.apache.ignite.cache.store.hibernate.CacheHibernateStoreSessionListenerSelfTest; - -/** - * Hibernate integration tests. - */ -public class IgniteHibernateTestSuite extends TestSuite { - /** - * @return Test suite. - * @throws Exception Thrown in case of the failure. - */ - public static TestSuite suite() throws Exception { - TestSuite suite = new TestSuite("Hibernate Integration Test Suite"); - - // Hibernate L2 cache. - suite.addTestSuite(HibernateL2CacheSelfTest.class); - suite.addTestSuite(HibernateL2CacheTransactionalSelfTest.class); - suite.addTestSuite(HibernateL2CacheTransactionalUseSyncSelfTest.class); - suite.addTestSuite(HibernateL2CacheConfigurationSelfTest.class); - - suite.addTestSuite(CacheHibernateBlobStoreSelfTest.class); - - suite.addTestSuite(CacheHibernateBlobStoreNodeRestartTest.class); - - suite.addTestSuite(CacheHibernateStoreSessionListenerSelfTest.class); - - suite.addTestSuite(CacheHibernateStoreFactorySelfTest.class); - - return suite; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/d992b949/modules/osgi-karaf/src/main/resources/features.xml ---------------------------------------------------------------------- diff --git a/modules/osgi-karaf/src/main/resources/features.xml b/modules/osgi-karaf/src/main/resources/features.xml index f6bdf2b..38a7df5 100644 --- a/modules/osgi-karaf/src/main/resources/features.xml +++ b/modules/osgi-karaf/src/main/resources/features.xml @@ -110,7 +110,7 @@ NOTE: Take into account that certain parts of Hibernate are offered under the LGPL license.]]> hibernate - mvn:org.apache.ignite/ignite-hibernate/${project.version} + mvn:org.apache.ignite/ignite-hibernate-5.1/${project.version}