Package org.bladerunnerjs.model.engine

Examples of org.bladerunnerjs.model.engine.Node


    childDir.mkdirs();
   
    assertTrue("temp dir exists", rootDir.exists());
    assertTrue("child dir exists", childDir.exists());
   
    Node node = new TestNode(new TestRootNode(rootDir), null, rootDir);
    node.delete();
   
    assertFalse("temp dir does not exist", rootDir.exists());
    assertFalse("child dir does not exist", childDir.exists());
  }
View Full Code Here


   
    rootDir.mkdir();
   
    assertTrue("temp dir exists", rootDir.exists());
   
    Node node = new TestNode(new TestRootNode(rootDir), null, rootDir);
    node.delete();
   
    assertFalse("temp dir does not exist", rootDir.exists());
  }
View Full Code Here

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

   
    rootDir.mkdir();
    child1.mkdir();
    TestRootNode rootNode = new TestRootNode(rootDir);
   
    Node childNode1 = rootNode.childNode("1");
    Node childNode2 = rootNode.childNode("2");
   
    assertEquals(1, rootNode.childNodes().size());
    assertSame(childNode1, rootNode.childNodes().get(0));
   
    child2.mkdir();
View Full Code Here

    File itemDir = new File(rootDir, "single-item");
    itemDir.mkdirs();
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
   
    Node itemNode = rootNode.locateAncestorNodeOfClass(itemDir, TestItemNode.class);
   
    assertEquals(itemDir.getCanonicalPath(), rootNode.itemNode().dir().getPath());
    assertSame(itemNode, rootNode.itemNode());
  }
View Full Code Here

    File itemDir = new File(rootDir, "single-item");
   
    rootDir.mkdir();
    TestRootNode rootNode = new TestRootNode(rootDir);
   
    Node singleItemNode = rootNode.locateAncestorNodeOfClass(itemDir, TestItemNode.class);
    assertNull(singleItemNode);
  }
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());
  }
View Full Code Here

    File rootDir = new File(tempDir, "brjs-root-node");
    File primaryItemDir = new File(rootDir, "single-item-primary-location");
    rootDir.mkdir();
   
    TestRootNode rootNode = new TestRootNode(rootDir);
    Node itemNode = rootNode.locateAncestorNodeOfClass(primaryItemDir, TestMultiLocationItemNode.class);
   
    assertNull(itemNode);
  }
View Full Code Here

    File primaryItemDir = new File(rootDir, "single-item-primary-location");
    primaryItemDir.mkdirs();
   
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
    Node itemNode = rootNode.locateAncestorNodeOfClass(primaryItemDir, TestMultiLocationItemNode.class);
   
    assertEquals(primaryItemDir.getCanonicalPath(), itemNode.dir().getPath());
  }
View Full Code Here

    File secondaryItemDir = new File(rootDir, "single-item-secondary-location");
    secondaryItemDir.mkdirs();
   
    TestRootNode rootNode = new TestRootNode(rootDir);
    rootNode.registerNode(rootNode);
    Node itemNode = rootNode.locateAncestorNodeOfClass(secondaryItemDir, TestMultiLocationItemNode.class);
   
    assertEquals(secondaryItemDir.getCanonicalPath(), itemNode.dir().getPath());
  }
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.