Advertisement
k-joseph

Untitled

Jun 4th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. @Test
  2. public void testWhetherWeCanWriteToConf() {
  3.  
  4. File folder = new File("/home/k-joseph/.OpenMRS/solr/conf");
  5. File file = new File("/home/k-joseph/.OpenMRS/solr/conf/testing");
  6.  
  7. Assert.assertFalse(file.exists());
  8.  
  9. if (folder.exists()) {
  10. try {
  11. file.createNewFile();
  12. }
  13. catch (IOException e) {
  14. // TODO Auto-generated catch block
  15. System.out.println("Failed to create "+ file.getPath()+" file");
  16. }
  17. System.out.println("Successfully created "+file.getPath()+" file");
  18. }
  19.  
  20. Assert.assertTrue(file.exists());
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement