diff --git a/defaults/httpd.mime b/defaults/httpd.mime index 813cae3cc..b71bfc136 100644 --- a/defaults/httpd.mime +++ b/defaults/httpd.mime @@ -136,6 +136,6 @@ xltx = application/vnd.openxmlformats-officedocument.spreadsheetml.template xpi = application/x-xpinstall xsl = text/xml xml = text/xml -Z = application/x-compress +z = application/x-compress zip = application/zip default = application/octet-stream diff --git a/test/java/net/yacy/cora/document/analysis/ClassificationTest.java b/test/java/net/yacy/cora/document/analysis/ClassificationTest.java new file mode 100644 index 000000000..670253d2b --- /dev/null +++ b/test/java/net/yacy/cora/document/analysis/ClassificationTest.java @@ -0,0 +1,50 @@ +/** + * ClassificationTest + * part of YaCy + * Copyright 2017 by reger24; https://github.com/reger24 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program in the file lgpl21.txt + * If not, see . + */ +package net.yacy.cora.document.analysis; + +import java.io.File; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * Unit tests for Classification class. + */ +public class ClassificationTest { + + /** + * Initialize with default file ext to mime file + */ + @BeforeClass + public static void setUpClass() { + Classification.init(new File("defaults/httpd.mime")); + } + + /** + * Test of ext2mime method, of class Classification. + */ + @Test + public void testExt2mime_String() { + String mime; + mime = Classification.ext2mime("Z"); + assertEquals("application/x-compress", mime); + } + +}