Package co.paralleluniverse.strands

Examples of co.paralleluniverse.strands.SuspendableRunnable


        // end of snippet
    }

    @Test
    public void testOpen() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try (Handle h = jdbi.open()) {
                    h.execute("create table if not exists testOpen (id int primary key, name varchar(100))");
                    h.execute("drop table testOpen");
View Full Code Here


        }).start().join();
    }

    @Test
    public void testQueryFirst() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                // snippet usage
                try (Handle h = jdbi.open()) {
                    h.execute("create table  if not exists testQueryFirst (id int primary key, name varchar(100))");
View Full Code Here

        }).start().join();
    }

    @Test
    public void testQueryList() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try (Handle h = jdbi.open()) {
                    h.execute("create table if not exists testQueryList (id int primary key, name varchar(100))");
                    for (int i = 0; i < 100; i++)
View Full Code Here

        // end of snippet
    }

    @Test
    public void testDao() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                // snippet usage
                dao.createSomethingTable();
                for (int i = 0; i < 100; i++)
View Full Code Here

    @Test
    public void testGetConnection() throws IOException, InterruptedException, Exception {
        // snippet DataSource wrapping
        final DataSource fiberDs = FiberDataSource.wrap(ds);
        // end of snippet
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    // snippet DataSource usage
                    Connection conn = fiberDs.getConnection();
View Full Code Here

    }

    @Test
    public void testGetConnectionUsername() throws IOException, InterruptedException, Exception {
        final DataSource fiberDs = FiberDataSource.wrap(ds);
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    fiberDs.getConnection("", "").close();
                } catch (SQLException ex) {
View Full Code Here

        conn.close();
    }

    @Test
    public void testCreateStatement() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    conn.createStatement().close();
                } catch (SQLException ex) {
View Full Code Here

        }).start().join();
    }

    @Test
    public void testPrepareStatement() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    conn.prepareStatement("create table tablename");
                } catch (SQLException ex) {
View Full Code Here

        }).start().join();
    }

    @Test
    public void testPrepareCall() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    conn.prepareCall("create table tablename");
                } catch (SQLException ex) {
View Full Code Here

        }).start().join();
    }

    @Test
    public void testCommit() throws IOException, InterruptedException, Exception {
        new Fiber<Void>(new SuspendableRunnable() {
            @Override
            public void run() throws SuspendExecution, InterruptedException {
                try {
                    conn.createStatement().execute("drop table if exists testCommit");
                    conn.createStatement().execute("create table testCommit (id int primary key, name varchar(100))");
View Full Code Here

TOP

Related Classes of co.paralleluniverse.strands.SuspendableRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.