@Test public void basicTest() throws RendererException { Set<TestVertex> set = new HashSet<>(); set.add(new TestVertex.Builder("actor1.as", "action1a",null).build()); set.add(new TestVertex.Builder("actor2bb", "action1b", null).build()); Result res = new Result(); res.put(ResultContent.RELATED_TESTS, Set.class, set); FileWriterEngine.write(set, new FileOptions.FileOptionsBuilder().with(fo -> {fo.name = MY_TEST_FILE; fo.type = FileType.CSV ;}).build()); assertTrue(new File(System.getProperty("user.dir"), MY_TEST_FILE).exists()); }
public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); static void write(Object result, FileOptions options); }
FileWriterEngine { public static void write(Object result, FileOptions options) throws RendererException { Objects.requireNonNull(result); Object content = Objects.requireNonNull(getFileStrategy(options, result)).render(); FileWriter fileWriter = getFileWriter(options.getType()); fileWriter.write(new File(options.getName()).toPath(), content); } private  FileWriterEngine(); static void write(Object result, FileOptions options);  }