當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。