Search in sources :

Example 41 with Disabled

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

the class FulltextIndexConsistencyCheckIT method mustDiscoverNodeInIndexMissingFromStore.

@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 mustDiscoverNodeInIndexMissingFromStore() throws Exception {
    GraphDatabaseService db = createDatabase();
    try (Transaction tx = db.beginTx()) {
        tx.execute(format(NODE_CREATE, "nodes", asStrList("Label"), asStrList("prop"))).close();
        tx.commit();
    }
    long nodeId;
    try (Transaction tx = db.beginTx()) {
        tx.schema().awaitIndexesOnline(2, TimeUnit.MINUTES);
        Node node = tx.createNode(Label.label("Label"));
        nodeId = node.getId();
        node.setProperty("prop", "value");
        tx.commit();
    }
    // Remove the property without updating the index
    managementService.shutdown();
    DatabaseManagementService managementService = new TestDatabaseManagementServiceBuilder(databaseLayout).setFileSystem(fs).removeExtensions(INDEX_PROVIDERS_FILTER).addExtension(new FailingGenericNativeIndexProviderFactory(SKIP_ONLINE_UPDATES)).addExtension(new TokenIndexProviderFactory()).build();
    db = managementService.database(DEFAULT_DATABASE_NAME);
    try (Transaction tx = db.beginTx()) {
        tx.getNodeById(nodeId).removeProperty("prop");
        tx.commit();
    }
    managementService.shutdown();
    ConsistencyCheckService.Result result = checkConsistency();
    assertFalse(result.isSuccessful());
}
Also used : GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) Transaction(org.neo4j.graphdb.Transaction) Node(org.neo4j.graphdb.Node) TokenIndexProviderFactory(org.neo4j.kernel.impl.index.schema.TokenIndexProviderFactory) FailingGenericNativeIndexProviderFactory(org.neo4j.kernel.impl.index.schema.FailingGenericNativeIndexProviderFactory) ConsistencyCheckService(org.neo4j.consistency.ConsistencyCheckService) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 42 with Disabled

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

the class IndexConfigMigrationIT method create3_5Database.

@Disabled("Here as reference for how 3.5 db was created")
@Test
void create3_5Database() throws Exception {
    Path storeDir = tempStoreDirectory();
    DatabaseManagementServiceBuilder builder = new TestDatabaseManagementServiceBuilder(storeDir);
    setSpatialConfig(builder);
    DatabaseManagementService dbms = builder.build();
    GraphDatabaseService db = dbms.database(DEFAULT_DATABASE_NAME);
    createIndex(db, NATIVE_BTREE10.providerName(), label1);
    // createIndex( db, NATIVE20.providerName(), label2 ); // <- Those index providers are removed in 4.0, but here for reference.
    // createIndex( db, NATIVE10.providerName(), label3 );
    // createIndex( db, LUCENE10.providerName(), label4 );
    createSpatialData(db, label1, label2, label3, label4);
    for (FulltextIndexDescription fulltextIndex : FulltextIndexDescription.values()) {
        createFulltextIndex(db, fulltextIndex.indexProcedure, fulltextIndex.indexName, fulltextIndex.tokenName, propKey, fulltextIndex.configMap);
    }
    dbms.shutdown();
    Path zipFile = storeDir.resolveSibling(storeDir.getFileName().toString() + ".zip");
    ZipUtils.zip(new DefaultFileSystemAbstraction(), storeDir, zipFile);
    System.out.println("Db created in " + zipFile.toAbsolutePath());
}
Also used : Path(java.nio.file.Path) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) DefaultFileSystemAbstraction(org.neo4j.io.fs.DefaultFileSystemAbstraction) TestDatabaseManagementServiceBuilder(org.neo4j.test.TestDatabaseManagementServiceBuilder) DatabaseManagementServiceBuilder(org.neo4j.dbms.api.DatabaseManagementServiceBuilder) DatabaseManagementService(org.neo4j.dbms.api.DatabaseManagementService) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 43 with Disabled

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

the class StreamingSimpleClientHttpRequestFactoryTests method largeFileUpload.

@Test
@Disabled
public void largeFileUpload() throws Exception {
    Random rnd = new Random();
    ClientHttpResponse response = null;
    try {
        ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/methods/post"), HttpMethod.POST);
        final int BUF_SIZE = 4096;
        final int ITERATIONS = Integer.MAX_VALUE / BUF_SIZE;
        // final int contentLength = ITERATIONS * BUF_SIZE;
        // request.getHeaders().setContentLength(contentLength);
        OutputStream body = request.getBody();
        for (int i = 0; i < ITERATIONS; i++) {
            byte[] buffer = new byte[BUF_SIZE];
            rnd.nextBytes(buffer);
            body.write(buffer);
        }
        response = request.execute();
        assertThat(response.getStatusCode()).as("Invalid response status").isEqualTo(HttpStatus.OK);
    } finally {
        if (response != null) {
            response.close();
        }
    }
}
Also used : Random(java.util.Random) OutputStream(java.io.OutputStream) URI(java.net.URI) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 44 with Disabled

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

the class DnsNameResolverClientSubnetTest method testSubnetQuery.

// See https://www.gsic.uva.es/~jnisigl/dig-edns-client-subnet.html
// Ignore as this needs to query real DNS servers.
@Disabled
@Test
public void testSubnetQuery() throws Exception {
    EventLoopGroup group = new NioEventLoopGroup(1);
    DnsNameResolver resolver = newResolver(group).build();
    try {
        // Same as:
        // # /.bind-9.9.3-edns/bin/dig @ns1.google.com www.google.es +client=157.88.0.0/24
        Future<List<InetAddress>> future = resolver.resolveAll("www.google.es", Collections.<DnsRecord>singleton(// 157.88.0.0 / 24
        new DefaultDnsOptEcsRecord(1024, 24, SocketUtils.addressByName("157.88.0.0").getAddress())));
        for (InetAddress address : future.syncUninterruptibly().getNow()) {
            System.out.println(address);
        }
    } finally {
        resolver.close();
        group.shutdownGracefully(0, 0, TimeUnit.SECONDS);
    }
}
Also used : EventLoopGroup(io.netty.channel.EventLoopGroup) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) DefaultDnsOptEcsRecord(io.netty.handler.codec.dns.DefaultDnsOptEcsRecord) List(java.util.List) InetAddress(java.net.InetAddress) NioEventLoopGroup(io.netty.channel.nio.NioEventLoopGroup) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 45 with Disabled

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

the class FileRegionThrottleTest method testGlobalWriteThrottle.

@Disabled("This test is flaky, need more investigation")
@Test
public void testGlobalWriteThrottle() throws Exception {
    final CountDownLatch latch = new CountDownLatch(1);
    final GlobalTrafficShapingHandler gtsh = new GlobalTrafficShapingHandler(group, WRITE_LIMIT, 0);
    ServerBootstrap bs = new ServerBootstrap();
    bs.group(group).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>() {

        @Override
        protected void initChannel(SocketChannel ch) {
            ch.pipeline().addLast(new LineBasedFrameDecoder(Integer.MAX_VALUE));
            ch.pipeline().addLast(new MessageDecoder());
            ch.pipeline().addLast(gtsh);
        }
    });
    Channel sc = bs.bind(0).sync().channel();
    Channel cc = clientConnect(sc.localAddress(), new ReadHandler(latch)).channel();
    long start = TrafficCounter.milliSecondFromNano();
    cc.writeAndFlush(Unpooled.copiedBuffer("send-file\n", CharsetUtil.US_ASCII)).sync();
    latch.await();
    long timeTaken = TrafficCounter.milliSecondFromNano() - start;
    assertTrue(timeTaken > 3000, "Data streamed faster than expected");
    sc.close().sync();
    cc.close().sync();
}
Also used : NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) SocketChannel(io.netty.channel.socket.SocketChannel) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) NioSocketChannel(io.netty.channel.socket.nio.NioSocketChannel) SocketChannel(io.netty.channel.socket.SocketChannel) NioServerSocketChannel(io.netty.channel.socket.nio.NioServerSocketChannel) Channel(io.netty.channel.Channel) LineBasedFrameDecoder(io.netty.handler.codec.LineBasedFrameDecoder) CountDownLatch(java.util.concurrent.CountDownLatch) ServerBootstrap(io.netty.bootstrap.ServerBootstrap) 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