# ignite-sprint-5 minor test change
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5f8925be Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5f8925be Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5f8925be Branch: refs/heads/ignite-745 Commit: 5f8925be6d6e1360ff56ff3c1dfff49811caef82 Parents: bbc21a6 Author: sboikov <sboi...@gridgain.com> Authored: Wed May 13 12:38:49 2015 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Wed May 13 12:38:49 2015 +0300 ---------------------------------------------------------------------- .../GridCachePartitionedTxSalvageSelfTest.java | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5f8925be/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java index 5072642..6192f39 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/GridCachePartitionedTxSalvageSelfTest.java @@ -18,7 +18,6 @@ package org.apache.ignite.internal.processors.cache.distributed.near; import org.apache.ignite.*; -import org.apache.ignite.cache.*; import org.apache.ignite.cache.affinity.rendezvous.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; @@ -35,6 +34,8 @@ import org.apache.ignite.transactions.*; import java.util.*; import static org.apache.ignite.IgniteSystemProperties.*; +import static org.apache.ignite.cache.CacheMode.*; +import static org.apache.ignite.cache.CacheRebalanceMode.*; import static org.apache.ignite.transactions.TransactionConcurrency.*; import static org.apache.ignite.transactions.TransactionIsolation.*; @@ -76,10 +77,10 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes CacheConfiguration cc = defaultCacheConfiguration(); - cc.setCacheMode(CacheMode.PARTITIONED); + cc.setCacheMode(PARTITIONED); cc.setAffinity(new RendezvousAffinityFunction(false, 18)); cc.setBackups(1); - cc.setRebalanceMode(CacheRebalanceMode.SYNC); + cc.setRebalanceMode(SYNC); c.setCacheConfiguration(cc); @@ -109,8 +110,9 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes /** {@inheritDoc} */ @Override protected void afterTest() throws Exception { - // Shutwodn the gird. stopAllGrids(); + + System.gc(); } /** @@ -145,8 +147,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes * Check whether caches has no transactions after salvage timeout. * * @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC). - * @param prepare Whether to preapre transaction state - * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}). + * @param prepare Whether to prepare transaction state + * (i.e. call {@link IgniteInternalTx#prepare()}). * @throws Exception If failed. */ private void checkSalvageAfterTimeout(TransactionConcurrency mode, boolean prepare) throws Exception { @@ -164,8 +166,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes * Check whether caches still has all transactions before salvage timeout. * * @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC). - * @param prepare Whether to preapre transaction state - * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}). + * @param prepare Whether to prepare transaction state + * (i.e. call {@link IgniteInternalTx#prepare()}). * @throws Exception If failed. */ private void checkSalvageBeforeTimeout(TransactionConcurrency mode, boolean prepare) throws Exception { @@ -191,8 +193,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes * Start new transaction on the grid(0) and put some keys to it. * * @param mode Transaction mode (PESSIMISTIC, OPTIMISTIC). - * @param prepare Whether to preapre transaction state - * (i.e. call {@link org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx#prepare()}). + * @param prepare Whether to prepare transaction state + * (i.e. call {@link IgniteInternalTx#prepare()}). * @throws Exception If failed. */ private void startTxAndPutKeys(final TransactionConcurrency mode, final boolean prepare) throws Exception { @@ -210,9 +212,8 @@ public class GridCachePartitionedTxSalvageSelfTest extends GridCommonAbstractTes for (Integer key : keys) c.put(key, "val" + key); - // Unproxy. if (prepare) - U.<IgniteInternalTx>field(tx, "tx").prepare(); + ((TransactionProxyImpl)tx).tx().prepare(); } catch (IgniteCheckedException e) { info("Failed to put keys to cache: " + e.getMessage());