Package org.bladerunnerjs.model.engine

Examples of org.bladerunnerjs.model.engine.Node


  }
 
  @Test
  public void fileShouldBeASubPathOfTheGivenDir()
  {
    Node node = new TestNode(mockRootNode, null, new File(TEST_DIR));
   
    assertEquals(new File(node.dir(), "path/to-file").getAbsolutePath(), node.file("path/to-file").getAbsolutePath());
  }
View Full Code Here


  }
 
  @Test
  public void fileShouldReturnAnUnrootedFileIfDirIsNull()
  {
    Node node = new TestNode(mockRootNode, null, null);
   
    assertEquals(new File("path/to-file").getAbsolutePath(), node.file("path/to-file").getAbsolutePath());
  }
View Full Code Here

  }
 
  @Test
  public void dirExistsShouldReturnTrueIfTheDirectoryExists()
  {
    Node node = new TestNode(mockRootNode, null, new File(TEST_DIR));
   
    assertTrue(node.dirExists());
  }
View Full Code Here

  }
 
  @Test
  public void dirExistsShouldReturnFalseIfTheDirectoryDoesNotExist()
  {
    Node node = new TestNode(mockRootNode, null, new File(TEST_DIR, "non-existent-directory"));
   
    assertFalse(node.dirExists());
  }
View Full Code Here

  }
 
  @Test
  public void dirExistsShouldNotThrowAnExceptionIfANullDirWasProvided()
  {
    Node node = new TestNode(mockRootNode, null, null);
   
    assertFalse(node.dirExists());
  }
View Full Code Here

  }
 
  @Test
  public void containsFileShouldNotThrowAnExceptionIfDirIsNull()
  {
    Node node = new TestNode(mockRootNode, null, null);
   
    assertFalse(node.containsFile("some-file.txt"));
  }
View Full Code Here

  }
 
  @Test
  public void containsFileShouldReturnTrueIfTheFileExists()
  {
    Node node = new TestNode(mockRootNode, null, new File(TEST_DIR));
   
    assertTrue(node.containsFile("some-file.txt"));
  }
View Full Code Here

  }
 
  @Test
  public void containsFileShouldReturnFalseIfTheFileDoesNotExist()
  {
    Node node = new TestNode(mockRootNode, null, new File(TEST_DIR));
   
    assertFalse(node.containsFile("non-existent-file.txt"));
  }
View Full Code Here

    assertTrue("temp dir exists", tempDir.exists());
    assertFalse("child dir does not exist", childDir.exists());
    assertFalse("grandchild dir does not exist", grandchildDir.exists());
    assertFalse("great grandchild dir does not exist", greatGrandchildDir.exists());
   
    Node node = new TestNode(mockRootNode, mockRootNode, grandchildDir);
    node.create();
   
    assertTrue("temp dir exists", tempDir.exists());
    assertTrue("child dir exists", childDir.exists());
    assertTrue("grandchild dir exists", grandchildDir.exists());
    assertFalse("great grandchild dir does not exist", greatGrandchildDir.exists());
View Full Code Here

  }
 
  @Test(expected=NullPointerException.class)
  public void createPathShouldThrowAnExceptionIfANullDirWasProvided() throws Exception
  {
    Node node = new TestNode(mockRootNode, null, null);
    node.create();
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.model.engine.Node

Copyright © 2018 www.massapicom. 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.