use of org.eclipse.che.api.core.model.machine.Machine in project che by eclipse.
the class ProcessesPanelPresenter method onDownloadWorkspaceOutput.
@Override
public void onDownloadWorkspaceOutput(DownloadWorkspaceOutputEvent event) {
Machine devMachine = null;
for (ProcessTreeNode machineNode : machineNodes.values()) {
if (!(machineNode.getData() instanceof Machine)) {
continue;
}
Machine machine = (Machine) machineNode.getData();
if (!machine.getConfig().isDev()) {
continue;
}
devMachine = machine;
break;
}
if (devMachine == null) {
return;
}
String fileName = appContext.getWorkspace().getNamespace() + "-" + appContext.getWorkspace().getConfig().getName() + " " + DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + ".log";
download(fileName, getText(devMachine.getId()));
}
use of org.eclipse.che.api.core.model.machine.Machine in project che by eclipse.
the class RunCommandActionTest method actionShouldBePerformed.
@Test
public void actionShouldBePerformed() {
when(event.getParameters()).thenReturn(Collections.singletonMap(NAME_PROPERTY, "MCI"));
final DevMachine devMachine = mock(DevMachine.class);
final Machine machine = mock(Machine.class);
when(devMachine.getDescriptor()).thenReturn(machine);
when(appContext.getDevMachine()).thenReturn(devMachine);
action.actionPerformed(event);
verify(commandManager).executeCommand(eq(command), any(Machine.class));
}
Aggregations