use of org.apache.twill.api.TwillContext in project cdap by caskdata.
the class DistributedProgramRunnableModuleTest method createModule.
@Test
public void createModule() throws Exception {
DistributedProgramRunnableModule distributedProgramRunnableModule = new DistributedProgramRunnableModule(CConfiguration.create(), new Configuration());
Guice.createInjector(distributedProgramRunnableModule.createModule(new ProgramId("ns", "app", ProgramType.MAPREDUCE, "program"), RunIds.generate().getId(), "0", "user/host@KDC.NET"));
Guice.createInjector(distributedProgramRunnableModule.createModule(new TwillContext() {
@Override
public RunId getRunId() {
return null;
}
@Override
public RunId getApplicationRunId() {
return null;
}
@Override
public int getInstanceCount() {
return 0;
}
@Override
public InetAddress getHost() {
// used by DistributedProgramRunnableModule#createModule(TwillContext)
return new InetSocketAddress("localhost", 0).getAddress();
}
@Override
public String[] getArguments() {
return new String[0];
}
@Override
public String[] getApplicationArguments() {
return new String[0];
}
@Override
public TwillRunnableSpecification getSpecification() {
return null;
}
@Override
public int getInstanceId() {
return 0;
}
@Override
public int getVirtualCores() {
return 0;
}
@Override
public int getMaxMemoryMB() {
return 0;
}
@Override
public ServiceDiscovered discover(String name) {
return null;
}
@Override
public Cancellable electLeader(String name, ElectionHandler participantHandler) {
return null;
}
@Override
public Lock createLock(String name) {
return null;
}
@Override
public Cancellable announce(String serviceName, int port) {
return null;
}
@Override
public Cancellable announce(String serviceName, int port, byte[] payload) {
return null;
}
}, new ProgramId("ns", "app", ProgramType.MAPREDUCE, "program"), RunIds.generate().getId(), "0", "user/host@KDC.NET"));
}
Aggregations