Skip to content

Commit

Permalink
make test pass
Browse files Browse the repository at this point in the history
  • Loading branch information
umjammer committed Jun 5, 2020
1 parent 555c5f9 commit 793d57f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
run: mvn -B install --file pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Collections;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -57,8 +58,9 @@ void test2() throws Exception {
}

@Test
@DisabledIfEnvironmentVariable(named = "GITHUB_WORKFLOW", matches = ".*")
void test3() throws Exception {
URI uri = URI.create("archive:file:/Users/nsano/src/vavi/vavi-util-archive/tmp/ugca010c.lzh");
URI uri = URI.create("archive:file:/Users/nsano/src/vavi/vavi-util-archive/src/test/resources/test.lzh");
FileSystem fs = FileSystems.newFileSystem(uri, Collections.EMPTY_MAP);
Files.list(fs.getRootDirectories().iterator().next()).forEach(System.err::println);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Map;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;

import com.github.fge.filesystem.box.provider.BoxFileSystemProvider;
import com.github.fge.fs.dropbox.provider.DropBoxFileSystemProvider;
Expand Down Expand Up @@ -126,6 +127,7 @@ private FileSystem getFileSystem(String id) throws IOException {
}

@Test
@DisabledIfEnvironmentVariable(named = "GITHUB_WORKFLOW", matches = ".*")
void test() throws IOException {
Map<String, FileSystem> fileSystems = new HashMap<>();
NameMap nameMap = new NameMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Collections;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable;


/**
Expand All @@ -23,8 +24,9 @@
class HfsFileSystemProviderTest {

@Test
@DisabledIfEnvironmentVariable(named = "GITHUB_WORKFLOW", matches = ".*")
void test3() throws Exception {
URI uri = URI.create("hfs:file:/Users/nsano/Downloads/Play-20170829.dmg");
URI uri = URI.create("hfs:file:/Users/nsano/Downloads/googlechrome-80.dmg");
FileSystem fs = new HfsFileSystemProvider().newFileSystem(uri, Collections.EMPTY_MAP);
Files.list(fs.getRootDirectories().iterator().next()).forEach(System.err::println);
}
Expand Down
26 changes: 18 additions & 8 deletions vavi-nio-file-sandbox/src/test/java/Test5.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
* Programmed by Naohide Sano
*/

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;

import org.cryptomator.frontend.fuse.mount.EnvironmentVariables;
import org.cryptomator.frontend.fuse.mount.FuseMountFactory;
import org.cryptomator.frontend.fuse.mount.Mount;
import org.cryptomator.frontend.fuse.mount.Mounter;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;


/**
Expand All @@ -22,19 +23,28 @@
*/
public class Test5 {

/**
* @param args
*/
public static void main(String[] args) throws Exception {
Path mountPoint = Files.createTempDirectory("fuse-mount");
// TODO doesn't work
@Test
@Disabled
public void test01() throws Exception {
// String email = System.getenv("TEST5_GOOGLE_ACCOUNT");
String mp = System.getenv("TEST5_GOOGLE_MOUNT_POINT");

// URI uri = URI.create("googledrive:///?id=" + email);
// Map<String, Object> env = new HashMap<>();
// env.put("ignoreAppleDouble", true);
// FileSystem fs = new GoogleDriveFileSystemProvider().newFileSystem(uri, env);
// Path remote = fs.getRootDirectories().iterator().next();
Path remote = Paths.get("/tmp");

Path mountPoint = Paths.get(mp);
Mounter mounter = FuseMountFactory.getMounter();
EnvironmentVariables envVars = EnvironmentVariables.create()
.withFlags(mounter.defaultMountFlags())
.withMountPoint(mountPoint)
.withRevealCommand("nautilus")
.build();
Path tmp = Paths.get("/tmp");
Mount mnt = mounter.mount(tmp, envVars);
Mount mnt = mounter.mount(remote, envVars);
mnt.revealInFileManager();
System.out.println("Wait for it...");
System.in.read();
Expand Down

0 comments on commit 793d57f

Please sign in to comment.