KarafInstance { public KarafInstance( String root, String clientType ) { this( root, System.getProperty( "karaf.etc" ) + "/" + YAML_FILE_NAME, "default" ); this.clientType = clientType; } KarafInstance( String root, String clientType );  KarafInstance( String root, String instanceFilePath, String clientType ); void setCachePath( String cachePath ); @SuppressWarnings( "unchecked" ) void processConfigFile(); void assignPortsAndCreateCache(); void close(); int getInstanceNumber(); String getCachePath(); void registerPort( KarafInstancePort instancePort ); KarafInstancePort getPort( String id ); Set<String> getPortIds(); List<KarafInstancePort> getPorts(); void setInstanceNumber( Integer instanceNumber ); void setInstanceSocket( ServerSocket instanceSocket ); String getClientType(); void setCacheLock( FileLock cacheLock );  }
@Test public void testKarafInstance() throws Exception { KarafInstance karafInstance1 = createTestInstance( 1 ); KarafInstance karafInstance2 = createTestInstance( 2 ); KarafInstance karafInstance3 = createTestInstance( 3 ); karafInstance2.close(); karafInstance2 = createTestInstance( 2 ); KarafInstance karafInstance4 = createTestInstance( 4 ); karafInstance1.close(); karafInstance2.close(); karafInstance3.close(); karafInstance4.close(); }