Search in sources :

Example 1 with LWM2MQuery

use of org.eclipse.vorto.repository.api.resolver.LWM2MQuery in project vorto by eclipse.

the class Lwm2mObjectIdResolverTest method testResolveResourceId.

@Test
public void testResolveResourceId() {
    checkinModel("lwm2m/ColorLight.fbmodel");
    checkinModel("lwm2m/ColorLight_lwm2m.mapping");
    DefaultResolver lwm2mResolver = new DefaultResolver();
    lwm2mResolver.setRepository(this.modelRepository);
    assertNull(lwm2mResolver.resolve(new LWM2MQuery("3")));
}
Also used : DefaultResolver(org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver) LWM2MQuery(org.eclipse.vorto.repository.api.resolver.LWM2MQuery) AbstractIntegrationTest(org.eclipse.vorto.repository.AbstractIntegrationTest) Test(org.junit.Test)

Example 2 with LWM2MQuery

use of org.eclipse.vorto.repository.api.resolver.LWM2MQuery in project vorto by eclipse.

the class Lwm2mObjectIdResolverTest method testResolveForExistingObjectId.

@Test
public void testResolveForExistingObjectId() {
    checkinModel("lwm2m/ColorLight.fbmodel");
    checkinModel("lwm2m/ColorLight_lwm2m.mapping");
    DefaultResolver lwm2mResolver = new DefaultResolver();
    lwm2mResolver.setRepository(this.modelRepository);
    assertEquals(new ModelId("ColorLight", "com.mycompany.fb", "1.0.0"), lwm2mResolver.resolve(new LWM2MQuery("2")));
    assertNotNull(this.modelRepository.getById(lwm2mResolver.resolve(new LWM2MQuery("2"))));
}
Also used : DefaultResolver(org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver) LWM2MQuery(org.eclipse.vorto.repository.api.resolver.LWM2MQuery) ModelId(org.eclipse.vorto.repository.api.ModelId) AbstractIntegrationTest(org.eclipse.vorto.repository.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

AbstractIntegrationTest (org.eclipse.vorto.repository.AbstractIntegrationTest)2 LWM2MQuery (org.eclipse.vorto.repository.api.resolver.LWM2MQuery)2 DefaultResolver (org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver)2 Test (org.junit.Test)2 ModelId (org.eclipse.vorto.repository.api.ModelId)1