Package org.jboss.test.virtual.support

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


      return new TestSuite(VirtualFileUnitTestCase.class);
   }

   public void testGetNameRoot() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
     
      URI uri = context.getRootURI();
      assertGetName(uri, "");
   }
View Full Code Here


      assertGetName(uri, "");
   }

   public void testGetNameChildren() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
     
      URI uri = context.getRootURI();
      assertGetName(uri, "child1");
      assertGetName(uri, "child2");
      assertGetName(uri, "child3");
   }
View Full Code Here

      assertGetName(uri, "child3");
   }

   public void testGetNameSubChildren() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
     
      URI uri = context.getRootURI();
      assertGetName(uri, "child1/child1,1", "child1,1");
      assertGetName(uri, "child2/child2,1", "child2,1");
      assertGetName(uri, "child2/child2,2", "child2,2");
      assertGetName(uri, "child3/child3,1", "child3,1");
      assertGetName(uri, "child3/child3,2", "child3,2");
View Full Code Here

      assertGetName(uri, "child3/child3,3", "child3,3");
   }

   public void testGetPathNameRoot() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
     
      URI uri = context.getRootURI();
      assertGetPathName(uri, "");
   }
View Full Code Here

      assertGetPathName(uri, "");
   }

   public void testGetPathNameChildren() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContextWithChildren();
     
      URI uri = context.getRootURI();
      assertGetPathName(uri, "");
      assertGetPathName(uri, "child1");
      assertGetPathName(uri, "child2");
      assertGetPathName(uri, "child3");
   }
View Full Code Here

      assertGetPathName(uri, "child3");
   }

   public void testGetPathNameSubChildren() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
     
      URI uri = context.getRootURI();
      assertGetPathName(uri, "");
      assertGetPathName(uri, "child1");
      assertGetPathName(uri, "child1/child1,1");
      assertGetPathName(uri, "child2");
      assertGetPathName(uri, "child2/child2,1");
View Full Code Here

      assertGetPathName(uri, "child3/child3,3");
   }

   public void testToURI() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
      URI uri = context.getRootURI();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child11 = getChildHandler(context, "child1/child1,1").getVirtualFile();
     
      VirtualFile root = VFS.getRoot(uri);
      assertEquals(uri, root.toURI());
View Full Code Here

      assertEquals(child11.toURI(), found11.toURI());
   }

   public void testToURL() throws Exception
   {
      MockVFSContext context = registerStructuredVFSContextWithSubChildren();
      URL url = context.getRootURL();
      VirtualFile child1 = getChildHandler(context, "child1").getVirtualFile();
      VirtualFile child11 = getChildHandler(context, "child1/child1,1").getVirtualFile();
     
      VirtualFile root = VFS.getRoot(url);
      assertEquals(url, root.toURL());
View Full Code Here

      assertEquals(child11.toURL(), found11.toURL());
   }

   public void testGetLastModfied() throws Exception
   {
      MockVFSContext context = registerSimpleVFSContext();
      context.getMockRoot().setLastModified(12345l);

      VirtualFile file = VFS.getRoot(context.getRootURI());
      assertEquals(12345l, file.getLastModified());

      context.getMockRoot().setLastModified(67890l);
      assertEquals(67890l, file.getLastModified());
   }
View Full Code Here

      assertEquals(67890l, file.getLastModified());
   }

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

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

TOP

Related Classes of org.jboss.test.virtual.support.MockVFSContext

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.