View Javadoc

1   // ========================================================================
2   // Copyright (c) Webtide LLC
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   //
8   // The Eclipse Public License is available at 
9   // http://www.eclipse.org/legal/epl-v10.html
10  //
11  // The Apache License v2.0 is available at
12  // http://www.apache.org/licenses/LICENSE-2.0.txt
13  //
14  // You may elect to redistribute this code under either of these licenses. 
15  // ========================================================================
16  package org.eclipse.jetty.server.session.test;
17  
18  import java.io.File;
19  
20  import org.junit.Assert;
21  
22  public class PathAssert
23  {
24      public static void assertDirExists(String msg, File path)
25      {
26          assertExists(msg,path);
27          Assert.assertTrue(msg + " path should be a Dir : " + path.getAbsolutePath(),path.isDirectory());
28      }
29  
30      public static void assertFileExists(String msg, File path)
31      {
32          assertExists(msg,path);
33          Assert.assertTrue(msg + " path should be a File : " + path.getAbsolutePath(),path.isFile());
34      }
35  
36      public static void assertExists(String msg, File path)
37      {
38          Assert.assertTrue(msg + " path should exist: " + path.getAbsolutePath(),path.exists());
39      }
40  }