Examples of MockVFSContext


Examples of org.jboss.test.virtual.support.MockVFSContext

      assertNull(file.getParent());
   }
  
   public void testGetParentSimpleChild() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();

      VirtualFile root = VFS.getRoot(context.getRootURI());
      VirtualFile child = root.findChild("child1");
      VirtualFile parent = child.getParent();
      assertEquals(root, parent);
   }
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      assertEquals(root, parent);
   }
  
   public void testGetParentStructuredChild() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();

      VirtualFile root = VFS.getRoot(context.getRootURI());
      VirtualFile child = root.findChild("child1");
      VirtualFile subChild = child.findChild("child1,1");
      VirtualFile parent = child.getParent();
      assertEquals(root, parent);
      parent = subChild.getParent();
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      assertEquals(child, parent);
   }

   public void testGetParentIOException() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
      context.getMockRoot().setIOException("getParent");

      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.getParent();
         fail("Should not be here");
      }
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      }
   }

   public void testGetParentClosed() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();

      VirtualFile file = VFS.getRoot(context.getRootURI());
      file.close();
      try
      {
         file.getParent();
         fail("Should not be here");
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      }
   }

   public void testGetAllChildren() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child2 = getChildHandler(context, "child2").getVirtualFile();
      VirtualFile child3 = getChildHandler(context, "child3").getVirtualFile();
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      List<VirtualFile> children = file.getChildren();
      assertNotNull(children);
     
      List<VirtualFile> expected = new ArrayList<VirtualFile>();
      expected.add(child1);
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      assertEquals(expected, children);
   }

   public void testGetAllChildrenStructured() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child2 = getChildHandler(context, "child2").getVirtualFile();
      VirtualFile child3 = getChildHandler(context, "child3").getVirtualFile();
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      List<VirtualFile> children = file.getChildren();
      assertNotNull(children);
     
      List<VirtualFile> expected = new ArrayList<VirtualFile>();
      expected.add(child1);
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      assertEquals(expected, children);
   }

   public void testGetAllChildrenNoChildren() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
      context.getMockRoot().setLeaf(false);
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      List<VirtualFile> children = file.getChildren();
      assertNotNull(children);
     
      assertEmpty(children);
   }
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      assertEmpty(children);
   }

   public void testGetAllChildrenIsLeaf() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.getChildren();
         fail("Should not be here!");
      }
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      }
   }

   public void testGetAllChildrenIOException() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
      context.getMockRoot().setIOException("getChildren");
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      try
      {
         file.getChildren();
         fail("Should not be here!");
      }
View Full Code Here

Examples of org.jboss.test.virtual.support.MockVFSContext

      }
   }

   public void testGetAllChildrenWithNullFilter() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child2 = getChildHandler(context, "child2").getVirtualFile();
      VirtualFile child3 = getChildHandler(context, "child3").getVirtualFile();
     
      VirtualFile file = VFS.getRoot(context.getRootURI());
      List<VirtualFile> children = file.getChildren(null);
      assertNotNull(children);
     
      List<VirtualFile> expected = new ArrayList<VirtualFile>();
      expected.add(child1);
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.