@Test public void testGetInputStream() throws Exception { ClusterDefinitionProvider provider = getProvider("clusterproperties.txt", "myCluster", "myVersion"); InputStream inputStream = provider.getInputStream(); Assert.assertNotNull(inputStream); }
public InputStream getInputStream() { InputStream is; String name = this.fileName == null ? DEFAULT_SCOM_CLUSTER_DEFINITION_FILENAME : this.fileName; try { is = this.getClass().getClassLoader().getResourceAsStream(name); if (is == null) { throw new IllegalStateException("Can't find the resource " + name + " in the classpath."); } } catch (Exception e) { String msg = "Caught exception reading " + name + "."; throw new IllegalStateException(msg, e); } return is; }
ClusterDefinitionProvider { public InputStream getInputStream() { InputStream is; String name = this.fileName == null ? DEFAULT_SCOM_CLUSTER_DEFINITION_FILENAME : this.fileName; try { is = this.getClass().getClassLoader().getResourceAsStream(name); if (is == null) { throw new IllegalStateException("Can't find the resource " + name + " in the classpath."); } } catch (Exception e) { String msg = "Caught exception reading " + name + "."; throw new IllegalStateException(msg, e); } return is; } }
ClusterDefinitionProvider { public InputStream getInputStream() { InputStream is; String name = this.fileName == null ? DEFAULT_SCOM_CLUSTER_DEFINITION_FILENAME : this.fileName; try { is = this.getClass().getClassLoader().getResourceAsStream(name); if (is == null) { throw new IllegalStateException("Can't find the resource " + name + " in the classpath."); } } catch (Exception e) { String msg = "Caught exception reading " + name + "."; throw new IllegalStateException(msg, e); } return is; } protected  ClusterDefinitionProvider(); }
ClusterDefinitionProvider { public InputStream getInputStream() { InputStream is; String name = this.fileName == null ? DEFAULT_SCOM_CLUSTER_DEFINITION_FILENAME : this.fileName; try { is = this.getClass().getClassLoader().getResourceAsStream(name); if (is == null) { throw new IllegalStateException("Can't find the resource " + name + " in the classpath."); } } catch (Exception e) { String msg = "Caught exception reading " + name + "."; throw new IllegalStateException(msg, e); } return is; } protected  ClusterDefinitionProvider(); void init(Configuration configuration); static ClusterDefinitionProvider instance(); String getFileName(); String getClusterName(); String getVersionId(); InputStream getInputStream(); }
ClusterDefinitionProvider { public InputStream getInputStream() { InputStream is; String name = this.fileName == null ? DEFAULT_SCOM_CLUSTER_DEFINITION_FILENAME : this.fileName; try { is = this.getClass().getClassLoader().getResourceAsStream(name); if (is == null) { throw new IllegalStateException("Can't find the resource " + name + " in the classpath."); } } catch (Exception e) { String msg = "Caught exception reading " + name + "."; throw new IllegalStateException(msg, e); } return is; } protected  ClusterDefinitionProvider(); void init(Configuration configuration); static ClusterDefinitionProvider instance(); String getFileName(); String getClusterName(); String getVersionId(); InputStream getInputStream();  }