FileSystemContractVerifier.java

/***************************************************************************
   Copyright 2014 Emily Estes

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
***************************************************************************/
package net.metanotion.io;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** This class takes a file system, and some file names and attempts to verify that the contracts
specified in the (J)FileSystem interface documentation holds for the file system implementation.
If any of the tests fail it will through an AssertionError.
*/
public final class FileSystemContractVerifier {
	private static final Logger logger = LoggerFactory.getLogger(FileSystemContractVerifier.class);

	public static void readOnlyTests(FileSystem<File> fs, String aChild) {
//		final File root = fs.getRoot();
//		if(!root.getChild(aChild).getParent().equals(root)) {
//			throw new AssertionError("f.getChild(...).getParent.equals(f) identity does not hold");
//		}
		// 	myFile.parent().getChild(myFile.getShortName()).equals(myFile).
		// come up with some more.
	}
}