Search in sources :

Example 1 with ApplicationPath

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);
}
Also used : ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath)

Example 2 with ApplicationPath

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();
    });
}
Also used : ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath)

Example 3 with ApplicationPath

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);
}
Also used : ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath) Test(org.junit.Test)

Example 4 with ApplicationPath

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();
}
Also used : BoolLatch(il.ac.technion.cs.smarthouse.utils.BoolLatch) ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath) Test(org.junit.Test)

Example 5 with ApplicationPath

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();
}
Also used : MainSystemGui(il.ac.technion.cs.smarthouse.system.gui.main_system.MainSystemGui) ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath)

Aggregations

ApplicationPath (il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath)7 Test (org.junit.Test)4 SystemCore (il.ac.technion.cs.smarthouse.system.SystemCore)1 MainSystemGui (il.ac.technion.cs.smarthouse.system.gui.main_system.MainSystemGui)1 BoolLatch (il.ac.technion.cs.smarthouse.utils.BoolLatch)1