本文整理汇总了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();
}
}
示例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;
}
示例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());
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例8: before
import org.junit.Assume; //导入方法依赖的package包/类
@Before
public void before() {
Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
}
示例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));
}
示例10: init
import org.junit.Assume; //导入方法依赖的package包/类
@Before
public void init() {
DomainSocket.disableBindPathValidation();
Assume.assumeThat(DomainSocket.getLoadingFailureReason(), equalTo(null));
}
示例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));
}