Search in sources :

Example 6 with ModelLoader

use of io.joynr.generator.loading.ModelLoader in project joynr by bmwcarit.

the class BroadcastUtilTest method testFilterParameters.

@Test
public void testFilterParameters() throws Exception {
    URL fixtureURL = BroadcastUtilTest.class.getResource("FilterParameters.fidl");
    ModelLoader loader = new ModelLoader(fixtureURL.getPath());
    Resource fixtureResource = loader.getResources().iterator().next();
    BroadcastUtil broadcastUtil = Guice.createInjector().getInstance(BroadcastUtil.class);
    FModel model = (FModel) fixtureResource.getContents().get(0);
    FBroadcast fixture = model.getInterfaces().get(0).getBroadcasts().get(0);
    ArrayList<String> result = broadcastUtil.getFilterParameters(fixture);
    assertEquals(result.size(), 2);
    assertTrue(result.contains("genre"));
    assertTrue(result.contains("language"));
}
Also used : ModelLoader(io.joynr.generator.loading.ModelLoader) FBroadcast(org.franca.core.franca.FBroadcast) FModel(org.franca.core.franca.FModel) Resource(org.eclipse.emf.ecore.resource.Resource) URL(java.net.URL) Test(org.junit.Test)

Aggregations

ModelLoader (io.joynr.generator.loading.ModelLoader)6 Resource (org.eclipse.emf.ecore.resource.Resource)6 URL (java.net.URL)4 FModel (org.franca.core.franca.FModel)4 Test (org.junit.Test)3 FType (org.franca.core.franca.FType)2 AbstractModule (com.google.inject.AbstractModule)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 Diagnostic (org.eclipse.emf.ecore.resource.Resource.Diagnostic)1 FBasicTypeId (org.franca.core.franca.FBasicTypeId)1 FBroadcast (org.franca.core.franca.FBroadcast)1 FCompoundType (org.franca.core.franca.FCompoundType)1 FMethod (org.franca.core.franca.FMethod)1 FTypeCollection (org.franca.core.franca.FTypeCollection)1 CallsRealMethods (org.mockito.internal.stubbing.answers.CallsRealMethods)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1