View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.util;
8   
9   import org.mule.tck.junit4.AbstractMuleTestCase;
10  
11  import java.io.InputStream;
12  
13  import org.junit.Test;
14  
15  import static org.junit.Assert.assertNotNull;
16  import static org.junit.Assert.assertNull;
17  
18  public class IOUtilsTestCase extends AbstractMuleTestCase
19  {
20  
21      @Test
22      public void testLoadingResourcesAsStream() throws Exception
23      {
24          InputStream is = IOUtils.getResourceAsStream("log4j.properties", getClass(), false, false);
25          assertNotNull(is);
26  
27          is = IOUtils.getResourceAsStream("does-not-exist.properties", getClass(), false, false);
28          assertNull(is);
29      }
30  
31  }