Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.io;
 
 import java.io.File;
 import java.net.URI;
 
import  org.uberfire.java.nio.base.options.CommentedOption;
import  org.uberfire.java.nio.file.FileSystemAlreadyExistsException;
import  org.uberfire.java.nio.file.Path;
import static org.junit.Assert.*;
public class OpenCloseTest {
    final IOService ioService = new IOServiceDotFileImpl();
    private static File path = null;
    @Before
    public void setup() throws IOException {
         = CommonIOServiceDotFileTest.createTempDirectory();
        System.setProperty"org.uberfire.nio.git.dir".getAbsolutePath() );
        ..println".niogit: " + .getAbsolutePath() );
        final URI newRepo = URI.create"git://open-close-repo-test" );
        .newFileSystemnewReponew HashMap<StringObject>() );
    }
    @AfterClass
    @BeforeClass
    public static void cleanup() {
        if (  != null ) {
            FileUtils.deleteQuietly );
        }
    }
    @Test
    public void testOpenCloseFS() throws IOExceptionInterruptedException {
        Path init = .get( URI.create"git://open-close-repo-test/readme.txt" ) );
        .writeinit"init!"new CommentedOption( "User Tester""message1" ) );
        .deleteinit.getFileSystem().getPath( null ) );
        final URI repo = URI.create"git://open-close-repo-test" );
        try {
            .newFileSystemreponew HashMap<StringObject>() );
        } catch ( FileSystemAlreadyExistsException ex ) {
            fail"FS doesn't exists!" );
        }
        .writeinit"init!"new CommentedOption( "User Tester""message1" ) );
        assertEquals"init!".readAllStringinit ) );
        init = .get( URI.create"git://open-close-repo-test/readme.txt" ) );
        .deleteinit.getFileSystem().getPath( null ) );
    }
New to GrepCode? Check out our FAQ X