Fixed test. Cache doesn't start in transaction.

Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/e158c90f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/e158c90f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/e158c90f

Branch: refs/heads/ignite-648-win
Commit: e158c90fe58082e00d97f26c5bb3ae450906fc6a
Parents: fe1750d
Author: nikolay_tikhonov <ntikho...@gridgain.com>
Authored: Fri Jun 12 17:11:27 2015 +0300
Committer: nikolay_tikhonov <ntikho...@gridgain.com>
Committed: Fri Jun 12 17:11:27 2015 +0300

----------------------------------------------------------------------
 .../cache/IgniteCacheP2pUnmarshallingTxErrorTest.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/e158c90f/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
----------------------------------------------------------------------
diff --git 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
index a4e2753..017f7db 100644
--- 
a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
+++ 
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheP2pUnmarshallingTxErrorTest.java
@@ -50,9 +50,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends 
IgniteCacheP2pUnmars
      * Sends put with optimistic lock and handles fail.
      */
     protected void failOptimistic() {
-        try (Transaction tx = 
grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC, 
TransactionIsolation.REPEATABLE_READ)) {
+        IgniteCache<Object, Object> cache = jcache(0);
 
-            jcache(0).put(new TestKey(String.valueOf(++key)), "");
+        try (Transaction tx = 
grid(0).transactions().txStart(TransactionConcurrency.OPTIMISTIC,
+            TransactionIsolation.REPEATABLE_READ)) {
+
+            cache.put(new TestKey(String.valueOf(++key)), "");
 
             tx.commit();
 
@@ -69,9 +72,12 @@ public class IgniteCacheP2pUnmarshallingTxErrorTest extends 
IgniteCacheP2pUnmars
      * Sends put with pessimistic lock and handles fail.
      */
     protected void failPessimictic() {
-        try (Transaction tx = 
grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC, 
TransactionIsolation.REPEATABLE_READ)) {
+        IgniteCache<Object, Object> cache = jcache(0);
+
+        try (Transaction tx = 
grid(0).transactions().txStart(TransactionConcurrency.PESSIMISTIC,
+            TransactionIsolation.REPEATABLE_READ)) {
 
-            jcache(0).put(new TestKey(String.valueOf(++key)), "");
+            cache.put(new TestKey(String.valueOf(++key)), "");
 
             assert false : "p2p marshalling failed, but error response was not 
sent";
         }

Reply via email to