Package org.bladerunnerjs.utility

Source Code of org.bladerunnerjs.utility.RelativePathUtilityTest

package org.bladerunnerjs.utility;

import static org.junit.Assert.*;

import java.io.File;
import java.io.IOException;

import org.bladerunnerjs.model.BRJS;
import org.bladerunnerjs.model.TestModelAccessor;
import org.bladerunnerjs.model.exception.InvalidSdkDirectoryException;
import org.junit.Test;

public class RelativePathUtilityTest extends TestModelAccessor {
 
  @Test
  public void testRelativePaths() throws InvalidSdkDirectoryException, IOException {
    BRJS brjs = createModel( FileUtility.createTemporaryDirectory(this.getClass()) );
    assertEquals("child", RelativePathUtility.get(brjs.getFileInfoAccessor(), new File("."), new File("child")));
    assertEquals("child/grandchild", RelativePathUtility.get(brjs.getFileInfoAccessor(), new File("."), new File("child/grandchild")));
    assertEquals("../child/grandchild", RelativePathUtility.get(brjs.getFileInfoAccessor(), new File("."), new File("../child/grandchild")));
  }
 
}
TOP

Related Classes of org.bladerunnerjs.utility.RelativePathUtilityTest

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.