use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class InfastructureMainSystemGuiTest method installAppOnSystem.
protected void installAppOnSystem(final Class<? extends SmartHouseApplication> appClass) throws Exception {
gui.getPresenter().getModel().getSystemApplicationsHandler().addApplication(new ApplicationPath(PathType.CLASS_NAME, appClass.getName()));
Thread.sleep(500);
}
use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class ApplicationsInstallerViewController method initInstallBtn.
// [start] Private - init FXML elements
private void initInstallBtn() {
installBtn.setOnAction(e -> {
installApp(new ApplicationPath(PathType.JAR_PATH, browseText.getText()));
this.<ApplicationViewController>getParentPresenter().updateListView();
});
}
use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class ApplicationsCoreTest method addApplicationAndApplicationManagerTest.
@Test
public void addApplicationAndApplicationManagerTest() throws Exception {
assert appCore.getApplicationManagers().isEmpty();
ApplicationManager m;
Assert.assertNotNull(m = appCore.addApplication(new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH)));
assert !appCore.getApplicationManagers().isEmpty();
Assert.assertEquals(appCore.getInstalledApplicationNames().stream().filter(n -> n.equals(APP1_CLASS.getName())).count(), 1);
m.setId("XXX");
Assert.assertEquals(m.getId(), "XXX");
assert m.equals(m);
assert !m.equals(null);
ApplicationManager m2 = new ApplicationManager(m.getId(), new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH));
assert m.equals(m2);
assert m2.equals(m);
Assert.assertEquals(m + "", m2 + "");
Assert.assertEquals(m.hashCode(), m2.hashCode());
assert !m.initialize(systemCore);
assert m2.initialize(systemCore);
assert !m.initialize(null);
assert !m2.initialize(null);
m.reopen(null);
m2.reopen(null);
}
use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class ApplicationsCoreTest method onAppsListChangeTest.
@Test(timeout = 1000)
public void onAppsListChangeTest() throws Exception {
final BoolLatch wasCalled = new BoolLatch();
appCore.setOnAppsListChange(() -> wasCalled.setTrueAndRelease());
Assert.assertNotNull(appCore.addApplication(new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH)));
wasCalled.blockUntilTrue();
}
use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class SmartHouseApplication method launch.
@SafeVarargs
public static void launch(final Class<? extends Application>... sensors) throws Exception {
final MainSystemGui m = new MainSystemGui();
m.addOnKillListener(() -> System.exit(0));
m.launchGui();
m.getPresenter().waitUntilLoaded();
for (final Class<? extends Application> s : sensors) JavaFxHelper.startGui(s.newInstance());
m.getPresenter().getModel().getSystemApplicationsHandler().addApplication(new ApplicationPath(PathType.CLASS_NAME, new Throwable().getStackTrace()[1].getClassName()));
m.getPresenter().gotoAppsTab();
}
Aggregations