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


Java Assume.assumeThat方法代码示例

本文整理汇总了Java中org.junit.Assume.assumeThat方法的典型用法代码示例。如果您正苦于以下问题:Java Assume.assumeThat方法的具体用法?Java Assume.assumeThat怎么用?Java Assume.assumeThat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.junit.Assume的用法示例。


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

示例1: test_shouldListModules

import org.junit.Assume; //导入方法依赖的package包/类
@Test
public void test_shouldListModules() {
    connect();
    createApplication();
    try {
        CommandResult result = addModule("mysql-5-5");
        Assume.assumeThat(result, isSuccessfulCommand());
        
        result = displayModules();
        
        assertThat(result, isSuccessfulCommand());
        assertThat(result.getResult().toString(), containsString("1"));
        assertThat(result.getResult().toString(), containsString("found"));
    } finally {
        removeApplication();
        disconnect();
    }
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:19,代码来源:AbstractModuleCommandsIT.java

示例2: createShortCircuitConf

import org.junit.Assume; //导入方法依赖的package包/类
private static Configuration createShortCircuitConf(String testName,
    TemporarySocketDirectory sockDir) {
  Configuration conf = new Configuration();
  conf.set(DFS_CLIENT_CONTEXT, testName);
  conf.setLong(DFS_BLOCK_SIZE_KEY, 4096);
  conf.set(DFS_DOMAIN_SOCKET_PATH_KEY, new File(sockDir.getDir(),
      testName).getAbsolutePath());
  conf.setBoolean(DFS_CLIENT_READ_SHORTCIRCUIT_KEY, true);
  conf.setBoolean(DFS_CLIENT_READ_SHORTCIRCUIT_SKIP_CHECKSUM_KEY,
      false);
  conf.setBoolean(DFS_CLIENT_DOMAIN_SOCKET_DATA_TRAFFIC, false);
  DFSInputStream.tcpReadsDisabledForTesting = true;
  DomainSocket.disableBindPathValidation();
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
  return conf;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestShortCircuitCache.java

示例3: testUpdate

import org.junit.Assume; //导入方法依赖的package包/类
@Test
public void testUpdate() {
    Assume.assumeThat(before, customMatcher);
    Assume.assumeThat(after, customMatcher);

    Collection<Diff> diffs = diffCalculator.apply(before, after, null);
    Assert.assertNotNull("Response should be non-null", diffs);
    Assert.assertFalse("Response should not be empty", diffs.isEmpty());
    Assert.assertEquals("It should be updated", ChangeType.UPDATED, diffs.iterator().next().getChangeType());
}
 
开发者ID:PareshNavalakha,项目名称:object-diff,代码行数:11,代码来源:AbstractCalculatorTest.java

示例4: checkServerRunning

import org.junit.Assume; //导入方法依赖的package包/类
private void checkServerRunning() {

		try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
			CloseableHttpResponse response = client.execute(new HttpGet(baseUrl + PING_PATH));
			if (response != null && response.getStatusLine() != null) {
				Assume.assumeThat(response.getStatusLine().getStatusCode(), Is.is(200));
			}
		} catch (IOException e) {
			throw new AssumptionViolatedException("SolrServer does not seem to be running", e);
		}
	}
 
开发者ID:Just-Fun,项目名称:spring-data-examples,代码行数:12,代码来源:RequiresSolrServer.java

示例5: testShortCircuitReadAfterEviction

import org.junit.Assume; //导入方法依赖的package包/类
@Test
public void testShortCircuitReadAfterEviction()
    throws IOException, InterruptedException {
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
  startUpCluster(true, 1 + EVICTION_LOW_WATERMARK, true, false);
  doShortCircuitReadAfterEvictionTest();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestScrLazyPersistFiles.java

示例6: testShortCircuitReadBlockFileCorruption

import org.junit.Assume; //导入方法依赖的package包/类
@Test
public void testShortCircuitReadBlockFileCorruption() throws IOException,
    InterruptedException {
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
  startUpCluster(true, 1 + EVICTION_LOW_WATERMARK, true, false);
  doShortCircuitReadBlockFileCorruptionTest();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestScrLazyPersistFiles.java

示例7: testShortCircuitReadMetaFileCorruption

import org.junit.Assume; //导入方法依赖的package包/类
@Test
public void testShortCircuitReadMetaFileCorruption() throws IOException,
    InterruptedException {
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
  startUpCluster(true, 1 + EVICTION_LOW_WATERMARK, true, false);
  doShortCircuitReadMetaFileCorruptionTest();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestScrLazyPersistFiles.java

示例8: before

import org.junit.Assume; //导入方法依赖的package包/类
@Before
public void before() {
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:5,代码来源:TestParallelShortCircuitReadUnCached.java

示例9: before

import org.junit.Assume; //导入方法依赖的package包/类
@Before
public void before() {
  Assume.assumeThat(NativeCodeLoader.isNativeCodeLoaded() && !Path.WINDOWS,
      equalTo(true));
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:7,代码来源:TestScrLazyPersistFiles.java

示例10: init

import org.junit.Assume; //导入方法依赖的package包/类
@Before
public void init() {
  DomainSocket.disableBindPathValidation();
  Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:TestBlockReaderFactory.java

示例11: testAuthenticatedClientsAllowed

import org.junit.Assume; //导入方法依赖的package包/类
@Test public void testAuthenticatedClientsAllowed() throws Exception {
  Assume.assumeThat("Test disabled on Windows", File.separatorChar, is('/'));

  // Create the subject for the client
  final Subject clientSubject = AvaticaJaasKrbUtil.loginUsingKeytab(
      SpnegoTestUtil.CLIENT_PRINCIPAL, clientKeytab);
  final Set<Principal> clientPrincipals = clientSubject.getPrincipals();
  // Make sure the subject has a principal
  assertFalse(clientPrincipals.isEmpty());

  // Get a TGT for the subject (might have many, different encryption types). The first should
  // be the default encryption type.
  Set<KerberosTicket> privateCredentials =
          clientSubject.getPrivateCredentials(KerberosTicket.class);
  assertFalse(privateCredentials.isEmpty());
  KerberosTicket tgt = privateCredentials.iterator().next();
  assertNotNull(tgt);
  LOG.info("Using TGT with etype: {}", tgt.getSessionKey().getAlgorithm());

  // The name of the principal
  final String principalName = clientPrincipals.iterator().next().getName();

  // Run this code, logged in as the subject (the client)
  byte[] response = Subject.doAs(clientSubject, new PrivilegedExceptionAction<byte[]>() {
    @Override public byte[] run() throws Exception {
      // Logs in with Kerberos via GSS
      GSSManager gssManager = GSSManager.getInstance();
      Oid oid = new Oid(SpnegoTestUtil.JGSS_KERBEROS_TICKET_OID);
      GSSName gssClient = gssManager.createName(principalName, GSSName.NT_USER_NAME);
      GSSCredential credential = gssManager.createCredential(gssClient,
          GSSCredential.DEFAULT_LIFETIME, oid, GSSCredential.INITIATE_ONLY);

      // Passes the GSSCredential into the HTTP client implementation
      final AvaticaCommonsHttpClientSpnegoImpl httpClient =
          new AvaticaCommonsHttpClientSpnegoImpl(httpServerUrl, credential);

      return httpClient.send(new byte[0]);
    }
  });

  // We should get a response which is "OK" with our client's name
  assertNotNull(response);
  assertEquals("OK " + SpnegoTestUtil.CLIENT_PRINCIPAL,
      new String(response, StandardCharsets.UTF_8));
}
 
开发者ID:apache,项目名称:calcite-avatica,代码行数:46,代码来源:HttpServerSpnegoWithJaasTest.java


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