本文整理匯總了Java中org.junit.jupiter.api.Disabled類的典型用法代碼示例。如果您正苦於以下問題:Java Disabled類的具體用法?Java Disabled怎麽用?Java Disabled使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Disabled類屬於org.junit.jupiter.api包,在下文中一共展示了Disabled類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldProcessDynamicTestLabels
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled("not implemented")
void shouldProcessDynamicTestLabels() {
runClasses(DynamicTests.class);
final List<TestResult> testResults = results.getTestResults();
assertThat(testResults)
.hasSize(3)
.flatExtracting(TestResult::getLabels)
.extracting(Label::getValue)
.contains(
"epic1", "epic2", "epic3",
"feature1", "feature2", "feature3",
"story1", "story2", "story3",
"some-owner"
);
}
示例2: testGetJobs
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled
@Test
public void testGetJobs() throws Exception {
Set<String> jobNames = new HashSet<>();
jobNames.add("job1");
jobNames.add("job2");
jobNames.add("job3");
Long job1Id = 1L;
Long job2Id = 2L;
List<Long> jobExecutions = new ArrayList<>();
jobExecutions.add(job1Id);
JobInstance jobInstance = new JobInstance(job1Id, "job1");
expect(jobOperator.getJobNames()).andReturn(jobNames).anyTimes();
expect(jobOperator.getJobInstances(eq("job1"), eq(0), eq(1))).andReturn(jobExecutions);
expect(jobExplorer.getJobInstance(eq(job1Id))).andReturn(jobInstance);
// expect(jobOperator.getJobInstances(eq("job2"), eq(0), eq(1))).andReturn(null);
replayAll();
assertThat(service.getJobs(), nullValue());
}
示例3: testCycleReference
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled
@Test
void testCycleReference() {
final SimpleModule module = module();
module.accept(service().forClass(A.class).forConstructor().withParameters(B.class, C.class).build());
module.accept(service()
.forClass(B.class).forConstructor()
.postConstruct().method().withName("setA").withParameters(A.class).build());
module.accept(service()
.forClass(C.class).forConstructor()
.postConstruct().method().withName("setB").withParameters(B.class).build());
final A actual = module.locate(A.class).get();
assertThat(actual).isNotNull();
assertThat(actual.getB()).isNotNull();
assertThat(actual.getB().getA()).isNotNull();
assertThat(actual.getC()).isNotNull();
assertThat(actual.getC().getB()).isNotNull();
}
示例4: testMethodReflectorFactoryClassName
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled("Unsupported")
public void testMethodReflectorFactoryClassName() {
String EXPECTED = "eu.mikroskeem.shuriken.instrumentation.methodreflector." +
"Target$TestClass3$MethodReflectorTester$DummyInterface2$0";
TestClass3 tc = new TestClass3();
ClassWrapper<TestClass3> tcWrap = wrapInstance(tc);
String MRF_CLASS = "eu.mikroskeem.shuriken.instrumentation.methodreflector.MethodReflectorFactory";
ClassWrapper<?> mrfClass = Reflect.getClass(MRF_CLASS).get();
ClassWrapper<?> mrf = wrapInstance(wrapClass(MethodReflector.class).getField("factory", mrfClass).get().read());
String className = mrf.invokeMethod("generateName",
String.class,
TypeWrapper.of(tcWrap),
TypeWrapper.of(DummyInterface2.class));
Assertions.assertEquals(EXPECTED, className, "Class names should equal");
}
示例5: shouldEventuallyCleanUpExpiredKeys
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled
void shouldEventuallyCleanUpExpiredKeys() throws Exception {
ImmutableSet<RequestLimitRule> rules = ImmutableSet.of(RequestLimitRule.of(1, TimeUnit.SECONDS, 5));
RequestRateLimiter requestRateLimiter = getRateLimiter(rules, timeBandit);
String key = "ip:127.0.0.5";
IntStream.rangeClosed(1, 5).forEach(value -> {
timeBandit.addUnixTimeMilliSeconds(100L);
assertThat(requestRateLimiter.overLimitWhenIncremented(key)).isFalse();
});
while (expiryingKeyMap.size() != 0) {
Thread.sleep(50);
}
assertThat(expiryingKeyMap.size()).isZero();
}
示例6: firstFlow
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled
@DisplayName("Create tasks concurrently and retrieve projection")
void firstFlow() throws InterruptedException {
final TodoClient[] clients = getClients();
final int numberOfRequests = 100;
asyncPerformanceTest(iterationNumber -> {
final CreateBasicTask basicTask = createBasicTask();
clients[iterationNumber % clients.length].postCommand(basicTask);
}, numberOfRequests);
final List<TaskItem> taskItems = getClient().getMyListView()
.getMyList()
.getItemsList();
final int expected = numberOfRequests;
assertEquals(expected, taskItems.size());
}
示例7: canLogout
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled
@Test
public void canLogout() {
HttpResponse response = post("logout", null);
assertThat(response.getStatusCode(), is(HttpResponseStatus.FORBIDDEN.code()));
assertThat(response.getStatusMessage(), is(HttpResponseStatus.UNAUTHORIZED.reasonPhrase()));
}
示例8: testCumulativeCounters
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled("CI is failing often asserting that the count is 23")
@Test
void testCumulativeCounters() throws Exception {
HystrixCommandKey key = HystrixCommandKey.Factory.asKey("MicrometerCOMMAND-A");
HystrixCommandProperties properties = new HystrixPropertiesCommandDefault(key, propertiesSetter);
HystrixCommandMetrics metrics = HystrixCommandMetrics.getInstance(key, groupKey, properties);
HystrixCircuitBreaker circuitBreaker = HystrixCircuitBreaker.Factory.getInstance(key, groupKey, properties, metrics);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
MicrometerMetricsPublisherCommand metricsPublisherCommand = new MicrometerMetricsPublisherCommand(registry, key, groupKey, metrics, circuitBreaker, properties);
metricsPublisherCommand.initialize();
for (int i = 0; i < 3; i++) {
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
Thread.sleep(10);
new TimeoutCommand(key).execute();
new SuccessCommand(key).execute();
new FailureCommand(key).execute();
new FailureCommand(key).execute();
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
Thread.sleep(10);
new SuccessCommand(key).execute();
}
List<Tag> tags = Tags.zip("group", "MicrometerGROUP", "key", "MicrometerCOMMAND-A");
assertExecutionMetric(registry, "success", 24.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "timeout").functionCounter().count()).isEqualTo(3.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "failure").functionCounter().count()).isEqualTo(6.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "short_circuited").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.mustFind("hystrix.circuit.breaker.open").tags(tags).gauge().value()).isEqualTo(0.0);
}
示例9: testOpenCircuit
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled
@Test
void testOpenCircuit() throws Exception {
HystrixCommandKey key = HystrixCommandKey.Factory.asKey("MicrometerCOMMAND-B");
HystrixCommandProperties properties = new HystrixPropertiesCommandDefault(key, propertiesSetter.withCircuitBreakerForceOpen(true));
HystrixCommandMetrics metrics = HystrixCommandMetrics.getInstance(key, groupKey, properties);
HystrixCircuitBreaker circuitBreaker = HystrixCircuitBreaker.Factory.getInstance(key, groupKey, properties, metrics);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
MicrometerMetricsPublisherCommand metricsPublisherCommand = new MicrometerMetricsPublisherCommand(registry, key, groupKey, metrics, circuitBreaker, properties);
metricsPublisherCommand.initialize();
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
new TimeoutCommand(key).execute();
new FailureCommand(key).execute();
new FailureCommand(key).execute();
new SuccessCommand(key).execute();
List<Tag> tags = Tags.zip("group", groupKey.name(), "key", key.name());
assertExecutionMetric(registry, "short_circuited", 6.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "success").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "timeout").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.mustFind("hystrix.execution").tags(tags).tags("event", "failure").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.mustFind("hystrix.fallback").tags(tags).tags("event", "fallback_success").functionCounter().count()).isEqualTo(6.0);
assertThat(registry.mustFind("hystrix.circuit.breaker.open").tags(tags).gauge().value()).isEqualTo(1.0);
}
示例10: testNamedAnnotations
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled("javax.inject.Named isn't supported yet")
public void testNamedAnnotations() throws Exception {
/*
Injector injector = ShurikenInjector.createInjector(binder -> {
binder.bind(Object.class)
.annotatedWith(Named.as("name one"))
.toInstance("foo");
binder.bind(String.class)
.annotatedWith(Named.as("name two"))
.toInstance("bar");
});
*/
}
示例11: getConnection
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Disabled("We first have to find/build some tool to help test these connections.")
@Test
@Tag("fast")
void getConnection() throws PlcException {
S7PlcConnection s7Connection = (S7PlcConnection)
new PlcDriverManager().getConnection("s7://localhost/1/2");
Assertions.assertEquals(s7Connection.getHostName(), "localhost");
Assertions.assertEquals(s7Connection.getRack(), 1);
Assertions.assertEquals(s7Connection.getSlot(), 2);
}
示例12: testEncodeRecode
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled("Adapters will be moved")
public void testEncodeRecode() throws IOException {
final Path file = Files.createTempFile("testEncodeRecode", "frc");
final Recording recording = new Recording();
recording.append(new TimestampedData("foo", DataTypes.All, 0.0, 0));
recording.append(new TimestampedData("foo", DataTypes.All, 100.0, 1));
Serialization.saveRecording(recording, file);
final Recording loaded = Serialization.loadRecording(file);
assertEquals(recording, loaded, "The loaded recording differs from the encoded one");
}
示例13: testChangeTrueColor
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled
public void testChangeTrueColor() {
final Color color = Color.WHITE;
widget.getSource().setData(true);
widget.setTrueColor(color);
WaitForAsyncUtils.waitForFxEvents();
assertEquals(color, getBackground(), "Background was the wrong color");
}
示例14: testChangeFalseColor
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled
public void testChangeFalseColor() {
widget.getSource().setData(false);
widget.setFalseColor(Color.BLACK);
WaitForAsyncUtils.waitForFxEvents();
assertEquals(widget.getFalseColor(), getBackground(), "Background was the wrong color");
}
示例15: testValueUpdates
import org.junit.jupiter.api.Disabled; //導入依賴的package包/類
@Test
@Disabled("Race conditions in dependencies")
public void testValueUpdates() throws TimeoutException {
String key = "key";
DataType type = DataTypes.All;
SingleKeyNetworkTableSource<String> source
= new SingleKeyNetworkTableSource<>(table, key, type);
table.getEntry(key).setString("a value");
NetworkTableInstance.getDefault().waitForEntryListenerQueue(-1.0);
assertEquals("a value", source.getData());
assertTrue(source.isActive(), "The source should be active");
source.close();
}