@Test public void testModelToSystemMetaData() throws IOException { SystemMetaData expectedMetaData = new SystemMetaData(); expectedMetaData.uri = "http: expectedMetaData.name = "Dummy System"; expectedMetaData.description = "Example of a HOBBIT T3.2 system that is compatible to the GERBIL benchmark"; expectedMetaData.implementedApis = new HashSet<>(); expectedMetaData.implementedApis.add("http: expectedMetaData.mainImage = "gerbil_dummy_system"; expectedMetaData.usedImages = new HashSet<>(); expectedMetaData.usedImages.add("gerbil_dummy_system_part2"); expectedMetaData.date = new Date(10); expectedMetaData.source = "test"; InputStream input = ParameterForwardingTest.class.getClassLoader() .getResourceAsStream("org/hobbit/controller/dummySystem.ttl"); Assert.assertNotNull(input); byte modelDat[] = StreamUtils.getBytes(input); IOUtils.closeQuietly(input); expectedMetaData.rdfModel = MetaDataFactory.byteArrayToModel(modelDat, "TTL"); List<SystemMetaData> results = MetaDataFactory.modelToSystemMetaData(expectedMetaData.rdfModel, expectedMetaData.source, expectedMetaData.date); Assert.assertEquals(1, results.size()); compareMetaData(expectedMetaData, results.get(0)); String[] expectedApis = expectedMetaData.implementedApis.toArray(new String[expectedMetaData.implementedApis.size()]); Arrays.sort(expectedApis); String[] actualApis = results.get(0).implementedApis.toArray(new String[0]); Arrays.sort(actualApis); Assert.assertArrayEquals(expectedApis, actualApis); }
public static List<SystemMetaData> modelToSystemMetaData(Model model) { return modelToSystemMetaData(model, null, null); }
MetaDataFactory { public static List<SystemMetaData> modelToSystemMetaData(Model model) { return modelToSystemMetaData(model, null, null); } }
MetaDataFactory { public static List<SystemMetaData> modelToSystemMetaData(Model model) { return modelToSystemMetaData(model, null, null); }  }
MetaDataFactory { public static List<SystemMetaData> modelToSystemMetaData(Model model) { return modelToSystemMetaData(model, null, null); }  static List<BenchmarkMetaData> modelToBenchmarkMetaData(Model model); static List<BenchmarkMetaData> modelToBenchmarkMetaData(Model model, String source, Date date); static List<SystemMetaData> modelToSystemMetaData(Model model); static List<SystemMetaData> modelToSystemMetaData(Model model, String source, Date date); static Model ttlStringToModel(String modelString, String lang); static Model byteArrayToModel(byte data[], String lang); static Model getModelWithUniqueBenchmark(Model model, String benchmarkUri); static Model getModelWithUniqueSystem(Model model, String systemUri); }
MetaDataFactory { public static List<SystemMetaData> modelToSystemMetaData(Model model) { return modelToSystemMetaData(model, null, null); }  static List<BenchmarkMetaData> modelToBenchmarkMetaData(Model model); static List<BenchmarkMetaData> modelToBenchmarkMetaData(Model model, String source, Date date); static List<SystemMetaData> modelToSystemMetaData(Model model); static List<SystemMetaData> modelToSystemMetaData(Model model, String source, Date date); static Model ttlStringToModel(String modelString, String lang); static Model byteArrayToModel(byte data[], String lang); static Model getModelWithUniqueBenchmark(Model model, String benchmarkUri); static Model getModelWithUniqueSystem(Model model, String systemUri);  }