Examples of TemporaryFileManager


Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

     * Tests that file names given will be correctly resolved relative to the
     * location of the main configuration file.
     * @throws Exception if there is a problem in the test
     */
    public void testGetConfigRelativeFile() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new NonExistantTemporaryFileCreator());
        manager.executeWith(new MyTemporaryFileExecutor() {
            public void execute(File file) throws Exception {

                try {
                    file.mkdirs();
                    String testFileName = "testFile";
View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

     * to either an absolute resource or path, or path relative to the main
     * configuration file.
     * @throws Exception if there is a problem in the test
     */
    public void testCreateConfigInputStream() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new NonExistantTemporaryFileCreator());
        manager.executeWith(new MyTemporaryFileExecutor() {
            public void execute(File file) throws Exception {
                try {
                    file.mkdirs();
                    File configFile = new File(file, "mcs-config.xml");
                    configFile.createNewFile();
View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

     * resource or file identifier, or is not present. Also tests that it fails
     * if an invalid location is supplied.
     * @throws Exception if there is a problem in the test
     */
    public void testGetMainConfigInputSource() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new NonExistantTemporaryFileCreator());
        manager.executeWith(new MyTemporaryFileExecutor() {
            public void execute(File file) throws Exception {
                try {
                    file.mkdirs();
                    String realPath = file.getAbsolutePath();

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    private static EclipseDeviceRepository updateHierarchy(
            final InputStream inputHierarchy) throws Exception {

        final EclipseDeviceRepository[] accessor =
                new EclipseDeviceRepository[1];
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {

                accessor[0] = updateHierarchy(inputHierarchy,
                        temporaryFile.getPath());
            }
View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test the reading of a repository from a zip file stored in a jar file.
     */
    public void testRepositoryRead() throws Exception {

        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File temporaryFile) throws Exception {
                EclipseDeviceRepository accessor =
                        new EclipseDeviceRepository(temporaryFile.getPath(),
                                transformerMetaFactory, jdomFactory, false, true, null);

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test the reading and writing of a repository from a local file.
     */
    public void testRepositoryReadAndWrite() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
                // Create a temporary repository which will be deleted later.
                EclipseDeviceRepository accessor = updateHierarchy(
                        getHierarchy(), repository.getPath());

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test the writing of the repository.
     */
    public void testWriting() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
                // Create a temporary repository which will be deleted later.
                EclipseDeviceRepository accessor = updateHierarchy(
                        getHierarchy(), repository.getPath());

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test that hierarchy xml can be read, updated, written and reread.
     */
    public void testUpdateHierarchy() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
                // Create a temporary repository which will be deleted later.
                EclipseDeviceRepository accessor = updateHierarchy(
                        getHierarchy(), repository.getPath());

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test that the definitions xml can be successfully written
     */
    public void testWriteDefinitions() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
                // Create a temporary repository which will be deleted later.
                EclipseDeviceRepository accessor = updateHierarchy(
                        getHierarchy(), repository.getPath());

View Full Code Here

Examples of com.volantis.synergetics.testtools.io.TemporaryFileManager

    /**
     * Test that the definitions xml can be successfully read in
     */
    public void testReadDefinitions() throws Exception {
        TemporaryFileManager manager = new TemporaryFileManager(
                new TestDeviceRepositoryCreator());
        manager.executeWith(new TemporaryFileExecutor() {
            public void execute(File repository) throws Exception {
                // Create a temporary repository which will be deleted later.
                EclipseDeviceRepository accessor = updateHierarchy(
                        getHierarchy(), repository.getPath());

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.