Skip to content

Commit

Permalink
running dos2unix on all files in repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Fryc committed Jan 22, 2013
1 parent a657d74 commit 3935398
Show file tree
Hide file tree
Showing 1,687 changed files with 161,071 additions and 161,071 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package org.richfaces.arquillian.page.source;

import org.custommonkey.xmlunit.Difference;
import org.custommonkey.xmlunit.DifferenceConstants;
import org.custommonkey.xmlunit.DifferenceListener;
import org.w3c.dom.Node;

/**
* @author akolonitsky
* @since Oct 22, 2010
*/
public class IgnoreScriptsContent implements DifferenceListener {
public int differenceFound(Difference difference) {
if (DifferenceConstants.TEXT_VALUE_ID == difference.getId()
&& !"script".equalsIgnoreCase(difference.getTestNodeDetail().getNode().getLocalName())) {

return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
}
return RETURN_ACCEPT_DIFFERENCE;
}

public void skippedComparison(Node node, Node node1) {

}
}
package org.richfaces.arquillian.page.source;

import org.custommonkey.xmlunit.Difference;
import org.custommonkey.xmlunit.DifferenceConstants;
import org.custommonkey.xmlunit.DifferenceListener;
import org.w3c.dom.Node;

/**
* @author akolonitsky
* @since Oct 22, 2010
*/
public class IgnoreScriptsContent implements DifferenceListener {
public int differenceFound(Difference difference) {
if (DifferenceConstants.TEXT_VALUE_ID == difference.getId()
&& !"script".equalsIgnoreCase(difference.getTestNodeDetail().getNode().getLocalName())) {

return RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
}
return RETURN_ACCEPT_DIFFERENCE;
}

public void skippedComparison(Node node, Node node1) {

}
}
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
package org.richfaces.arquillian.page.source;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.URL;

import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.DifferenceListener;
import org.custommonkey.xmlunit.XMLUnit;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.test.spi.TestClass;
import org.openqa.selenium.By;
import org.openqa.selenium.By.ById;
import org.openqa.selenium.By.ByTagName;
import org.xml.sax.SAXException;

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class SourceChecker {

@Inject
private Instance<TestClass> testClass;

public void checkComponentSource(URL pageName, String xmlunitPage, By pageElementToTest) throws IOException, SAXException {
WebClient client = new WebClient();
HtmlPage page = client.getPage(pageName);
DomElement element;

String locator = pageElementToTest.toString();
locator = locator.substring(locator.indexOf(':') + 1).trim();

if (pageElementToTest instanceof ById) {
element = page.getElementById(locator);
} else if (pageElementToTest instanceof ByTagName) {
element = page.getElementsByTagName(locator).get(0);
} else {
throw new IllegalArgumentException("Only id and name are supported");
}

String pageCode = element.asXml();

checkXmlStructure(xmlunitPage, pageCode);
}

protected void checkXmlStructure(String xmlunitPage, String pageCode) throws SAXException, IOException {
InputStream expectedPageCode = testClass.get().getJavaClass().getResourceAsStream(xmlunitPage);

XMLUnit.setNormalizeWhitespace(true);
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
XMLUnit.setIgnoreWhitespace(true);
XMLUnit.setIgnoreComments(true);

Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new StringReader(pageCode));
xmlDiff.overrideDifferenceListener(getDifferenceListener());

if (!xmlDiff.similar()) {
System.out.println("=== ACTUAL PAGE CODE ===");
System.out.println(pageCode);
System.out.println("======== ERROR =========");
System.out.println(xmlDiff.toString());
System.out.println("========================");
fail("XML was not similar:" + xmlDiff.toString());
}
}

protected DifferenceListener getDifferenceListener() {
return new IgnoreScriptsContent();
}
}
package org.richfaces.arquillian.page.source;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.URL;

import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.DifferenceListener;
import org.custommonkey.xmlunit.XMLUnit;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.test.spi.TestClass;
import org.openqa.selenium.By;
import org.openqa.selenium.By.ById;
import org.openqa.selenium.By.ByTagName;
import org.xml.sax.SAXException;

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.DomElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class SourceChecker {

@Inject
private Instance<TestClass> testClass;

public void checkComponentSource(URL pageName, String xmlunitPage, By pageElementToTest) throws IOException, SAXException {
WebClient client = new WebClient();
HtmlPage page = client.getPage(pageName);
DomElement element;

String locator = pageElementToTest.toString();
locator = locator.substring(locator.indexOf(':') + 1).trim();

if (pageElementToTest instanceof ById) {
element = page.getElementById(locator);
} else if (pageElementToTest instanceof ByTagName) {
element = page.getElementsByTagName(locator).get(0);
} else {
throw new IllegalArgumentException("Only id and name are supported");
}

String pageCode = element.asXml();

checkXmlStructure(xmlunitPage, pageCode);
}

protected void checkXmlStructure(String xmlunitPage, String pageCode) throws SAXException, IOException {
InputStream expectedPageCode = testClass.get().getJavaClass().getResourceAsStream(xmlunitPage);

XMLUnit.setNormalizeWhitespace(true);
XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true);
XMLUnit.setIgnoreWhitespace(true);
XMLUnit.setIgnoreComments(true);

Diff xmlDiff = new Diff(new InputStreamReader(expectedPageCode), new StringReader(pageCode));
xmlDiff.overrideDifferenceListener(getDifferenceListener());

if (!xmlDiff.similar()) {
System.out.println("=== ACTUAL PAGE CODE ===");
System.out.println(pageCode);
System.out.println("======== ERROR =========");
System.out.println(xmlDiff.toString());
System.out.println("========================");
fail("XML was not similar:" + xmlDiff.toString());
}
}

protected DifferenceListener getDifferenceListener() {
return new IgnoreScriptsContent();
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>
<suppress checks="JavadocStyleCheck" />

<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>
<suppress checks="JavadocStyleCheck" />

</suppressions>
58 changes: 29 additions & 29 deletions components/dist/assembler.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<assembly>
<id>sources</id>
<formats>
<format>dir</format>
</formats>

<moduleSets>
<moduleSet>
<includeSubModules>true</includeSubModules>
<includes>
<include>org.richfaces.ui.*:*</include>
</includes>

<sources>
<outputDirectoryMapping>/</outputDirectoryMapping>
<excludeSubModuleDirectories>true</excludeSubModuleDirectories>
<fileSets>
<fileSet>
<directory>src/main/resources/META-INF/resources</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.js</include>
</includes>
</fileSet>
</fileSets>
</sources>
</moduleSet>
</moduleSets>
</assembly>
<assembly>
<id>sources</id>
<formats>
<format>dir</format>
</formats>

<moduleSets>
<moduleSet>
<includeSubModules>true</includeSubModules>
<includes>
<include>org.richfaces.ui.*:*</include>
</includes>

<sources>
<outputDirectoryMapping>/</outputDirectoryMapping>
<excludeSubModuleDirectories>true</excludeSubModuleDirectories>
<fileSets>
<fileSet>
<directory>src/main/resources/META-INF/resources</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.js</include>
</includes>
</fileSet>
</fileSets>
</sources>
</moduleSet>
</moduleSets>
</assembly>
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<window-title>VDL Documentation</window-title>
<doc-title>Tag Library Documentation Generator - Generated Documentation</doc-title>

<taglibs>
<taglib short-name="a4j">
<display-name>Ajax4JSF</display-name>
<doc-title>Ajax4JSF VDL Documentation</doc-title>
<path>../../../target/taglibs/META-INF/a4j.taglib.xml</path>
<description>Represents core Ajax functionality, and page wide Ajax controls and utility components.</description>
</taglib>
<taglib short-name="rich">
<display-name>RichFaces</display-name>
<doc-title>RichFaces VDL Documentation</doc-title>
<path>../../../target/taglibs/META-INF/rich.taglib.xml</path>
<description>Represents self-contained and advanced UI components with out-of-the-box Ajax functionality.
</description>
</taglib>
</taglibs>
<?xml version="1.0" encoding="UTF-8"?>
<properties>
<window-title>VDL Documentation</window-title>
<doc-title>Tag Library Documentation Generator - Generated Documentation</doc-title>

<taglibs>
<taglib short-name="a4j">
<display-name>Ajax4JSF</display-name>
<doc-title>Ajax4JSF VDL Documentation</doc-title>
<path>../../../target/taglibs/META-INF/a4j.taglib.xml</path>
<description>Represents core Ajax functionality, and page wide Ajax controls and utility components.</description>
</taglib>
<taglib short-name="rich">
<display-name>RichFaces</display-name>
<doc-title>RichFaces VDL Documentation</doc-title>
<path>../../../target/taglibs/META-INF/rich.taglib.xml</path>
<description>Represents self-contained and advanced UI components with out-of-the-box Ajax functionality.
</description>
</taglib>
</taglibs>
</properties>
Loading

0 comments on commit 3935398

Please sign in to comment.