package be.iminds.ilabt.jfed.ui.commandline;

import be.iminds.ilabt.jfed.util.TargetAuthority;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.name.Names;

import java.util.Properties;

/**
 * User: twalcari
 * Date: 1/13/2015
 * Time: 12:02
 */
public class TestTargetFromContextFileModule extends AbstractModule {
    private final Properties contextFileProperties;

    public TestTargetFromContextFileModule(Properties contextFileProperties) {
        this.contextFileProperties = contextFileProperties;
    }

    @Override
    protected void configure() {
        bind(Properties.class).annotatedWith(Names.named("contextFileProperties")).toInstance(contextFileProperties);
        bind(ContextFile.class);
    }

    @Provides
    public TargetAuthority provideTargetAuthority(ContextFile contextFile) throws ContextFile.ContextFileException {
        return contextFile.getTestedAuthority();
    }

//    @Provides
//    @Named("testedAuthorityForRspec")
//    public Server provideTestedAuthorityForRspec(TargetAuthority targetAuthority) {
//        return targetAuthority.getServerForRspecComponentManager();
//    }
//
//    @Provides
//    @Named("testedAuthorityToConnect")
//    public Server provideTestedAuthorityToConnect(TargetAuthority targetAuthority) {
//        return targetAuthority.getServerToConnect();
//    }
}
