use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath in project Smartcity-Smarthouse by TechnionYP5777.
the class ApplicationsCoreTest method stupidApplicationManagerTest.
@Test
public void stupidApplicationManagerTest() {
ApplicationManager m1 = new ApplicationManager(null, new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH));
ApplicationManager m2 = new ApplicationManager(null, new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH));
ApplicationManager m3 = new ApplicationManager("XXX", new ApplicationPath(PathType.CLASS_NAME, APP1_CLASSPATH));
assert m1.equals(m2);
assert m2.equals(m1);
assert !m1.equals(m3);
assert !m3.equals(m1);
assert !m2.equals(m3);
assert !m3.equals(m2);
assert !m1.equals(null);
assert !m1.equals("Bla");
Assert.assertEquals(m1.hashCode(), m2.hashCode());
Assert.assertNotEquals(m1.hashCode(), m3.hashCode());
Assert.assertNotEquals(m2.hashCode(), m3.hashCode());
Assert.assertNull(m1.getApplicationName());
}
use of il.ac.technion.cs.smarthouse.system.applications.installer.ApplicationPath 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);
}
Aggregations