Author: rdonkin
Date: Sun Dec  8 18:56:07 2013
New Revision: 1549106

URL: http://svn.apache.org/r1549106
Log:
Add test: testStandardTypeAnalyserFileNonAsciText

Modified:
    
creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/AnalyserFactoryTest.java

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=1549106&r1=1549105&r2=1549106&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 18:56:07 2013
@@ -203,4 +203,47 @@ public class AnalyserFactoryTest {
                                .createDefaultAnalyser(matcherStub);
                analyser.analyse(document);
        }
+
+       /**
+        * Test standard type analyser file non asci text.
+        * 
+        * @throws IOException
+        *             Signals that an I/O exception has occurred.
+        * @throws RatException
+        *             the rat exception
+        */
+       @Test
+       public void testStandardTypeAnalyserFileNonAsciText() throws 
IOException,
+                       RatException {
+               MonolithicFileDocument document = new 
MonolithicFileDocument(new File(
+                               "src/test/resources/elements/NoAsciText.txt"));
+               IDocumentAnalyser analyser = DefaultAnalyserFactory
+                               .createDefaultAnalyser(matcherStub);
+               analyser.analyse(document);
+               reporter.report(document);
+               assertEquals(
+                               "Open standard element",
+                               "<resource 
name='src/test/resources/elements/NoAsciText.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'/>",
+                               out.toString());
+       }
 }


Reply via email to