@Test public void testHybridMobileEngineIsManaged() { HybridMobileEngine engine_0 = new HybridMobileEngine(); engine_0.setId("platform_0"); engine_0.setVersion("0.0.0"); engine_0.setLocation(CordovaEngineProvider.getLibFolder().append("myplatform")); assertTrue(engine_0.isManaged()); HybridMobileEngine engine_1 = new HybridMobileEngine(); engine_1.setId("platform_0"); engine_1.setVersion("0.0.0"); engine_1.setLocation(new Path("/some/location")); assertFalse(engine_1.isManaged()); }
// Check given set of engines are persisted to config.xml correctly private void checkEnginesPersistedCorrectly(final HybridMobileEngine[] engines) throws CoreException { Widget w = WidgetModel.getModel(testproject.hybridProject()).getWidgetForRead(); assertEquals(engines.length, w.getEngines().size()); List<Engine> persistedEngines = w.getEngines(); for (HybridMobileEngine hybridMobileEngine : engines) { boolean enginePersisted = false; for (Engine engine : persistedEngines) { if (hybridMobileEngine.getId().equals(engine.getName()) && hybridMobileEngine.getVersion().equals(engine.getVersion())) { enginePersisted = true; break; } } assertTrue("HybridMobile Engine is not persisted correctly", enginePersisted); } }
@Test public void testHybridMobileEngineEquals() { HybridMobileEngine engine_0 = new HybridMobileEngine(); engine_0.setId("platform_0"); engine_0.setVersion("0.0.0"); HybridMobileEngine engine_1 = new HybridMobileEngine(); engine_1.setId("platform_0"); engine_1.setVersion("0.0.0"); assertEquals(engine_0, engine_1); }