当前位置: 首页>>代码示例>>Java>>正文


Java Category类代码示例

本文整理汇总了Java中org.junit.experimental.categories.Category的典型用法代码示例。如果您正苦于以下问题:Java Category类的具体用法?Java Category怎么用?Java Category使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Category类属于org.junit.experimental.categories包,在下文中一共展示了Category类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testUnwritableRemoveContainerPipeline

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Test
@Category(NeedsRunner.class)
public void testUnwritableRemoveContainerPipeline() throws Exception {

    final Map<String, String> dataConfiguration = singletonMap("repository",
            getClass().getResource("/dataDirectory2").toURI().toString());

    final File root = new File(getClass().getResource("/dataDirectory2").toURI());

    assumeTrue(root.setReadOnly());

    final PCollection<KV<String, String>> pCollection = pipeline
        .apply("Create", Create.of(CONTAINER_KV))
        .apply(ParDo.of(new BeamProcessor(dataConfiguration, LDP.PreferContainment.getIRIString(), false)));

    PAssert.that(pCollection).empty();

    pipeline.run();
    root.setWritable(true);
}
 
开发者ID:trellis-ldp-archive,项目名称:trellis-rosid-file-streaming,代码行数:21,代码来源:BeamProcessorTest.java

示例2: testAddLabeledResultSetWithNullResultSet

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Check that we throw as expected when trying to add a LabeledResultSet with a null ResultSet underneath.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public final void testAddLabeledResultSetWithNullResultSet() throws SQLException {
    // What we're doing:
    // Set up a new sharded reader
    // Add two readers to it.
    // Try to add a third reader to it that has a null ResultSet underneath.
    // Verify that we threw as expected.
    String selectSql = "SELECT dbNameField, Test_int_Field, Test_bigint_Field" + " FROM ConsistentShardedTable WHERE Test_int_Field = 876";
    LabeledResultSet[] readers = new LabeledResultSet[3];
    readers[0] = getReader(conn1, selectSql, "Test0");
    readers[1] = getReader(conn2, selectSql, "Test1");

    SqlConnectionStringBuilder str = new SqlConnectionStringBuilder(conn3.getMetaData().getURL());
    ResultSet res = null;
    try {
        readers[2] = new LabeledResultSet(res, new ShardLocation(str.getDataSource(), "Test2"), conn3.createStatement());
    }
    catch (IllegalArgumentException ex) {
        assert ex.getMessage().equals("resultSet");
    }
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:26,代码来源:MultiShardResultSetTests.java

示例3: deleteShardDefault

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Remove existing shard from shard map.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public void deleteShardDefault() {
    ShardMapManager smm = ShardMapManagerFactory.getSqlShardMapManager(Globals.SHARD_MAP_MANAGER_CONN_STRING, ShardMapManagerLoadPolicy.Lazy);
    ShardMap sm = smm.getShardMap(ShardMapTests.defaultShardMapName);
    assertNotNull(sm);

    ShardLocation s1 = new ShardLocation(Globals.TEST_CONN_SERVER_NAME, ShardMapTests.shardDbs[0]);

    Shard shardNew = sm.createShard(s1);

    assertNotNull(shardNew);

    sm.deleteShard(shardNew);

    ReferenceObjectHelper<Shard> refShard = new ReferenceObjectHelper<>(shardNew);
    sm.tryGetShard(s1, refShard);
    assertNull(refShard.argValue);
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:23,代码来源:ShardMapTests.java

示例4: test009SearchByTitle

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(CategoryAppStoreTests_v3_3_15.class)
@Test
public void test009SearchByTitle() throws UiObjectNotFoundException {
    TestUtils.screenshotCap("appStoreHome");
    UiObject2 hotOne = device.findObject(By.res("woyou.market:id/linear_hot_view")).findObject(By.res("woyou.market:id/tv_name"));
    String targetAppName = hotOne.getText();
    UiObject2 searchObj = device.findObject(By.res("woyou.market:id/tv_search").text("搜索"));
    searchObj.click();
    TestUtils.screenshotCap("afterClickSearchBar");
    TestUtils.sleep(SHORT_SLEEP);
    UiObject2 searchObj1 = device.findObject(By.res("woyou.market:id/et_search").text("搜索").focused(true));
    searchObj1.click();
    searchObj1.setText(targetAppName);
    TestUtils.screenshotCap("inputSearchContent");
    UiScrollable appList = new UiScrollable(new UiSelector().resourceId("woyou.market:id/list_view"));
    UiObject appInfo = appList.getChildByInstance(new UiSelector().className("android.widget.FrameLayout"),0);
    UiObject appNameObj = appInfo.getChild(new UiSelector().resourceId("woyou.market:id/tv_name"));
    Assert.assertEquals(targetAppName,appNameObj.getText());
}
 
开发者ID:sunmiqa,项目名称:SunmiAuto,代码行数:20,代码来源:SunmiAppStore_v3_3_15.java

示例5: testCreateDestroyValidRegion

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(FlakyTest.class) // GEODE-1922
@Test
public void testCreateDestroyValidRegion() throws InterruptedException {
  Cache serverCache = getCache();
  serverCache.createRegionFactory(RegionShortcut.REPLICATE).create(GOOD_REGION_NAME);

  try {
    startServer(serverCache);
  } catch (IOException e) {
    fail(e.getMessage());
  }
  client1.invoke(() -> {
    ClientCache cache = new ClientCacheFactory(createClientProperties())
        .setPoolSubscriptionEnabled(true).addPoolServer("localhost", serverPort).create();
    Region region =
        cache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(GOOD_REGION_NAME);
    region.destroyRegion();
    assertThat(region.isDestroyed()).isTrue();
  });
}
 
开发者ID:ampool,项目名称:monarch,代码行数:21,代码来源:RegionCreateDestroyDUnitTest.java

示例6: test025CommentAfterInstall

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(CategoryAppStoreTests_v3_3_15.class)
@Test
public void test025CommentAfterInstall() throws UiObjectNotFoundException {
    TestUtils.screenshotCap("appStoreHome");
    UiObject2 hotObj = device.findObject(By.res("woyou.market:id/tv_hot_all").text("全部"));
    hotObj.clickAndWait(Until.newWindow(), LONG_WAIT);
    TestUtils.screenshotCap("hotAllInterface");
    UiScrollable hotAllScroll = new UiScrollable(new UiSelector().resourceId("woyou.market:id/list_view"));
    hotAllScroll.scrollIntoView(new UiSelector().resourceId("woyou.market:id/id_tv_install_view").text("打开"));
    UiObject2 installObj = device.findObject(By.res("woyou.market:id/id_tv_install_view").text("打开"));
    UiObject2 fullAppObj = installObj.getParent().getParent();
    fullAppObj.clickAndWait(Until.newWindow(),LONG_WAIT);
    TestUtils.screenshotCap("enterAppDetail");
    UiObject2 commentObj = device.findObject(By.res("woyou.market:id/tv_install_comment_app"));
    commentObj.clickAndWait(Until.newWindow(),LONG_WAIT);
    device.wait(Until.hasObject(By.res("woyou.market:id/rating_bar")),LONG_WAIT);
    TestUtils.screenshotCap("afterClickComment");
    UiObject2 rateObj = device.findObject(By.res("woyou.market:id/rating_bar"));
    Assert.assertNotNull(rateObj);
    device.pressBack();
}
 
开发者ID:sunmiqa,项目名称:SunmiAuto,代码行数:22,代码来源:SunmiAppStore_v3_3_15.java

示例7: createRangeShardMapDuplicate

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Add a range shard map with duplicate name to shard map manager.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public void createRangeShardMapDuplicate() throws Exception {
    ShardMapManager smm = ShardMapManagerFactory.getSqlShardMapManager(Globals.SHARD_MAP_MANAGER_CONN_STRING, ShardMapManagerLoadPolicy.Lazy);
    ShardMap sm = smm.createRangeShardMap(ShardMapManagerTests.shardMapName, ShardKeyType.Int32);
    assertNotNull(sm);

    assertEquals(ShardMapManagerTests.shardMapName, sm.getName());

    boolean creationFailed = false;

    try {
        RangeShardMap<Integer> rsm = smm.createRangeShardMap(ShardMapManagerTests.shardMapName, ShardKeyType.Int32);

    }
    catch (ShardManagementException sme) {
        assertEquals(ShardManagementErrorCategory.ShardMapManager, sme.getErrorCategory());
        assertEquals(ShardManagementErrorCode.ShardMapAlreadyExists, sme.getErrorCode());
        creationFailed = true;
    }
    assertTrue(creationFailed);
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:26,代码来源:ShardMapManagerTests.java

示例8: testPeriodicAckSendByClientPrimaryFailover

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * If the primary fails before receiving an ack from the messages it delivered then it should send
 * an ack to the new primary so that new primary can sends QRM to other redundant servers.
 */
@Category(FlakyTest.class) // GEODE-694: async queuing
@Test
public void testPeriodicAckSendByClientPrimaryFailover() throws Exception {
  IgnoredException.addIgnoredException("java.net.ConnectException");
  createEntries();
  setClientServerObserverForBeforeSendingClientAck();
  server1.invoke(() -> ReliableMessagingDUnitTest.putOnServer());
  LogWriterUtils.getLogWriter().info("Entering waitForServerUpdate");
  waitForServerUpdate();
  LogWriterUtils.getLogWriter().info("Entering waitForCallback");
  waitForCallback();
  LogWriterUtils.getLogWriter().info("Entering waitForClientAck");
  waitForClientAck();
  server2.invoke(() -> ReliableMessagingDUnitTest.checkTidAndSeq());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:20,代码来源:ReliableMessagingDUnitTest.java

示例9: testReadAsync

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Validate basic ReadAsync behavior.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public final void testReadAsync() throws SQLException {
    LabeledResultSet[] readers = new LabeledResultSet[1];
    readers[0] = getReader(conn1, "select 1", "Test0");
    int numRowsRead = 0;

    try (MultiShardResultSet sdr = new MultiShardResultSet(Arrays.asList(readers))) {
        while (sdr.next()) {
            numRowsRead++;
        }
    }
    catch (Exception e) {
        Assert.fail(e.getMessage());
    }
    Assert.assertEquals("ReadAsync didn't return the expeceted number of rows.", 1, numRowsRead);
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:21,代码来源:MultiShardResultSetTests.java

示例10: whenMultipleEnumBindParametersAreUsedWithInQueryAndMapIndexIsPresentReturnCorrectResults

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(FlakyTest.class) // GEODE-1771
@Test
public void whenMultipleEnumBindParametersAreUsedWithInQueryAndMapIndexIsPresentReturnCorrectResults()
    throws CacheException {
  final int numberOfEntries = 10;
  final int numExpectedResults = numberOfEntries / 2;
  final String queryString =
      "select * from " + regName + " where getMapField['1'] in SET ($1,$2)";

  vm0.invoke(new CacheSerializableRunnable("Create Bridge Server") {
    public void run2() throws CacheException {
      configAndStartBridgeServer();
      createReplicateRegion();
      createIndex("myIndex", "ts.getMapField[*]", regName + " ts");
      createEntries(numberOfEntries, regionName);
    }
  });

  Object[] bindArguments = new Object[] {DayEnum.MONDAY, DayEnum.TUESDAY};
  vm1.invoke(executeQueryWithIndexOnReplicateRegion(numExpectedResults, queryString,
      bindArguments, "myIndex", "ts.getMapField[*]", regName + " ts"));
}
 
开发者ID:ampool,项目名称:monarch,代码行数:23,代码来源:CompiledInDUnitTest.java

示例11: createListShardMapDefault

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Create list shard map.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public void createListShardMapDefault() throws Exception {
    CountingCacheStore cacheStore = new CountingCacheStore(new CacheStore());

    ShardMapManager smm = new ShardMapManager(new SqlShardMapManagerCredentials(Globals.SHARD_MAP_MANAGER_CONN_STRING),
            new SqlStoreConnectionFactory(), new StoreOperationFactory(), cacheStore, ShardMapManagerLoadPolicy.Lazy,
            RetryPolicy.getDefaultRetryPolicy(), RetryBehavior.getDefaultRetryBehavior());

    ListShardMap<Integer> lsm = smm.createListShardMap(ShardMapManagerTests.shardMapName, ShardKeyType.Int32);

    assertNotNull(lsm);

    ShardMap smLookup = smm.lookupShardMapByName("LookupShardMapByName", ShardMapManagerTests.shardMapName, true);
    assertNotNull(smLookup);
    assertEquals(ShardMapManagerTests.shardMapName, smLookup.getName());
    assertEquals(1, cacheStore.getLookupShardMapCount());
    assertEquals(1, cacheStore.getLookupShardMapHitCount());
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:23,代码来源:ShardMapManagerTests.java

示例12: testRollOfA3EasyMock

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Test
@Category(value=UnitTest.class)
public void testRollOfA3EasyMock() {
	Random mock = createMock(Random.class);

	// rehearse
	expect(mock.nextInt(6)).andReturn(2);

	// replay(EasyMock Only)
	replay(mock);

	// run test
	Die die = new JavaRandomDie(mock);
	Die copyDie = die.roll();
	assertThat(copyDie.getPips()).isEqualTo(3);

	// verify
	verify(mock);
}
 
开发者ID:dhinojosa,项目名称:tddinjava_2017-08-14,代码行数:20,代码来源:JavaRandomDieTest.java

示例13: testQueryShardsInvalidShardStateSync

import org.junit.experimental.categories.Category; //导入依赖的package包/类
/**
 * Close the connection to one of the shards behind MultiShardConnection's back. Verify that we reopen the connection with the built-in retry
 * policy.
 */
@Test
@Category(value = ExcludeFromGatedCheckin.class)
public final void testQueryShardsInvalidShardStateSync() throws Exception {
    // Get a shard and close it's connection
    List<Pair<ShardLocation, Connection>> shardConnections = shardConnection.getShardConnections();
    try {
        shardConnections.get(1).getRight().close();
        // Execute
        try (MultiShardStatement stmt = shardConnection.createCommand()) {
            stmt.setCommandText("SELECT dbNameField, Test_int_Field, Test_bigint_Field  FROM ConsistentShardedTable");

            try (MultiShardResultSet sdr = stmt.executeQuery()) {
                sdr.close();
            }
        }
    }
    catch (Exception ex) {
        log.info("Exception encountered: " + ex.getMessage());
        Assert.fail(ex.toString());
    }
}
 
开发者ID:Microsoft,项目名称:elastic-db-tools-for-java,代码行数:26,代码来源:MultiShardQueryE2ETests.java

示例14: testCreateSpeedSingleTxn

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(PerformanceTests.class)
public void testCreateSpeedSingleTxn()
{
    RetryingTransactionCallback<List<Pair<Long, ContentData>>> writeCallback = new RetryingTransactionCallback<List<Pair<Long, ContentData>>>()
    {
        public List<Pair<Long, ContentData>> execute() throws Throwable
        {
            return speedTestWrite(getName(), 10000);
        }
    };
    final List<Pair<Long, ContentData>> pairs = txnHelper.doInTransaction(writeCallback, false, false);
    RetryingTransactionCallback<Void> readCallback = new RetryingTransactionCallback<Void>()
    {
        public Void execute() throws Throwable
        {
            speedTestRead(getName(), pairs);
            return null;
        }
    };
    txnHelper.doInTransaction(readCallback, false, false);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:ContentDataDAOTest.java

示例15: testPut

import org.junit.experimental.categories.Category; //导入依赖的package包/类
@Category(FlakyTest.class) // GEODE-1139: time sensitive, thread sleep, expiration
@Test
public void testPut() throws Exception {

  System.setProperty(LocalRegion.EXPIRY_MS_PROPERTY, "true");
  try {
    final Region r =
        this.cache.createRegionFactory(RegionShortcut.LOCAL).setStatisticsEnabled(true)
            .setCustomEntryTimeToLive(new CustomExpiryTestClass()).create("bug44418");

    r.put(TEST_KEY, "longExpire");
    // should take LONG_WAIT_MS to expire.

    // Now update it with a short time to live
    r.put(TEST_KEY, "quickExpire");

    if (!awaitExpiration(r, TEST_KEY)) {
      fail(SHORT_WAIT_MS + " ms expire did not happen after waiting " + TEST_WAIT_MS + " ms");
    }
  } finally {
    System.getProperties().remove(LocalRegion.EXPIRY_MS_PROPERTY);
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:24,代码来源:Bug44418JUnitTest.java


注:本文中的org.junit.experimental.categories.Category类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。