// Path: core/src/main/java/se/tfiskgul/mux2fs/Constants.java
// public static final int SUCCESS = 0;
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/DirectoryFiller.java
// public interface DirectoryFiller {
// 
// 	int add(String name, Path path)
// 			throws IOException;
// 
// 	int addWithExtraSize(String name, Path path, long extraSize)
// 			throws IOException;
// }
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/FileHandleFiller.java
// @FunctionalInterface
// public interface FileHandleFiller {
// 
// 	void setFileHandle(int fileHandle);
// 
// 	public static class Recorder implements FileHandleFiller {
// 
// 		private final FileHandleFiller delegate;
// 		private int fileHandle = -1;
// 
// 		public static Recorder wrap(FileHandleFiller filler) {
// 			return new Recorder(filler);
// 		}
// 
// 		private Recorder(FileHandleFiller filler) {
// 			this.delegate = filler;
// 		}
// 
// 		public int getFileHandle() {
// 			return fileHandle;
// 		}
// 
// 		@Override
// 		public void setFileHandle(int fileHandle) {
// 			this.fileHandle = fileHandle;
// 			delegate.setFileHandle(fileHandle);
// 		}
// 	}
// }
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/StatFiller.java
// public interface StatFiller {
// 
// 	UnixFileStat stat(Path path)
// 			throws IOException;
// 
// 	UnixFileStat statWithSize(Path path, Function<FileInfo, Optional<Long>> sizeGetter, Supplier<Long> extraSizeGetter)
// 			throws IOException;
// }


import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.AdditionalMatchers.gt;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static se.tfiskgul.mux2fs.Constants.SUCCESS;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import ru.serce.jnrfuse.ErrorCodes;
import se.tfiskgul.mux2fs.fs.base.DirectoryFiller;
import se.tfiskgul.mux2fs.fs.base.FileHandleFiller;
import se.tfiskgul.mux2fs.fs.base.StatFiller;
/*
MIT License

Copyright (c) 2017 Carl-Frederik Hallberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
 */
package se.tfiskgul.mux2fs.fs.mirror;





public class MirrorFsTest extends MirrorFsFixture {

	@Test
	public void testGetAttr()
			throws Exception {
		// Given
		StatFiller stat = mock(StatFiller.class);
		when(fileSystem.getPath(mirrorRoot.toString(), "/")).thenReturn(mirrorRoot);
		// When
		int result = fs.getattr("/", stat);
		// Then
// Path: core/src/main/java/se/tfiskgul/mux2fs/Constants.java
// public static final int SUCCESS = 0;
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/DirectoryFiller.java
// public interface DirectoryFiller {
// 
// 	int add(String name, Path path)
// 			throws IOException;
// 
// 	int addWithExtraSize(String name, Path path, long extraSize)
// 			throws IOException;
// }
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/FileHandleFiller.java
// @FunctionalInterface
// public interface FileHandleFiller {
// 
// 	void setFileHandle(int fileHandle);
// 
// 	public static class Recorder implements FileHandleFiller {
// 
// 		private final FileHandleFiller delegate;
// 		private int fileHandle = -1;
// 
// 		public static Recorder wrap(FileHandleFiller filler) {
// 			return new Recorder(filler);
// 		}
// 
// 		private Recorder(FileHandleFiller filler) {
// 			this.delegate = filler;
// 		}
// 
// 		public int getFileHandle() {
// 			return fileHandle;
// 		}
// 
// 		@Override
// 		public void setFileHandle(int fileHandle) {
// 			this.fileHandle = fileHandle;
// 			delegate.setFileHandle(fileHandle);
// 		}
// 	}
// }
// 
// Path: core/src/main/java/se/tfiskgul/mux2fs/fs/base/StatFiller.java
// public interface StatFiller {
// 
// 	UnixFileStat stat(Path path)
// 			throws IOException;
// 
// 	UnixFileStat statWithSize(Path path, Function<FileInfo, Optional<Long>> sizeGetter, Supplier<Long> extraSizeGetter)
// 			throws IOException;
// }


// Path: core/src/test/java/se/tfiskgul/mux2fs/fs/mirror/MirrorFsTest.java
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.AdditionalMatchers.gt;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import static se.tfiskgul.mux2fs.Constants.SUCCESS;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import ru.serce.jnrfuse.ErrorCodes;
import se.tfiskgul.mux2fs.fs.base.DirectoryFiller;
import se.tfiskgul.mux2fs.fs.base.FileHandleFiller;
import se.tfiskgul.mux2fs.fs.base.StatFiller;

/*
MIT License

Copyright (c) 2017 Carl-Frederik Hallberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
 */
package se.tfiskgul.mux2fs.fs.mirror;





public class MirrorFsTest extends MirrorFsFixture {

	@Test
	public void testGetAttr()
			throws Exception {
		// Given
		StatFiller stat = mock(StatFiller.class);
		when(fileSystem.getPath(mirrorRoot.toString(), "/")).thenReturn(mirrorRoot);
		// When
		int result = fs.getattr("/", stat);
		// Then
		assertThat(result).isEqualTo(SUCCESS);