Search in sources :

Example 1 with SystemCore

use of il.ac.technion.cs.smarthouse.system.SystemCore in project Smartcity-Smarthouse by TechnionYP5777.

the class ApplicationsCoreTest method init.

@Before
public void init() {
    systemCore = new SystemCore();
    appCore = systemCore.getSystemApplicationsHandler();
}
Also used : SystemCore(il.ac.technion.cs.smarthouse.system.SystemCore) Before(org.junit.Before)

Example 2 with SystemCore

use of il.ac.technion.cs.smarthouse.system.SystemCore in project Smartcity-Smarthouse by TechnionYP5777.

the class SystemPresenter method getModel.

public final SystemCore getModel() {
    securityCheck();
    if (systemCore != null)
        return systemCore;
    systemCore = new SystemCore();
    // TODO: this should look
    systemCore.initializeSystemComponents();
    return systemCore;
}
Also used : SystemCore(il.ac.technion.cs.smarthouse.system.SystemCore)

Example 3 with SystemCore

use of il.ac.technion.cs.smarthouse.system.SystemCore in project Smartcity-Smarthouse by TechnionYP5777.

the class ApplicationsCoreTest method savebleTest.

@Test
public void savebleTest() throws Exception {
    Assert.assertNotNull(appCore.addApplication(new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH)));
    ApplicationsCore appCoreNew = new SystemCore().getSystemApplicationsHandler();
    appCoreNew.populate(appCore.toJsonString());
    assert !appCoreNew.getApplicationManagers().isEmpty();
    Assert.assertEquals(appCoreNew.getInstalledApplicationNames().stream().filter(n -> n.equals(APP1_CLASS.getName())).count(), 1);
}
Also used : SystemCore(il.ac.technion.cs.smarthouse.system.SystemCore) ApplicationPath(il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath) Test(org.junit.Test)

Example 4 with SystemCore

use of il.ac.technion.cs.smarthouse.system.SystemCore in project Smartcity-Smarthouse by TechnionYP5777.

the class AlertsServiceTest method init.

@Before
public void init() {
    serviceManager_noUser = new ServiceManager(new SystemCore());
    SystemCore s = new SystemCore();
    serviceManager_withUser = new ServiceManager(s);
    s.initializeUser("Bob", "123", "050", "HERE");
    s.getUser().addContact(new Contact("111", "Alice", "999", "a@b.com"), EmergencyLevel.SMS_EMERGENCY_CONTACT);
    s.getUser().addContact(new Contact("111", "Alice", "999", "a@b.com"), EmergencyLevel.EMAIL_EMERGENCY_CONTACT);
    s.getUser().addContact(new Contact("111", "Alice", "999", "a@b.com"), EmergencyLevel.CALL_EMERGENCY_CONTACT);
}
Also used : SystemCore(il.ac.technion.cs.smarthouse.system.SystemCore) ServiceManager(il.ac.technion.cs.smarthouse.system.services.ServiceManager) Contact(il.ac.technion.cs.smarthouse.system.user_information.Contact) Before(org.junit.Before)

Aggregations

SystemCore (il.ac.technion.cs.smarthouse.system.SystemCore)4 Before (org.junit.Before)2 ApplicationPath (il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath)1 ServiceManager (il.ac.technion.cs.smarthouse.system.services.ServiceManager)1 Contact (il.ac.technion.cs.smarthouse.system.user_information.Contact)1 Test (org.junit.Test)1