Search in sources :

Example 1 with FBroadcast

use of org.franca.core.franca.FBroadcast 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)1 URL (java.net.URL)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 FBroadcast (org.franca.core.franca.FBroadcast)1 FModel (org.franca.core.franca.FModel)1 Test (org.junit.Test)1