@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" ); }
@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()); }
@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(); }
@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"); }
@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(); }
@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()); }
@Disabled @Test public void canLogout() { HttpResponse response = post("logout", null); assertThat(response.getStatusCode(), is(HttpResponseStatus.FORBIDDEN.code())); assertThat(response.getStatusMessage(), is(HttpResponseStatus.UNAUTHORIZED.reasonPhrase())); }
@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); }
@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); }
@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"); }); */ }
@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); }
@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"); }
@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"); }
@Test @Disabled public void testChangeFalseColor() { widget.getSource().setData(false); widget.setFalseColor(Color.BLACK); WaitForAsyncUtils.waitForFxEvents(); assertEquals(widget.getFalseColor(), getBackground(), "Background was the wrong color"); }
@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(); }
@Disabled("Redudant test for Travis CI suite") // tag::snippet-in-doc[] @Test public void testWithTwoFirefoxs(FirefoxDriver driver1, FirefoxDriver driver2) { driver1.get("http://www.seleniumhq.org/"); driver2.get("http://junit.org/junit5/"); assertThat(driver1.getTitle(), startsWith("Selenium")); assertThat(driver2.getTitle(), equalTo("JUnit 5")); }
@Disabled("Redudant test for Travis CI suite") // tag::snippet-in-doc[] @Test public void testWithTwoChromes(ChromeDriver driver1, ChromeDriver driver2) { driver1.get("http://www.seleniumhq.org/"); driver2.get("http://junit.org/junit5/"); assertThat(driver1.getTitle(), startsWith("Selenium")); assertThat(driver2.getTitle(), equalTo("JUnit 5")); }
@Test @Disabled void isForbiddenType() throws InvalidFormatException { ContentType ct; // Block PostScript ct = new ContentType("application/postscript"); assertTrue(instance.isForbiddenType(ct)); }
@Test @Disabled void noFalsePositiveForbiddenType() throws InvalidFormatException { ContentType ct; for (String contentType : NOT_DYNAMIC_TYPES) { ct = new ContentType(contentType); assertFalse(instance.isForbiddenType(ct), contentType + " should not be a forbidden type"); } }
@Test @Disabled void remapsMacroEnabledDocumentType() throws InvalidFormatException { // Not implemented for now. :( ContentType ct; for (String contentType : DYNAMIC_TYPES) { ct = new ContentType(contentType); assertTrue(instance.isForbiddenType(ct), contentType + " should be a forbidden type"); } }
@Test @Disabled void testBuildImageServiceContext() { String imageServiceContext = buildImageServiceContext("12345"); assertEquals( "https://iiif.ub.uni-leipzig.de/fcgi-bin/iipsrv.fcgi?iiif=/j2k/0000/0123/12345", imageServiceContext); }
@Test @Disabled void testBuildServiceIRI() { String imageServiceContext = buildImageServiceContext("0000004057"); String resourceIdString = "00000002"; IRI serviceIri = buildServiceIRI(imageServiceContext, resourceIdString); assertTrue(serviceIri != null); assertEquals( "https://iiif.ub.uni-leipzig.de/fcgi-bin/iipsrv" + ".fcgi?iiif=/j2k/0000/0040/0000004057/00000002.jpx", serviceIri.getIRIString()); }
@Test @Disabled(value = "cannot work") public void factorRandomNumber() { Long randomNumber = new Random().nextLong(); List<Long> expectedPrimeFactors = Arrays.asList(1L); assertThat(sut.factor(randomNumber)).isEqualTo(expectedPrimeFactors); }
@Disabled("Need to handle sub-selects. Not so simple, as they might have their own WHEREs") @Test public void testInSelect(){ String sql = "select * from Foo where 10 IN (select x from Foo)"; checkIncreasingTillCovered("x", Arrays.asList(20, 15, 8), 10, sql); }
@Test @InitialDataSets("datasets/initial-data.json") @ExpectedDataSets("datasets/initial-data.json") @Transactional(TransactionMode.ROLLBACK) @Disabled("It seems there is a bug in EclipseLink. If this test is executed as a first one, EclipseLink is unable to generate further IDs") public void transactionRollbackTest() { // TODO We need to wait until #13 Junit5 is implemented // (https://github.com/junit-team/junit5/issues/13) before we can enable this test again final Depositor entity = manager.find(Depositor.class, 106L); assertNotNull(entity); entity.setName("Alex"); }
/** * A separate Fetcher for Stockquote data, because it can change over time. * The testdata Fetcher is more experimental. */ @Test @Disabled void fetchStockquoteData() { StockQuoteData testdata = new StockQuoteData("DE000A1K0409", Index.SDAX); testdata = stockquoteFetcher.process(testdata); assertEquals("EMH1", testdata.getSymbol()); assertEquals("PFERDEWETTEN.DE AG", testdata.getStockname()); assertThat(testdata.getUrlParts(), hasValue("PFERDEWETTEN-DE-AG-Aktie-DE000A1K0409")); assertThat(testdata.getUrlParts(), hasValue("PFERDEWETTEN-DE-AG-23145623")); // assertEquals(new BigDecimal("34.17"), testdata.getRoe()); // assertEquals(new BigDecimal("28.35"), testdata.getEbitMargin()); // assertEquals(new BigDecimal("73.83"), testdata.getEquityRatio()); assertThat(testdata.getHistoryParts(), hasValue("54094105")); }
@Test @Disabled public void test() throws Exception { Importer importer = injector.getInstance(Importer.class); ProtoContext context = importer.importFile(new ClasspathFileReader(), "protostuff_unittest/messages_sample.proto"); Proto proto = context.getProto(); StCompilerFactory compilerFactory = injector.getInstance(StCompilerFactory.class); ProtoCompiler compiler = compilerFactory.create("io/protostuff/generator/proto/proto3.stg"); Module module = ImmutableModule.builder() .addProtos(proto) .output("./") .usageIndex(UsageIndex.build(Collections.emptyList())) .build(); compiler.compile(module); }
@Test @Disabled("Disabled because of a possible JMockit bug?") public void test_that_runEventDispatch_Should_not_call_the_dispatcher_if_it_does_not_accept_that_type_of_event() { new Expectations() {{ testDispatcher.accepts((Class) any); result = false; testDispatcher.dispatch((Event) any, any); times = 0; }}; testee.runEventDispatch(testDispatcher, testSubscriber, new EventFilter[0]); }
@Test @Disabled("Disabled because of a possible JMockit bug?") public void test_that_runEventDispatch_Should_not_call_the_dispatcher_if_one_of_the_filters_reject_that_event() { new Expectations() {{ testDispatcher.accepts((Class) any); result = true; testDispatcher.dispatch((Event) any, any); times = 0; testEventFilterA.accepts(testContext, testEvent); result = false; }}; testee.runEventDispatch(testDispatcher, testSubscriber, new EventFilter[]{testEventFilterA}); }
@Disabled("https://jira.spring.io/browse/SPR-10493") // TODO enable as soon as this works @Test public void wildcardJsonGivesProblem() throws Exception { mvc().perform(request(GET, url) .accept("application/*+json")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaTypes.PROBLEM)); }
@DisplayName("Get all entries with old HTML format (except withdrawn ones)") @ParameterizedTest(name = "Fetch for id: {0}") @MethodSource("allNonWithdrawnIdsWithOldHtmlFormat") @Disabled("Takes a lot of time - should only be called manually") public void searchByIdWithOldHtmlFormatWithoutDateCheck(String id) throws FetcherException { Optional<BibEntry> fetchedEntry = fetcher.performSearchById(id); assertTrue(fetchedEntry.isPresent(), "Expected to get an entry for id " + id); assertNotEquals(Optional.empty(), fetchedEntry.get().getField(FieldName.DATE), "Expected non empty date field, entry is\n" + fetchedEntry.toString()); assertTrue(fetchedEntry.get().getField(FieldName.DATE).get().length() == 10, "Expected yyyy-MM-dd date format, entry is\n" + fetchedEntry.toString()); assertNotEquals(Optional.empty(), fetchedEntry.get().getField(FieldName.ABSTRACT), "Expected non empty abstract field, entry is\n" + fetchedEntry.toString()); }
@Test @Disabled("Regression test") public void testOperators() throws Exception { DollarStatic.getConfig().failFast(false); final List<String> operatorTestFiles = Arrays.asList(); for (String operatorTestFile : operatorTestFiles) { System.out.println(operatorTestFile); new DollarParserImpl(options).parse( getClass().getResourceAsStream("/regression/operators/" + operatorTestFile), operatorTestFile, parallel); } }
@Test @Disabled("Fails: Not Implemented") void findetKontenNachKontonummerAnfangAlsSuchbegriff() throws Exception { mvc.perform(get("/konto/search") .contentType(MediaType.APPLICATION_JSON_UTF8) .accept(MediaType.APPLICATION_JSON_UTF8) .param("term", "10")) .andExpect(status().isOk()) .andExpect(jsonPath("[0].id", is("1010"))) .andExpect(jsonPath("[0].value", is("1010"))) .andExpect(jsonPath("[0].label", is("1010 - Spesen"))) ; }
@Disabled @Test public void generate() throws IOException { List<String> messages = Arrays.asList( "CEF:0|Security|threatmanager|1.0|100|worm successfully stopped|10|src=10.0.0.1 dst=2.1.2.2 spt=1232", "CEF:0|security|threatmanager|1.0|100|detected a \\| in message|10|src=10.0.0.1 act=blocked a | dst=1.1.1.1", "CEF:0|security|threatmanager|1.0|100|detected a \\ in packet|10|src=10.0.0.1 act=blocked a \\ dst=1.1.1.1", "CEF:0|security|threatmanager|1.0|100|detected a = in message|10|src=10.0.0.1 act=blocked a \\= dst=1.1.1.1", "CEF:0|ArcSight|Logger|5.0.0.5355.2|sensor:115|Logger Internal Event|1|cat=/Monitor/Sensor/Fan5 cs2=Current Value cnt=1 dvc=10.0.0.1 cs3=Ok cs1=null type=0 cs1Label=unit rt=1305034099211 cs3Label=Status cn1Label=value cs2Label=timeframe", "CEF:0|Trend Micro Inc.|OSSEC HIDS|v2.5.1|5302|User missed the password to change UID to root.|9|dvc=ubuntusvr cs2=ubuntusvr->/var/log/auth.log cs2Label=Location src= suser=root msg=May 11 21:16:05 ubuntusvr su[24120]: - /dev/pts/1 xavier:root", "CEF:0|security|threatmanager|1.0|100|Detected a threat. No action needed.|10|src=10.0.0.1 msg=Detected a threat.\\n No action needed.", "CEF:0|security|threatmanager|1.0|100|Detected a threat. No action needed.|10", "filterlog: 5,16777216,,1000000003,igb1,match,block,in,6,0x00,0x00000,255,ICMPv6,58,32,2605:6000:c00:96::1,ff02::1:ffac:f98,", "dhcpd: DHCPACK on 10.10.0.10 to 00:26:ab:fb:27:dc via igb2", "dhcpd: DHCPREQUEST for 10.10.0.10 from 00:26:ab:fb:27:dc via igb2", "dhcpleases: Sending HUP signal to dns daemon(69876)" ); Multiset<String> counts = HashMultiset.create(); for (String message : messages) { TestCase testCase = new TestCase(); Struct valueInput = new Struct(VALUE_SCHEMA) .put("date", new Date(1493195158000L)) .put("facility", 16) .put("host", "filterlog") .put("level", 6) .put("message", message) .put("charset", "utf-8") .put("remote_address", "/10.10.0.1:514") .put("hostname", "vpn.example.com"); testCase.input = new SourceRecord( ImmutableMap.of(), ImmutableMap.of(), "syslog", null, null, null, valueInput.schema(), valueInput, 1493195158000L ); String fileNameFormat; try { testCase.expected = (SourceRecord) this.transformation.apply(testCase.input); fileNameFormat = testCase.expected.topic().equals("syslog.cef") ? "CEF%04d.json" : "NotCEF%04d.json"; ((Struct) testCase.expected.value()).validate(); // fileNameFormat = "CEF%04d.json"; } catch (IllegalStateException ex) { fileNameFormat = "NotCEF%04d.json"; testCase.expected = testCase.input; } counts.add(fileNameFormat); int testNumber = counts.count(fileNameFormat); File root = new File("src/test/resources/com/github/jcustenborder/kafka/connect/transform/cef/records"); String filename = String.format(fileNameFormat, testNumber); File file = new File(root, filename); log.trace("Saving {}", filename); ObjectMapperFactory.INSTANCE.writeValue(file, testCase); } }
@Disabled @Test void skippedTest() { }
@Disabled @Test public void iHaveBeenDisabled() { assert (false); }
@Test @Disabled("reasons") void skipped() {}
@Test @Disabled @DisplayName("A disabled test") void testNotRun() { log.info("This test will not run (it is disabled, silly)."); }