You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@creadur.apache.org by rd...@apache.org on 2013/12/08 20:49:43 UTC

svn commit: r1549162 - in /creadur/rat/branches/gsoc/apache-rat-core/src: main/java/org/apache/rat/analysis/ main/java/org/apache/rat/report/xml/ test/java/org/apache/rat/analysis/ test/java/org/apache/rat/report/xml/

Author: rdonkin
Date: Sun Dec  8 19:49:42 2013
New Revision: 1549162

URL: http://svn.apache.org/r1549162
Log:
Removed factory with only one method. More obvious to use the implementation directly, I think.

Removed:
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/DefaultAnalyserFactoryTest.java
Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
    creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java?rev=1549162&r1=1549161&r2=1549162&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/analysis/DefaultAnalyser.java Sun Dec  8 19:49:42 2013
@@ -30,7 +30,7 @@ import org.apache.rat.document.impl.gues
 /**
  * The Class DefaultAnalyser.
  */
-final class DefaultAnalyser implements IDocumentAnalyser {
+public final class DefaultAnalyser implements IDocumentAnalyser {
 
     /** The matcher. */
     private final IHeaderMatcher matcher;
@@ -70,9 +70,10 @@ final class DefaultAnalyser implements I
             } else if (this.binaryGuessor.matches(subject)) {
                 documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_BINARY;
             } else {
-                documentCategory = MetaData.RAT_DOCUMENT_CATEGORY_DATUM_STANDARD;
-                final DocumentHeaderAnalyser headerAnalyser = new DocumentHeaderAnalyser(
-                        this.matcher);
+                documentCategory =
+                        MetaData.RAT_DOCUMENT_CATEGORY_DATUM_STANDARD;
+                final DocumentHeaderAnalyser headerAnalyser =
+                        new DocumentHeaderAnalyser(this.matcher);
                 headerAnalyser.analyse(subject);
             }
         }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java?rev=1549162&r1=1549161&r2=1549162&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java Sun Dec  8 19:49:42 2013
@@ -15,14 +15,14 @@
  * KIND, either express or implied.  See the License for the    *
  * specific language governing permissions and limitations      *
  * under the License.                                           *
- */ 
+ */
 package org.apache.rat.report.xml;
 
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.rat.ReportConfiguration;
-import org.apache.rat.analysis.DefaultAnalyserFactory;
+import org.apache.rat.analysis.DefaultAnalyser;
 import org.apache.rat.document.IDocumentAnalyser;
 import org.apache.rat.document.impl.util.DocumentAnalyserMultiplexer;
 import org.apache.rat.policy.DefaultPolicy;
@@ -36,24 +36,29 @@ import org.apache.rat.report.xml.writer.
 
 /**
  * Creates reports.
- *
+ * 
  */
 public class XmlReportFactory {
-    public static final RatReport createStandardReport(IXmlWriter writer,
-            final ClaimStatistic pStatistic, ReportConfiguration pConfiguration) {
+    public static final RatReport createStandardReport(final IXmlWriter writer,
+            final ClaimStatistic pStatistic,
+            final ReportConfiguration pConfiguration) {
         final List<RatReport> reporters = new ArrayList<RatReport>();
         if (pStatistic != null) {
             reporters.add(new ClaimAggregator(pStatistic));
         }
         if (pConfiguration.isAddingLicenses()) {
-            reporters.add(new LicenseAddingReport(pConfiguration.getCopyrightMessage(), pConfiguration.isAddingLicensesForced()));
+            reporters.add(new LicenseAddingReport(pConfiguration
+                    .getCopyrightMessage(), pConfiguration
+                    .isAddingLicensesForced()));
         }
         reporters.add(new SimpleXmlClaimReporter(writer));
-        final IDocumentAnalyser analyser = 
-            DefaultAnalyserFactory.createDefaultAnalyser(pConfiguration.getHeaderMatcher());
-        final DefaultPolicy policy = new DefaultPolicy(pConfiguration.getApprovedLicenseNames());
-        final IDocumentAnalyser[] analysers = {analyser, policy};
-        DocumentAnalyserMultiplexer analysisMultiplexer = new DocumentAnalyserMultiplexer(analysers);
+        final IDocumentAnalyser analyser =
+                new DefaultAnalyser(pConfiguration.getHeaderMatcher());
+        final DefaultPolicy policy =
+                new DefaultPolicy(pConfiguration.getApprovedLicenseNames());
+        final IDocumentAnalyser[] analysers = { analyser, policy };
+        final DocumentAnalyserMultiplexer analysisMultiplexer =
+                new DocumentAnalyserMultiplexer(analysers);
         return new ClaimReporterMultiplexer(analysisMultiplexer, reporters);
     }
 }

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java?rev=1549162&r1=1549161&r2=1549162&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java Sun Dec  8 19:49:42 2013
@@ -80,8 +80,7 @@ public class AnalyserFactoryTest {
 	public void testStandardTypeAnalyser() throws IOException, RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/resources/elements/Text.txt"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 		reporter.report(document);
 		assertEquals(
@@ -122,8 +121,7 @@ public class AnalyserFactoryTest {
 	public void testNoteTypeAnalyser() throws IOException, RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/elements/LICENSE"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 		reporter.report(document);
 		assertEquals(
@@ -144,8 +142,7 @@ public class AnalyserFactoryTest {
 	public void testBinaryTypeAnalyser() throws IOException, RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/elements/Image.png"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 		reporter.report(document);
 		assertEquals(
@@ -166,8 +163,7 @@ public class AnalyserFactoryTest {
 	public void testArchiveTypeAnalyser() throws IOException, RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/elements/Dummy.jar"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 		reporter.report(document);
 		assertEquals(
@@ -199,8 +195,7 @@ public class AnalyserFactoryTest {
 			RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/resources/elements/Text.txtt"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 	}
 
@@ -217,8 +212,7 @@ public class AnalyserFactoryTest {
 			RatException {
 		MonolithicFileDocument document = new MonolithicFileDocument(new File(
 				"src/test/resources/elements/test.LICENSE"));
-		IDocumentAnalyser analyser = DefaultAnalyserFactory
-				.createDefaultAnalyser(matcherStub);
+		IDocumentAnalyser analyser = new DefaultAnalyser(matcherStub);
 		analyser.analyse(document);
 		Assert.assertEquals(document.getMetaData().getData().size(), 1);
 	}

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java?rev=1549162&r1=1549161&r2=1549162&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java (original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/report/xml/XmlReportTest.java Sun Dec  8 19:49:42 2013
@@ -15,10 +15,18 @@
  * KIND, either express or implied.  See the License for the    *
  * specific language governing permissions and limitations      *
  * under the License.                                           *
- */ 
+ */
 package org.apache.rat.report.xml;
 
-import org.apache.rat.analysis.DefaultAnalyserFactory;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.rat.analysis.DefaultAnalyser;
 import org.apache.rat.analysis.IHeaderMatcher;
 import org.apache.rat.api.Document;
 import org.apache.rat.document.IDocumentAnalyser;
@@ -33,162 +41,176 @@ import org.apache.rat.walker.DirectoryWa
 import org.junit.Before;
 import org.junit.Test;
 
-import java.io.File;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import static org.junit.Assert.assertTrue;
-
 public class XmlReportTest {
 
     private static final Pattern IGNORE = Pattern.compile(".svn");
     StringWriter out;
     IXmlWriter writer;
     RatReport report;
-    
+
     @Before
     public void setUp() throws Exception {
-        out = new StringWriter();
-        writer = new XmlWriter(out);
-        writer.startDocument();
-        final SimpleXmlClaimReporter reporter = new SimpleXmlClaimReporter(writer);
+        this.out = new StringWriter();
+        this.writer = new XmlWriter(this.out);
+        this.writer.startDocument();
+        final SimpleXmlClaimReporter reporter =
+                new SimpleXmlClaimReporter(this.writer);
         final IHeaderMatcher matcher = new IHeaderMatcher() {
 
-            public boolean match(Document subject, String line) {
+            public boolean match(final Document subject, final String line) {
                 return false;
             }
 
             public void reset() {
-            }            
+            }
         };
-        IDocumentAnalyser analyser = DefaultAnalyserFactory.createDefaultAnalyser(matcher);
+        final IDocumentAnalyser analyser = new DefaultAnalyser(matcher);
         final List<AbstractReport> reporters = new ArrayList<AbstractReport>();
         reporters.add(reporter);
-        report = new ClaimReporterMultiplexer(analyser, reporters); 
+        this.report = new ClaimReporterMultiplexer(analyser, reporters);
     }
 
-    private void report(DirectoryWalker directory) throws Exception {
-        directory.run(report);
+    private void report(final DirectoryWalker directory) throws Exception {
+        directory.run(this.report);
     }
-    
+
     @Test
     public void baseReport() throws Exception {
-        final String elementsPath = Resources.getResourceDirectory("elements/Source.java");
-        DirectoryWalker directory = new DirectoryWalker(new File(elementsPath), IGNORE);
-        report.startReport();
+        final String elementsPath =
+                Resources.getResourceDirectory("elements/Source.java");
+        final DirectoryWalker directory =
+                new DirectoryWalker(new File(elementsPath), IGNORE);
+        this.report.startReport();
         report(directory);
-        report.endReport();
-        writer.closeDocument();
-        final String output = out.toString();
+        this.report.endReport();
+        this.writer.closeDocument();
+        final String output = this.out.toString();
         assertTrue("Preamble and document element are OK",
-                   output.startsWith("<?xml version='1.0'?>" +
-                "<rat-report timestamp="));
-        assertTrue("Part after timestamp attribute is OK",
-                   output.endsWith(">" +
-                    "<resource name='" + elementsPath + "/Image.png'><type name='binary'/></resource>" +
-                    "<resource name='" + elementsPath + "/LICENSE'><type name='notice'/></resource>" +
-                    "<resource name='" + elementsPath + "/NOTICE'><type name='notice'/></resource>" +
-                    "<resource name='" + elementsPath + "/Source.java'><header-sample>package elements;\n" +
-"\n" +
-"/*\n" +
-" * This file does intentionally *NOT* contain an AL license header,\n" +
-" * because it is used in the test suite.\n" +
-" */\n" +
-"public class Source {\n" +
-"\n" +
-"}\n" + "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
-                    "<resource name='" + elementsPath + "/Text.txt'><header-sample>/*\n" +
-" * Licensed to the Apache Software Foundation (ASF) under one\n" +
-" * or more contributor license agreements.  See the NOTICE file\n" +
-" * distributed with this work for additional information\n" +
-" * regarding copyright ownership.  The ASF licenses this file\n" +
-" * to you under the Apache License, Version 2.0 (the \"License\");\n" +
-" * you may not use this file except in compliance with the License.\n" +
-" * You may obtain a copy of the License at\n" +
-" *\n" +
-" *    http://www.apache.org/licenses/LICENSE-2.0\n" +
-" *\n" +
-" * Unless required by applicable law or agreed to in writing,\n" +
-" * software distributed under the License is distributed on an\n" +
-" * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n" +
-" * KIND, either express or implied.  See the License for the\n" +
-" * specific language governing permissions and limitations\n" +
-" * under the License.    \n" +
-" */\n" +
-"\n" +
-"            \n" +
-"</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
-                    "<resource name='" + elementsPath + "/Xml.xml'><header-sample>&lt;?xml version='1.0'?&gt;\n" +
-"&lt;!--\n" +
-" Licensed to the Apache Software Foundation (ASF) under one   *\n" +
-" or more contributor license agreements.  See the NOTICE file *\n" +
-" distributed with this work for additional information        *\n" +
-" regarding copyright ownership.  The ASF licenses this file   *\n" +
-" to you under the Apache License, Version 2.0 (the            *\n" +
-" \"License\"); you may not use this file except in compliance   *\n" +
-" with the License.  You may obtain a copy of the License at   *\n" +
-"                                                              *\n" +
-"   http://www.apache.org/licenses/LICENSE-2.0                 *\n" +
-"                                                              *\n" +
-" Unless required by applicable law or agreed to in writing,   *\n" +
-" software distributed under the License is distributed on an  *\n" +
-" \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *\n" +
-" KIND, either express or implied.  See the License for the    *\n" +
-" specific language governing permissions and limitations      *\n" +
-" under the License.                                           *\n" +
-"--&gt;\n" +
-"&lt;document/&gt;\n" +
-"</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
-                    "<resource name='" + elementsPath + "/buildr.rb'><header-sample># Licensed to the Apache Software Foundation (ASF) under one or more\n" +
-"# contributor license agreements.  See the NOTICE file distributed with this\n" +
-"# work for additional information regarding copyright ownership.  The ASF\n" +
-"# licenses this file to you under the Apache License, Version 2.0 (the\n" +
-"# \"License\"); you may not use this file except in compliance with the License.\n" +
-"# You may obtain a copy of the License at\n" +
-"#\n" +
-"#    http://www.apache.org/licenses/LICENSE-2.0\n" +
-"#\n" +
-"# Unless required by applicable law or agreed to in writing, software\n" +
-"# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n" +
-"# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\n" +
-"# License for the specific language governing permissions and limitations under\n" +
-"# the License.\n" +
-"\n" +
-"unless defined?(Buildr::VERSION)\n" +
-"  require 'buildr/version'\n" +
-"end\n" +
-"\n" +
-"require 'buildr/core'\n" +
-"require 'buildr/packaging'\n" +
-"require 'buildr/java'\n" +
-"require 'buildr/ide'\n" +
-"require 'buildr/shell'\n" +
-"require 'buildr/run'\n" +
-"\n" +
-"# Methods defined in Buildr are both instance methods (e.g. when included in Project)\n" +
-"# and class methods when invoked like Buildr.artifacts().\n" +
-"module Buildr ; extend self ; end\n" +
-"\n" +
-"# The Buildfile object (self) has access to all the Buildr methods and constants.\n" +
-"class &lt;&lt; self ; include Buildr ; end\n" +
-"\n" +
-"# All modules defined under Buildr::* can be referenced without Buildr:: prefix\n" +
-"# unless a conflict exists (e.g.  Buildr::RSpec vs ::RSpec)\n" +
-"class Object #:nodoc:\n" +
-"  Buildr.constants.each do |name|\n" +
-"    const = Buildr.const_get(name)\n" +
-"    if const.is_a?(Module)\n" +
-"      const_set name, const unless const_defined?(name)\n" +
-"    end\n" +
-"  end\n" +
-"end\n" +
-"\n" +
-                "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
-                    "<resource name='" + elementsPath + "/dummy.jar'><type name='archive'/></resource>" +
-                    "<resource name='" + elementsPath + "/sub/Empty.txt'><header-sample>\n</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>" +
-                    "</rat-report>"));
+                output.startsWith("<?xml version='1.0'?>"
+                        + "<rat-report timestamp="));
+        assertTrue(
+                "Part after timestamp attribute is OK",
+                output.endsWith(">" + "<resource name='"
+                        + elementsPath
+                        + "/Image.png'><type name='binary'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/LICENSE'><type name='notice'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/NOTICE'><type name='notice'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/Source.java'><header-sample>package elements;\n"
+                        + "\n"
+                        + "/*\n"
+                        + " * This file does intentionally *NOT* contain an AL license header,\n"
+                        + " * because it is used in the test suite.\n"
+                        + " */\n"
+                        + "public class Source {\n"
+                        + "\n"
+                        + "}\n"
+                        + "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/Text.txt'><header-sample>/*\n"
+                        + " * Licensed to the Apache Software Foundation (ASF) under one\n"
+                        + " * or more contributor license agreements.  See the NOTICE file\n"
+                        + " * distributed with this work for additional information\n"
+                        + " * regarding copyright ownership.  The ASF licenses this file\n"
+                        + " * to you under the Apache License, Version 2.0 (the \"License\");\n"
+                        + " * you may not use this file except in compliance with the License.\n"
+                        + " * You may obtain a copy of the License at\n"
+                        + " *\n"
+                        + " *    http://www.apache.org/licenses/LICENSE-2.0\n"
+                        + " *\n"
+                        + " * Unless required by applicable law or agreed to in writing,\n"
+                        + " * software distributed under the License is distributed on an\n"
+                        + " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
+                        + " * KIND, either express or implied.  See the License for the\n"
+                        + " * specific language governing permissions and limitations\n"
+                        + " * under the License.    \n"
+                        + " */\n"
+                        + "\n"
+                        + "            \n"
+                        + "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/Xml.xml'><header-sample>&lt;?xml version='1.0'?&gt;\n"
+                        + "&lt;!--\n"
+                        + " Licensed to the Apache Software Foundation (ASF) under one   *\n"
+                        + " or more contributor license agreements.  See the NOTICE file *\n"
+                        + " distributed with this work for additional information        *\n"
+                        + " regarding copyright ownership.  The ASF licenses this file   *\n"
+                        + " to you under the Apache License, Version 2.0 (the            *\n"
+                        + " \"License\"); you may not use this file except in compliance   *\n"
+                        + " with the License.  You may obtain a copy of the License at   *\n"
+                        + "                                                              *\n"
+                        + "   http://www.apache.org/licenses/LICENSE-2.0                 *\n"
+                        + "                                                              *\n"
+                        + " Unless required by applicable law or agreed to in writing,   *\n"
+                        + " software distributed under the License is distributed on an  *\n"
+                        + " \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *\n"
+                        + " KIND, either express or implied.  See the License for the    *\n"
+                        + " specific language governing permissions and limitations      *\n"
+                        + " under the License.                                           *\n"
+                        + "--&gt;\n"
+                        + "&lt;document/&gt;\n"
+                        + "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/buildr.rb'><header-sample># Licensed to the Apache Software Foundation (ASF) under one or more\n"
+                        + "# contributor license agreements.  See the NOTICE file distributed with this\n"
+                        + "# work for additional information regarding copyright ownership.  The ASF\n"
+                        + "# licenses this file to you under the Apache License, Version 2.0 (the\n"
+                        + "# \"License\"); you may not use this file except in compliance with the License.\n"
+                        + "# You may obtain a copy of the License at\n"
+                        + "#\n"
+                        + "#    http://www.apache.org/licenses/LICENSE-2.0\n"
+                        + "#\n"
+                        + "# Unless required by applicable law or agreed to in writing, software\n"
+                        + "# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n"
+                        + "# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\n"
+                        + "# License for the specific language governing permissions and limitations under\n"
+                        + "# the License.\n"
+                        + "\n"
+                        + "unless defined?(Buildr::VERSION)\n"
+                        + "  require 'buildr/version'\n"
+                        + "end\n"
+                        + "\n"
+                        + "require 'buildr/core'\n"
+                        + "require 'buildr/packaging'\n"
+                        + "require 'buildr/java'\n"
+                        + "require 'buildr/ide'\n"
+                        + "require 'buildr/shell'\n"
+                        + "require 'buildr/run'\n"
+                        + "\n"
+                        + "# Methods defined in Buildr are both instance methods (e.g. when included in Project)\n"
+                        + "# and class methods when invoked like Buildr.artifacts().\n"
+                        + "module Buildr ; extend self ; end\n"
+                        + "\n"
+                        + "# The Buildfile object (self) has access to all the Buildr methods and constants.\n"
+                        + "class &lt;&lt; self ; include Buildr ; end\n"
+                        + "\n"
+                        + "# All modules defined under Buildr::* can be referenced without Buildr:: prefix\n"
+                        + "# unless a conflict exists (e.g.  Buildr::RSpec vs ::RSpec)\n"
+                        + "class Object #:nodoc:\n"
+                        + "  Buildr.constants.each do |name|\n"
+                        + "    const = Buildr.const_get(name)\n"
+                        + "    if const.is_a?(Module)\n"
+                        + "      const_set name, const unless const_defined?(name)\n"
+                        + "    end\n"
+                        + "  end\n"
+                        + "end\n"
+                        + "\n"
+                        + "</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/dummy.jar'><type name='archive'/></resource>"
+                        + "<resource name='"
+                        + elementsPath
+                        + "/sub/Empty.txt'><header-sample>\n</header-sample><header-type name='?????'/><license-family name='?????'/><type name='standard'/></resource>"
+                        + "</rat-report>"));
         assertTrue("Is well formed", XmlUtils.isWellFormedXml(output));
     }