Author: nick Date: Thu Jun 18 20:12:54 2015 New Revision: 1686315 URL: http://svn.apache.org/r1686315 Log: TIKA-1660 Java Properties sample file and detection test, follows on from r1686199
Added: tika/trunk/tika-parsers/src/test/resources/test-documents/testJAVAPROPS.properties Modified: tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java Modified: tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java URL: http://svn.apache.org/viewvc/tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java?rev=1686315&r1=1686314&r2=1686315&view=diff ============================================================================== --- tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java (original) +++ tika/trunk/tika-parsers/src/test/java/org/apache/tika/mime/TestMimeTypes.java Thu Jun 18 20:12:54 2015 @@ -944,6 +944,9 @@ public class TestMimeTypes { assertTypeByData("text/x-csrc", "testC.c"); assertTypeByData("text/x-chdr", "testH.h"); + assertTypeByName("text/x-java-source", "testJAVA.java"); + assertType("text/x-java-properties", "testJAVAPROPS.properties"); + assertType("text/x-matlab", "testMATLAB.m"); assertType("text/x-matlab", "testMATLAB_wtsgaus.m"); assertType("text/x-matlab", "testMATLAB_barcast.m"); @@ -970,6 +973,7 @@ public class TestMimeTypes { private void assertType(String expected, String filename) throws Exception { InputStream stream = TestMimeTypes.class.getResourceAsStream( "/test-documents/" + filename); + assertNotNull("Test file not found: " + filename, stream); try { Metadata metadata = new Metadata(); metadata.set(Metadata.RESOURCE_NAME_KEY, filename); Added: tika/trunk/tika-parsers/src/test/resources/test-documents/testJAVAPROPS.properties URL: http://svn.apache.org/viewvc/tika/trunk/tika-parsers/src/test/resources/test-documents/testJAVAPROPS.properties?rev=1686315&view=auto ============================================================================== --- tika/trunk/tika-parsers/src/test/resources/test-documents/testJAVAPROPS.properties (added) +++ tika/trunk/tika-parsers/src/test/resources/test-documents/testJAVAPROPS.properties Thu Jun 18 20:12:54 2015 @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +tika=great +file.content.detection=often.hard +properties\:files=fun with special characters... + +# Logs please! +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n