Search in sources :

Example 1 with DefaultResolver

use of org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver 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 DefaultResolver

use of org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver 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)

Example 3 with DefaultResolver

use of org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver in project vorto by eclipse.

the class BlueToothDeviceInfoProfileResolverTest method testResolveInfoModelByDeviceInfoProfileSerialNo.

@Test
public void testResolveInfoModelByDeviceInfoProfileSerialNo() {
    checkinModel("bluetooth/ColorLight.fbmodel");
    checkinModel("bluetooth/ColorLightIM.infomodel");
    checkinModel("bluetooth/ColorLight_bluetooth.mapping");
    DefaultResolver resolver = new DefaultResolver();
    resolver.setRepository(this.modelRepository);
    assertEquals(new ModelId("ColorLightIM", "com.mycompany", "1.0.0"), resolver.resolve(new BluetoothQuery("4810")));
    assertNotNull(this.modelRepository.getById(resolver.resolve(new BluetoothQuery("4810"))));
}
Also used : DefaultResolver(org.eclipse.vorto.repository.core.impl.resolver.DefaultResolver) BluetoothQuery(org.eclipse.vorto.repository.api.resolver.BluetoothQuery) ModelId(org.eclipse.vorto.repository.api.ModelId) AbstractIntegrationTest(org.eclipse.vorto.repository.AbstractIntegrationTest) Test(org.junit.Test)

Aggregations

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