Package org.bladerunnerjs.model.engine

Examples of org.bladerunnerjs.model.engine.Node.dir()


  @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());
  }
 
  @Test
  public void fileShouldReturnAnUnrootedFileIfDirIsNull()
  {
View Full Code Here


    TestRootNode rootNode = new TestRootNode(new File(TEST_DIR, "brjs-root-node"));
    Node childNode1 = rootNode.childNode("1");
   
    assertSame(childNode1, rootNode.childNode("1"));
    assertSame(childNode1, rootNode.locateAncestorNodeOfClass(rootNode.childNode("1").grandChildNode("2").dir(), TestChildNode.class));
    assertNotSame(childNode1, new TestChildNode(rootNode, childNode1.parentNode(), childNode1.dir(), "1"));
  }
 
  @Test
  public void cachedNonExistentItemsWillLaterBeUsedIfTheItemSubsequentlyComesIntoExistence() throws Exception
  {
View Full Code Here

    itemDir.mkdirs();
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
   
    Node singleItemNode = rootNode.locateAncestorNodeOfClass(itemDir, TestItemNode.class);
    assertEquals(itemDir.getCanonicalPath(), singleItemNode.dir().getPath());
  }
 
  @Test
  public void nonExistentMultiLocationSingleItemNodesCanBeNavigated() throws Exception
  {
View Full Code Here

   
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
    Node itemNode = rootNode.locateAncestorNodeOfClass(primaryItemDir, TestMultiLocationItemNode.class);
   
    assertEquals(primaryItemDir.getCanonicalPath(), itemNode.dir().getPath());
  }
 
  @Test
  public void multiLocationSingleItemNodesCanBeLocatedWhenAtTheSecondaryLocation() throws Exception
  {
View Full Code Here

   
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
    Node itemNode = rootNode.locateAncestorNodeOfClass(secondaryItemDir, TestMultiLocationItemNode.class);
   
    assertEquals(secondaryItemDir.getCanonicalPath(), itemNode.dir().getPath());
  }
 
  @Test
  public void multiLocationItemSetNodesCanBeNavigatedWhenItemsPresentInOneSideOnly() throws Exception
  {
View Full Code Here

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.