Package org.junithelper.core.meta

Examples of org.junithelper.core.meta.CurrentLineBreak


                    IFile testCaseFile = getIFile(project, resourcePathForTestCaseFile);
                    String testCaseFileEncoding = UniversalDetectorUtil.getDetectedEncoding(EclipseIFileUtil
                            .getInputStreamFrom(testCaseFile));
                    String currentTestCodeString = IOUtil.readAsString(EclipseIFileUtil
                            .getInputStreamFrom(testCaseFile), testCaseFileEncoding);
                    CurrentLineBreak currentLineBreak = CurrentLineBreakDetector.detect(currentTestCodeString);
                    LineBreakProvider lineBreakProvider = new LineBreakProvider(config, currentLineBreak);
                    TestCaseGenerator generator = TestCaseGeneratorFactory.create(config, lineBreakProvider);
                    String newTestCodeString = generator.initialize(targetClassMeta)
                            .getTestCaseSourceCodeWithLackingTestMethod(currentTestCodeString);
View Full Code Here


    }

    @Test
    public void instantiation() throws Exception {
        Configuration config = new Configuration();
        CurrentLineBreak currentLineBreak = CurrentLineBreak.CRLF;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        assertThat(target, notNullValue());
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_FORCE_CRLF() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceCRLF;
        CurrentLineBreak currentLineBreak = CurrentLineBreak.LF;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\r\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_FORCE_LF() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceLF;
        CurrentLineBreak currentLineBreak = CurrentLineBreak.CRLF;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_CRLF_NEW_FILE_ONLY_1() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceNewFileCRLF;
        CurrentLineBreak currentLineBreak = CurrentLineBreak.LF;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_CRLF_NEW_FILE_ONLY_2() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceNewFileCRLF;
        CurrentLineBreak currentLineBreak = null;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\r\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_LF_NEW_FILE_ONLY_1() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceNewFileLF;
        CurrentLineBreak currentLineBreak = CurrentLineBreak.CRLF;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\r\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    @Test
    public void getLineBreak_A$_LF_NEW_FILE_ONLY_2() throws Exception {
        Configuration config = new Configuration();
        config.lineBreakPolicy = LineBreakPolicy.forceNewFileLF;
        CurrentLineBreak currentLineBreak = null;
        LineBreakProvider target = new LineBreakProvider(config, currentLineBreak);
        String actual = target.getLineBreak();
        String expected = "\n";
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    }

    @Test
    public void detect_A$String_CRLF() throws Exception {
        String sourceCodeString = "foo\r\nbar\r\n";
        CurrentLineBreak actual = CurrentLineBreakDetector.detect(sourceCodeString);
        CurrentLineBreak expected = CurrentLineBreak.CRLF;
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

    }

    @Test
    public void detect_A$String_LF() throws Exception {
        String sourceCodeString = "foo\nbar\n";
        CurrentLineBreak actual = CurrentLineBreakDetector.detect(sourceCodeString);
        CurrentLineBreak expected = CurrentLineBreak.LF;
        assertThat(actual, is(equalTo(expected)));
    }
View Full Code Here

TOP

Related Classes of org.junithelper.core.meta.CurrentLineBreak

Copyright © 2018 www.massapicom. 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.