Package net.sf.maven.plugins.eclipseformat

Examples of net.sf.maven.plugins.eclipseformat.ConfigReader


     *             if the test has an error.
     */
    public void testGetPropertiesInvalidFile() throws Exception {

        // invalid file
        reader = new ConfigReader(log, "/importorder-test", null, false);
        properties = reader.getProperties();
        assertNotNull("Invalid properties should not be null", properties);
        assertTrue("Invalid properties should be empty", properties.isEmpty());

        try {
            // invalid file
            reader = new ConfigReader(log, "/importorder-test", null, true);
            reader.getProperties();
            fail("Should fail, failOnError flag is true");
        } catch (Exception e) {
            assertEquals("Error type should match", MojoExecutionException.class, e.getClass());
        }
View Full Code Here


     *             if the test has an error.
     */
    public void testGetPropertiesEmptyFile() throws Exception {

        // file with empty values
        reader = new ConfigReader(log, "/code-formatter-test.xml", null, false);
        properties = reader.getProperties();
        assertNotNull("Empty properties should not be null", properties);
        assertEquals("Empty properties should have 1 entry", 1, properties.size());

    }
View Full Code Here

     *             if the test has an error.
     */
    public void testGetPropertiesDefaultFormat() throws Exception {

        // default
        reader = new ConfigReader(log, EclipseFormatMojo.CODE_FORMAT_CONFIG, null, false);
        properties = reader.getProperties();
        assertNotNull("Default code format properties should not be null", properties);
        assertFalse("Default code format properties should not be empty", properties.isEmpty());
        assertEquals("Tabulation char should match", "space", properties.getProperty(TABULATION_CHAR));
    }
View Full Code Here

     * @throws Exception
     *             if the test has an error.
     */
    public void testGetPropertiesSunFormat() throws Exception {
        // sun
        reader = new ConfigReader(log, EclipseFormatMojo.CODE_FORMAT_CONFIG,
                "src/test/resources/sun-code-formatter.xml", false);
        properties = reader.getProperties();
        assertNotNull("File system code format properties should not be null", properties);
        assertFalse("File system code format properties should not be empty", properties.isEmpty());
        assertEquals("Tabulation char should match", "mixed", properties.getProperty(TABULATION_CHAR));
View Full Code Here

     *             if the test has an error.
     */
    public void testGetPropertiesEclipseFormat() throws Exception {

        // eclipse
        reader = new ConfigReader(log, EclipseFormatMojo.CODE_FORMAT_CONFIG, "eclipse-code-formatter.xml", false);
        properties = reader.getProperties();
        assertNotNull("Classpath code format properties should not be null", properties);
        assertFalse("Classpath code format properties should not be empty", properties.isEmpty());
        assertEquals("Tabulation char should match", "tab", properties.getProperty(TABULATION_CHAR));
    }
View Full Code Here

TOP

Related Classes of net.sf.maven.plugins.eclipseformat.ConfigReader

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.