use of org.eclipse.vorto.repository.api.ModelInfo in project vorto by eclipse.
the class MappingTest method testGetPlatformMappingsOfEntity.
@Test
public void testGetPlatformMappingsOfEntity() throws Exception {
checkinModel("Color.type");
checkinModel("sample.mapping");
Thread.sleep(2000);
ModelInfo colorInfo = modelRepository.getById(ModelId.fromReference("org.eclipse.vorto.examples.type.Color", "1.0.0"));
assertEquals(1, colorInfo.getPlatformMappings().size());
assertEquals("ios", colorInfo.getPlatformMappings().keySet().iterator().next());
}
use of org.eclipse.vorto.repository.api.ModelInfo in project vorto by eclipse.
the class ModelRepositoryTest method testGetReferencesFromModel.
@Test
public void testGetReferencesFromModel() throws Exception {
checkinModel("Color.type");
checkinModel("Colorlight.fbmodel");
assertEquals(2, modelRepository.search("*").size());
ModelInfo result = modelRepository.getById(ModelId.fromReference("org.eclipse.vorto.examples.fb.ColorLight", "1.0.0"));
assertEquals(1, result.getReferences().size());
assertEquals("org.eclipse.vorto.examples.type.Color:1.0.0", result.getReferences().get(0).getPrettyFormat());
}
use of org.eclipse.vorto.repository.api.ModelInfo in project vorto by eclipse.
the class ModelRepositoryTest method testGetModelById.
@Test
public void testGetModelById() throws Exception {
checkinModel("Color.type");
assertEquals(1, modelRepository.search("*").size());
ModelInfo result = modelRepository.getById(ModelId.fromReference("org.eclipse.vorto.examples.type.Color", "1.0.0"));
assertNotNull(result);
}
use of org.eclipse.vorto.repository.api.ModelInfo in project vorto by eclipse.
the class NotificationServiceTest method testSendCheckedModelEmail.
@Test
public void testSendCheckedModelEmail() throws Exception {
User user = new User();
user.setEmail("alexander.edelmann@bosch-si.com");
user.setUsername("aedelmann");
ModelInfo resource = new ModelInfo(new ModelId("Fridge", "org.eclipse.vorto.examples", "1.0.0"), ModelType.Functionblock);
resource.setAuthor("andreas");
resource.setCreationDate(new Date());
resource.setDescription("A fridge keeps groceries fresh");
notificationService.sendNotification(new CheckinMessage(user, resource));
assertEquals(1, wiser.getMessages().size());
assertTrue(((String) wiser.getMessages().get(0).getMimeMessage().getContent()).contains("A new model has just been checked into the Vorto Repository"));
assertTrue(((String) wiser.getMessages().get(0).getMimeMessage().getContent()).contains("Dear aedelmann"));
}
use of org.eclipse.vorto.repository.api.ModelInfo in project vorto by eclipse.
the class ModelRepositoryClientTest method testSearchModelBySpecificType.
@Test
public void testSearchModelBySpecificType() throws Exception {
Collection<ModelInfo> models = modelRepo.search(new ModelQueryBuilder().type(ModelType.InformationModel).name("XDK").build()).get();
assertTrue(models.size() > 0);
}
Aggregations