// Path: src/main/java/at/ac/ait/archistar/engine/distributor/Distributor.java
// public interface Distributor {
// 
//     boolean putFragmentSet(Set<Fragment> fragments);
// 
//     public boolean getFragmentSet(Set<Fragment> fragments);
// 
//     int connectServers();
// 
//     int disconnectServers();
// }
// 
// Path: src/main/java/at/ac/ait/archistar/engine/distributor/ServerConfiguration.java
// public class ServerConfiguration {
// 
//     protected HashMap<String, StorageServer> serverMapId = new HashMap<>();
// 
//     public ServerConfiguration(Set<StorageServer> servers) {
//         for (StorageServer s : servers) {
//             this.serverMapId.put(s.getId(), s);
//         }
//     }
// 
//     /**
//      * this is needed for the BFT network
//      *
//      * @return a Map <bft-id, server-port>
//      */
//     public Map<Integer, Integer> getBFTServerNetworkPortMap() {
// 
//         HashMap<Integer, Integer> serverList = new HashMap<>();
//         int i = 0;
//         for (StorageServer s : this.serverMapId.values()) {
//             serverList.put(s.getBFTId(), 20000 + i++);
//         }
// 
//         return serverList;
//     }
// 
//     public StorageServer getStorageServer(String serverid) {
//         return this.serverMapId.get(serverid);
//     }
// 
//     public Collection<StorageServer> getOnlineStorageServers() {
//         return this.serverMapId.values();
//     }
// 
//     public int getOnlineStorageServerCount() {
//         return this.getOnlineStorageServers().size();
//     }
// }
// 
// Path: src/main/java/at/ac/ait/archistar/engine/metadata/MetadataService.java
// public interface MetadataService {
// 
//     /**
//      * connect and bootstrap to servers
//      */
//     int connect();
// 
//     /**
//      * disconnect from all servers
//      */
//     int disconnect();
// 
//     /**
//      * returns a matching for a given path
//      */
//     Set<Fragment> getDistributionFor(String path);
// 
//     /**
//      * makes sure that everything is synchronized
//      */
//     int synchronize();
// 
//     /**
//      * List files in correspondence to a path expression
//      */
//     Set<String> list(String path);
// 
//     /**
//      * removes an object from the index
//      */
//     int delete(FSObject obj);
// 
//     /**
//      * retrieves stat information about an object
//      */
//     Map<String, String> stat(String path);
// }


import at.ac.ait.archistar.engine.distributor.Distributor;
import at.ac.ait.archistar.engine.distributor.ServerConfiguration;
import at.ac.ait.archistar.engine.metadata.MetadataService;
import at.archistar.crypto.CryptoEngine;
package at.ac.ait.archistar.engine;


/**
 * This engine adds some features needed for testing.
 *
 * Mostly added to not further mess up the Engine code
 *
 * @author andy
 */
public class TestEngine extends Engine {

    public TestEngine(ServerConfiguration servers, MetadataService naming, Distributor distributor, CryptoEngine crypto) {
        super(servers, naming, distributor, crypto);
    }

// Path: src/main/java/at/ac/ait/archistar/engine/distributor/Distributor.java
// public interface Distributor {
// 
//     boolean putFragmentSet(Set<Fragment> fragments);
// 
//     public boolean getFragmentSet(Set<Fragment> fragments);
// 
//     int connectServers();
// 
//     int disconnectServers();
// }
// 
// Path: src/main/java/at/ac/ait/archistar/engine/distributor/ServerConfiguration.java
// public class ServerConfiguration {
// 
//     protected HashMap<String, StorageServer> serverMapId = new HashMap<>();
// 
//     public ServerConfiguration(Set<StorageServer> servers) {
//         for (StorageServer s : servers) {
//             this.serverMapId.put(s.getId(), s);
//         }
//     }
// 
//     /**
//      * this is needed for the BFT network
//      *
//      * @return a Map <bft-id, server-port>
//      */
//     public Map<Integer, Integer> getBFTServerNetworkPortMap() {
// 
//         HashMap<Integer, Integer> serverList = new HashMap<>();
//         int i = 0;
//         for (StorageServer s : this.serverMapId.values()) {
//             serverList.put(s.getBFTId(), 20000 + i++);
//         }
// 
//         return serverList;
//     }
// 
//     public StorageServer getStorageServer(String serverid) {
//         return this.serverMapId.get(serverid);
//     }
// 
//     public Collection<StorageServer> getOnlineStorageServers() {
//         return this.serverMapId.values();
//     }
// 
//     public int getOnlineStorageServerCount() {
//         return this.getOnlineStorageServers().size();
//     }
// }
// 
// Path: src/main/java/at/ac/ait/archistar/engine/metadata/MetadataService.java
// public interface MetadataService {
// 
//     /**
//      * connect and bootstrap to servers
//      */
//     int connect();
// 
//     /**
//      * disconnect from all servers
//      */
//     int disconnect();
// 
//     /**
//      * returns a matching for a given path
//      */
//     Set<Fragment> getDistributionFor(String path);
// 
//     /**
//      * makes sure that everything is synchronized
//      */
//     int synchronize();
// 
//     /**
//      * List files in correspondence to a path expression
//      */
//     Set<String> list(String path);
// 
//     /**
//      * removes an object from the index
//      */
//     int delete(FSObject obj);
// 
//     /**
//      * retrieves stat information about an object
//      */
//     Map<String, String> stat(String path);
// }


// Path: src/main/java/at/ac/ait/archistar/engine/TestEngine.java
import at.ac.ait.archistar.engine.distributor.Distributor;
import at.ac.ait.archistar.engine.distributor.ServerConfiguration;
import at.ac.ait.archistar.engine.metadata.MetadataService;
import at.archistar.crypto.CryptoEngine;

package at.ac.ait.archistar.engine;


/**
 * This engine adds some features needed for testing.
 *
 * Mostly added to not further mess up the Engine code
 *
 * @author andy
 */
public class TestEngine extends Engine {

    public TestEngine(ServerConfiguration servers, MetadataService naming, Distributor distributor, CryptoEngine crypto) {
        super(servers, naming, distributor, crypto);
    }

    public int getNumberOfServers() {