Examples of TestClient


Examples of org.syncany.tests.util.TestClient

            // Format: abs=<count> rel=<count> op=<connect|init|upload|...> <operation description>
            "rel=[678].+delete.+temp", // << 3 retries!!
        }
            ));

    TestClient clientA = new TestClient("A", testConnection);

    clientA.createNewFile("file");

    clientA.up();

    clientA.changeFile("file");
    clientA.upWithForceChecksum();

    CleanupOperationOptions cleanupOptions = new CleanupOperationOptions();
    cleanupOptions.setMaxDatabaseFiles(1);
    boolean cleanupFailed = false;
    try {
      clientA.cleanup(cleanupOptions);
    }
    catch (StorageException e) {
      cleanupFailed = true;
    }

    TransferManager transferManager = new TransactionAwareTransferManager(
        new UnreliableLocalTransferPlugin().createTransferManager(testConnection, null), null);

    assertTrue(cleanupFailed);
    assertEquals(2, transferManager.list(MultichunkRemoteFile.class).size());
    assertEquals(2, new File(testConnection.getPath(), "multichunks").list().length);

    assertEquals(1, transferManager.list(DatabaseRemoteFile.class).size());
    assertEquals(1, new File(testConnection.getPath(), "databases").list().length);

    assertEquals(0, transferManager.list(TransactionRemoteFile.class).size());
    assertEquals(0, new File(testConnection.getPath(), "transactions").list().length);

    assertEquals(1, transferManager.list(ActionRemoteFile.class).size());
    assertEquals(1, new File(testConnection.getPath(), "actions").list().length);

    // Two temporary files left (first deletion failed)
    assertEquals(2, transferManager.list(TempRemoteFile.class).size());
    assertEquals(2, new File(testConnection.getPath(), "temporary").list().length);

    clientA.cleanup(cleanupOptions);

    // Functional cleanup results in removal of action file and unreferenced files
    assertEquals(0, transferManager.list(ActionRemoteFile.class).size());
    assertEquals(0, new File(testConnection.getPath(), "actions").list().length);
View Full Code Here

Examples of org.syncany.tests.util.TestClient

    // Setup
    File tempDir = TestFileUtil.createTempDirectoryInSystemTemp();
   
    TransferSettings testConnection = TestConfigUtil.createTestLocalConnection();   
    TestClient clientA = new TestClient("A", testConnection);
    TestClient clientB = new TestClient("B", testConnection);
   
    //Create ignore file and reload it
    File syncanyIgnore = clientA.getLocalFile(Config.FILE_IGNORE);
    TestFileUtil.createFileWithContent(syncanyIgnore, "regex:.*.bak");
    clientA.getConfig().getIgnoredFiles().loadPatterns();
   
    // A new/up
    clientA.createNewFile("ignoredfile.bak")
    clientA.up();
   
    clientB.down();

    // The ignored file should not exist at B
    assertTrue(clientA.getLocalFile("ignoredfile.bak").exists());
    assertFalse(clientB.getLocalFile("ignoredfile.bak").exists());
   
   
    // Tear down
    clientA.deleteTestData();
    clientB.deleteTestData();
    TestFileUtil.deleteDirectory(tempDir);
  }
View Full Code Here

Examples of samples.echo.TestClient

        // deploy the echo service
        String[] args = {"-l", "local:", "samples/echo/deploy.xml"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities
        TestClient client = new TestClient() {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue(method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.execute();

        System.out.println("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities, and tell client to
        // throw any exceptions it catches.
        TestClient client = new TestClient(true) {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not received--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.executeAll();

        log.info("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities, and tell client to
        // throw any exceptions it catches.
        TestClient client = new TestClient(true) {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not received--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.executeAll();

        log.info("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

        // deploy the echo service
        String[] args = {"-l", "local:", "samples/echo/deploy.xml"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities
        TestClient client = new TestClient() {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue(method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.execute();

        System.out.println("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities, and tell client to
        // throw any exceptions it catches.
        TestClient client = new TestClient(true) {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not received--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.executeAll();

        log.info("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities, and tell client to
        // throw any exceptions it catches.
        TestClient client = new TestClient(true) {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not received--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.executeAll();

        log.info("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "local:///AdminService",
                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities
        TestClient client = new TestClient() {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not recieved--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.execute();

        category.info("Test complete.");
    }
View Full Code Here

Examples of samples.echo.TestClient

                         "local:///AdminService",
                         "samples/echo/deploy.wsdd"};
        AdminClient.main(args);

        // define the tests using JUnit assert facilities
        TestClient client = new TestClient() {
            public void verify(String method, Object sent, Object gotBack) {
                assertTrue("What was sent was not received--" + method + ": " + gotBack, equals(sent, gotBack));
            }
        };

        // run the tests using a local (in process) server
        client.setURL("local:");
        client.executeAll();

        log.info("Test complete.");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.