Search in sources :

Example 36 with Disabled

use of org.junit.jupiter.api.Disabled in project spring-security by spring-projects.

the class ShowcaseITest method install.

@Test
@Disabled
public void install() throws Exception {
    BuildResult result = this.testKit.withProjectResource("samples/showcase/").withArguments("install", "--stacktrace").build();
    assertThat(result.getOutput()).contains("SUCCESS");
    File pom = new File(testKit.getRootDir(), "sgbcs-core/build/poms/pom-default.xml");
    assertThat(pom).exists();
    String pomText = new String(Files.readAllBytes(pom.toPath()));
    String pomTextNoSpace = pomText.replaceAll("\\s", "");
    assertThat(pomText).doesNotContain("<dependencyManagement>");
    assertThat(pomTextNoSpace).contains("<dependency>\n			<groupId>org.springframework</groupId>\n			<artifactId>spring-test</artifactId>\n			<scope>test</scope>\n			<version>4.3.6.RELEASE</version>\n		</dependency>".replaceAll("\\s", ""));
    assertThat(pomTextNoSpace).contains("<developers>\n			<developer>\n				<id>rwinch</id>\n				<name>Rob Winch</name>\n				<email>rwinch@pivotal.io</email>\n			</developer>\n			<developer>\n				<id>jgrandja</id>\n				<name>Joe Grandja</name>\n				<email>jgrandja@pivotal.io</email>\n			</developer>\n		</developers>".replaceAll("\\s", ""));
    assertThat(pomTextNoSpace).contains("<scm>\n			<connection>scm:git:git://github.com/spring-projects/spring-security</connection>\n			<developerConnection>scm:git:git://github.com/spring-projects/spring-security</developerConnection>\n			<url>https://github.com/spring-projects/spring-security</url>\n		</scm>".replaceAll("\\s", ""));
    assertThat(pomTextNoSpace).contains("<description>sgbcs-core</description>");
    assertThat(pomTextNoSpace).contains("<url>https://spring.io/spring-security</url>");
    assertThat(pomTextNoSpace).contains("<organization>\n			<name>spring.io</name>\n			<url>https://spring.io/</url>\n		</organization>".replaceAll("\\s", ""));
    assertThat(pomTextNoSpace).contains("	<licenses>\n			<license>\n				<name>The Apache Software License, Version 2.0</name>\n				<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>\n				<distribution>repo</distribution>\n			</license>\n		</licenses>".replaceAll("\\s", ""));
    assertThat(pomTextNoSpace).contains("<scm>\n			<connection>scm:git:git://github.com/spring-projects/spring-security</connection>\n			<developerConnection>scm:git:git://github.com/spring-projects/spring-security</developerConnection>\n			<url>https://github.com/spring-projects/spring-security</url>\n		</scm>".replaceAll("\\s", ""));
    File bom = new File(testKit.getRootDir(), "bom/build/poms/pom-default.xml");
    assertThat(bom).exists();
    assertThat(bom).hasContent("<artifactId>sgbcs-core</artifactId>");
    BuildResult secondBuild = this.testKit.withProjectResource("samples/showcase/").withArguments("mavenBom", "--stacktrace").build();
    // mavenBom is not up to date since install is never up to date
    assertThat(result.task(":bom:mavenBom").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
}
Also used : BuildResult(org.gradle.testkit.runner.BuildResult) File(java.io.File) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 37 with Disabled

use of org.junit.jupiter.api.Disabled in project logging-log4j2 by apache.

the class LogEventTest method testEquals.

@Test
@Disabled
public void testEquals() {
    final LogEvent event1 = // 
    Log4jLogEvent.newBuilder().setLoggerName(// 
    this.getClass().getName()).setLoggerFqcn(// 
    "org.apache.logging.log4j.core.Logger").setLevel(// 
    Level.INFO).setMessage(// 
    new SimpleMessage("Hello, world!")).build();
    final LogEvent event2 = // 
    Log4jLogEvent.newBuilder().setLoggerName(// 
    this.getClass().getName()).setLoggerFqcn(// 
    "org.apache.logging.log4j.core.Logger").setLevel(// 
    Level.INFO).setMessage(// 
    new SimpleMessage("Hello, world!")).build();
    final LogEvent event3 = // 
    Log4jLogEvent.newBuilder().setLoggerName(// 
    this.getClass().getName()).setLoggerFqcn(// 
    "org.apache.logging.log4j.core.Logger").setLevel(// 
    Level.INFO).setMessage(// 
    new SimpleMessage("Hello, world!")).build();
    assertNotEquals(event1, event2, "Events should not be equal");
    assertEquals(event2, event3, "Events should be equal");
}
Also used : Log4jLogEvent(org.apache.logging.log4j.core.impl.Log4jLogEvent) SimpleMessage(org.apache.logging.log4j.message.SimpleMessage) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 38 with Disabled

use of org.junit.jupiter.api.Disabled in project okhttp by square.

the class DuplexTest method serverCancelsRequestBodyAndSendsResponseBody.

/**
 * OkHttp currently doesn't implement failing the request body stream independently of failing the
 * corresponding response body stream. This is necessary if we want servers to be able to stop
 * inbound data and send an early 400 before the request body completes.
 *
 * This test sends a slow request that is canceled by the server. It expects the response to still
 * be readable after the request stream is canceled.
 */
@Disabled
@Test
public void serverCancelsRequestBodyAndSendsResponseBody() throws Exception {
    client = client.newBuilder().retryOnConnectionFailure(false).build();
    BlockingQueue<String> log = new LinkedBlockingQueue<>();
    enableProtocol(Protocol.HTTP_2);
    MockDuplexResponseBody mockDuplexResponseBody = enqueueResponseWithBody(new MockResponse().clearHeaders(), new MockDuplexResponseBody().sendResponse("success!").exhaustResponse().cancelStream(ErrorCode.NO_ERROR));
    Call call = client.newCall(new Request.Builder().url(server.url("/")).post(new RequestBody() {

        @Override
        @Nullable
        public MediaType contentType() {
            return null;
        }

        @Override
        public void writeTo(BufferedSink sink) throws IOException {
            try {
                for (int i = 0; i < 10; i++) {
                    sink.writeUtf8(".");
                    sink.flush();
                    Thread.sleep(100);
                }
            } catch (IOException e) {
                log.add(e.toString());
                throw e;
            } catch (Exception e) {
                log.add(e.toString());
            }
        }
    }).build());
    try (Response response = call.execute()) {
        assertThat(response.body().string()).isEqualTo("success!");
    }
    mockDuplexResponseBody.awaitSuccess();
    assertThat(log.take()).contains("StreamResetException: stream was reset: NO_ERROR");
}
Also used : MockResponse(mockwebserver3.MockResponse) BufferedSink(okio.BufferedSink) IOException(java.io.IOException) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) IOException(java.io.IOException) ProtocolException(java.net.ProtocolException) MockResponse(mockwebserver3.MockResponse) MockDuplexResponseBody(mockwebserver3.internal.duplex.MockDuplexResponseBody) Nullable(org.jetbrains.annotations.Nullable) AsyncRequestBody(okhttp3.internal.duplex.AsyncRequestBody) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 39 with Disabled

use of org.junit.jupiter.api.Disabled in project neo4j by neo4j.

the class VersionAwareLogEntryReaderTest method shouldValidateChecksumChain.

// TODO it's not clear what the benefit verifying the chain will give us, so it's disable for now
@Disabled
@Test
void shouldValidateChecksumChain() throws IOException {
    // given
    final InMemoryClosableChannel channel = new InMemoryClosableChannel(true);
    LogPosition startPosition = new LogPosition(0, 174);
    int checksum1 = 1021763356;
    final LogEntryStart start1 = new LogEntryStart(1, 2, BASE_TX_CHECKSUM, new byte[] { 4 }, startPosition);
    final LogEntryCommit commit1 = new LogEntryCommit(42, 21, checksum1);
    int checksum2 = 2120750830;
    final LogEntryStart start2 = new LogEntryStart(35, 30, checksum1, new byte[] { 5 }, startPosition);
    final LogEntryCommit commit2 = new LogEntryCommit(76, 35, checksum2);
    int checksum3 = -1462443939;
    final LogEntryStart start3 = new LogEntryStart(58, 80, checksum2, new byte[] { 6 }, startPosition);
    final LogEntryCommit commit3 = new LogEntryCommit(83, 47, checksum3);
    int notChecksum3 = checksum3 + 1;
    final LogEntryStart start4 = new LogEntryStart(68, 83, notChecksum3, new byte[] { 7 }, startPosition);
    writeStartEntry(channel, start1);
    writeCommitEntry(channel, commit1);
    writeStartEntry(channel, start2);
    writeCommitEntry(channel, commit2);
    writeStartEntry(channel, start3);
    writeCommitEntry(channel, commit3);
    writeStartEntry(channel, start4);
    assertEquals(start1, logEntryReader.readLogEntry(channel));
    assertEquals(commit1, logEntryReader.readLogEntry(channel));
    assertEquals(start2, logEntryReader.readLogEntry(channel));
    assertEquals(commit2, logEntryReader.readLogEntry(channel));
    assertEquals(start3, logEntryReader.readLogEntry(channel));
    assertEquals(commit3, logEntryReader.readLogEntry(channel));
    IllegalStateException e = assertThrows(IllegalStateException.class, () -> logEntryReader.readLogEntry(channel));
    assertTrue(e.getMessage().contains("The checksum chain is broken"));
}
Also used : InMemoryClosableChannel(org.neo4j.kernel.impl.transaction.log.InMemoryClosableChannel) LogPosition(org.neo4j.kernel.impl.transaction.log.LogPosition) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 40 with Disabled

use of org.junit.jupiter.api.Disabled in project neo4j by neo4j.

the class FulltextIndexConsistencyCheckIT method mustDiscoverRelationshipInIndexMissingFromStore.

@Disabled("Turns out that this is not something that the consistency checker actually looks for, currently. " + "The test is disabled until the consistency checker is extended with checks that will discover this sort of inconsistency.")
@Test
void mustDiscoverRelationshipInIndexMissingFromStore() throws Exception {
    GraphDatabaseService db = createDatabase();
    try (Transaction tx = db.beginTx()) {
        tx.execute(format(RELATIONSHIP_CREATE, "rels", asStrList("REL"), asStrList("prop"))).close();
        tx.commit();
    }
    long relId;
    try (Transaction tx = db.beginTx()) {
        tx.schema().awaitIndexesOnline(2, TimeUnit.MINUTES);
        Node node = tx.createNode();
        Relationship rel = node.createRelationshipTo(node, RelationshipType.withName("REL"));
        relId = rel.getId();
        rel.setProperty("prop", "value");
        tx.commit();
    }
    NeoStores stores = getNeoStores(db);
    RelationshipRecord record = stores.getRelationshipStore().newRecord();
    record = stores.getRelationshipStore().getRecord(relId, record, RecordLoad.NORMAL, NULL);
    long propId = record.getNextProp();
    record.setNextProp(AbstractBaseRecord.NO_ID);
    stores.getRelationshipStore().updateRecord(record, NULL);
    PropertyRecord propRecord = stores.getPropertyStore().getRecord(propId, stores.getPropertyStore().newRecord(), RecordLoad.NORMAL, NULL);
    propRecord.setInUse(false);
    stores.getPropertyStore().updateRecord(propRecord, NULL);
    managementService.shutdown();
    ConsistencyCheckService.Result result = checkConsistency();
    assertFalse(result.isSuccessful());
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) Transaction(org.neo4j.graphdb.Transaction) Node(org.neo4j.graphdb.Node) Relationship(org.neo4j.graphdb.Relationship) NeoStores(org.neo4j.kernel.impl.store.NeoStores) RelationshipRecord(org.neo4j.kernel.impl.store.record.RelationshipRecord) ConsistencyCheckService(org.neo4j.consistency.ConsistencyCheckService) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)358 Test (org.junit.jupiter.api.Test)343 URL (java.net.URL)67 ArrayList (java.util.ArrayList)23 File (java.io.File)20 List (java.util.List)15 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 CountDownLatch (java.util.concurrent.CountDownLatch)11 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 Path (java.nio.file.Path)10 HashMap (java.util.HashMap)10 IOException (java.io.IOException)9 NAR (nars.NAR)9 BaseDataTest (org.apache.ibatis.BaseDataTest)8 Timeout (org.junit.jupiter.api.Timeout)8 Arrays (java.util.Arrays)7 ExecutorService (java.util.concurrent.ExecutorService)7 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7