Examples of FileWriter


Examples of org.junithelper.core.file.FileWriter

        try {

            // given
            File testFile = new File("src/test/java/org/junithelper/core/config/LineBreakPolicyTest.java");
            FileWriter writer = FileWriterFactory.create(testFile);
            String preparedSource = IOUtil.readAsString(IOUtil.getResourceAsStream("LineBreakPolicyTestBefore.txt"),
                    "UTF-8");
            writer.writeText(preparedSource);

            // when
            String[] args = new String[] { "src/main/java/org/junithelper/core/config/LineBreakPolicy.java" };
            System.setProperty("junithelper.skipConfirming", "true");
            System.setProperty("junithelper.configProperties",
                    "src/test/resources/junithelper-config_forceLF.properties");
            MakeTestCommand.main(args);

            // then
            Thread.sleep(100L);

            InputStream is = new FileInputStream(testFile);
            String source = IOUtil.readAsString(is, "UTF-8");
            assertThat(source.contains("\r"), is(false)); // TEST

        } finally {

            File testFile = new File("src/test/java/org/junithelper/core/config/LineBreakPolicyTest.java");
            FileWriter writer = FileWriterFactory.create(testFile);
            String preparedSource = IOUtil.readAsString(IOUtil.getResourceAsStream("LineBreakPolicyTest.txt"), "UTF-8");
            writer.writeText(preparedSource);

        }
    }
View Full Code Here

Examples of org.xmlBlaster.contrib.filewriter.FileWriter

         prop.put("filewriter.directoryName", writerDirName);
         prop.put("filewriter.tmpDirectoryName", writerTmpDirName);
         prop.put("filewriter.overwrite", "true");
         prop.put("filewriter.lockExtention", ".lck");
         prop.put("__useNativeCfg", "false"); // we don't want to set native stuff for testing
         receiver = new FileWriter(this.global, "fileWriter", prop);
      }
      catch (Throwable ex) {
         ex.printStackTrace();
         fail("aborting since exception ex: " + ex.getMessage());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.