コード例 #1
0
  /** @throws Exception If failed. */
  public void testNotReuseCache() throws Exception {
    CollectionConfiguration colCfg1 = collectionConfiguration();

    CollectionConfiguration colCfg2 = collectionConfiguration();

    if (colCfg2.getAtomicityMode() == ATOMIC) colCfg2.setAtomicityMode(TRANSACTIONAL);
    else colCfg2.setAtomicityMode(ATOMIC);

    IgniteQueue queue1 = grid(0).queue("Queue1", 0, colCfg1);

    IgniteQueue queue2 = grid(0).queue("Queue2", 0, colCfg2);

    assertNotSame(getQueueCache(queue1), getQueueCache(queue2));
  }
コード例 #2
0
  /** @throws Exception If failed. */
  public void testFilterNode() throws Exception {
    CollectionConfiguration colCfg1 = collectionConfiguration();

    CollectionConfiguration colCfg2 = collectionConfiguration();

    colCfg2.setNodeFilter(CacheConfiguration.ALL_NODES);

    IgniteQueue queue1 = grid(0).queue("Queue1", 0, colCfg1);

    IgniteQueue queue2 = grid(0).queue("Queue2", 0, colCfg2);

    assertNotSame(getQueueCache(queue1), getQueueCache(queue2));

    colCfg1.setNodeFilter(CacheConfiguration.ALL_NODES);

    IgniteQueue queue3 = grid(0).queue("Queue3", 0, colCfg1);

    assertEquals(getQueueCache(queue2), getQueueCache(queue3));
  }