From 4738428c2c205f42200386ae09b44b9ec07b9144 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Sat, 27 Jul 2013 14:33:25 -0700 Subject: Move subsonic-android to root --- .../service/metadata/MediaFileTestCase.java | 60 -------------- .../service/metadata/MetaDataParserTestCase.java | 92 ---------------------- 2 files changed, 152 deletions(-) delete mode 100644 subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MediaFileTestCase.java delete mode 100644 subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MetaDataParserTestCase.java (limited to 'subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata') diff --git a/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MediaFileTestCase.java b/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MediaFileTestCase.java deleted file mode 100644 index ccc728ea..00000000 --- a/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MediaFileTestCase.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2009 (C) Sindre Mehus - */ -package net.sourceforge.subsonic.service.metadata; - -import junit.framework.TestCase; -import net.sourceforge.subsonic.domain.MediaFile; - -/** - * Unit test of {@link MediaFile}. - * - * @author Sindre Mehus - */ -public class MediaFileTestCase extends TestCase { - - public void testGetDurationAsString() throws Exception { - doTestGetDurationAsString(0, "0:00"); - doTestGetDurationAsString(1, "0:01"); - doTestGetDurationAsString(10, "0:10"); - doTestGetDurationAsString(33, "0:33"); - doTestGetDurationAsString(59, "0:59"); - doTestGetDurationAsString(60, "1:00"); - doTestGetDurationAsString(61, "1:01"); - doTestGetDurationAsString(70, "1:10"); - doTestGetDurationAsString(119, "1:59"); - doTestGetDurationAsString(120, "2:00"); - doTestGetDurationAsString(1200, "20:00"); - doTestGetDurationAsString(1201, "20:01"); - doTestGetDurationAsString(3599, "59:59"); - doTestGetDurationAsString(3600, "1:00:00"); - doTestGetDurationAsString(3601, "1:00:01"); - doTestGetDurationAsString(3661, "1:01:01"); - doTestGetDurationAsString(4200, "1:10:00"); - doTestGetDurationAsString(4201, "1:10:01"); - doTestGetDurationAsString(4210, "1:10:10"); - doTestGetDurationAsString(36000, "10:00:00"); - doTestGetDurationAsString(360000, "100:00:00"); - } - - private void doTestGetDurationAsString(int seconds, String expected) { - MediaFile mediaFile = new MediaFile(); - mediaFile.setDurationSeconds(seconds); - assertEquals("Error in getDurationString().", expected, mediaFile.getDurationString()); - } -} \ No newline at end of file diff --git a/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MetaDataParserTestCase.java b/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MetaDataParserTestCase.java deleted file mode 100644 index 254e93d0..00000000 --- a/subsonic-main/src/test/java/net/sourceforge/subsonic/service/metadata/MetaDataParserTestCase.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - This file is part of Subsonic. - - Subsonic is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - Subsonic 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 General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Subsonic. If not, see . - - Copyright 2009 (C) Sindre Mehus - */ -package net.sourceforge.subsonic.service.metadata; - -import java.io.File; - -import junit.framework.TestCase; -import net.sourceforge.subsonic.domain.MediaFile; - -/** - * Unit test of {@link MetaDataParser}. - * - * @author Sindre Mehus - */ -public class MetaDataParserTestCase extends TestCase { - - public void testRemoveTrackNumberFromTitle() throws Exception { - - MetaDataParser parser = new MetaDataParser() { - public MetaData getRawMetaData(File file) { - return null; - } - - public void setMetaData(MediaFile file, MetaData metaData) { - } - - public boolean isEditingSupported() { - return false; - } - - public boolean isApplicable(File file) { - return false; - } - }; - - assertEquals("", parser.removeTrackNumberFromTitle("", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01 kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01 - kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01-kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01 - kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("99 - kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("99.- kokos", null)); - assertEquals("kokos", parser.removeTrackNumberFromTitle(" 01 kokos", null)); - assertEquals("400 years", parser.removeTrackNumberFromTitle("400 years", null)); - assertEquals("49ers", parser.removeTrackNumberFromTitle("49ers", null)); - assertEquals("01", parser.removeTrackNumberFromTitle("01", null)); - assertEquals("01", parser.removeTrackNumberFromTitle("01 ", null)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01 ", null)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01", null)); - - assertEquals("", parser.removeTrackNumberFromTitle("", 1)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01 kokos", 1)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01 - kokos", 1)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("01-kokos", 1)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("99 - kokos", 99)); - assertEquals("kokos", parser.removeTrackNumberFromTitle("99.- kokos", 99)); - assertEquals("01 kokos", parser.removeTrackNumberFromTitle("01 kokos", 2)); - assertEquals("1 kokos", parser.removeTrackNumberFromTitle("1 kokos", 2)); - assertEquals("50 years", parser.removeTrackNumberFromTitle("50 years", 1)); - assertEquals("years", parser.removeTrackNumberFromTitle("50 years", 50)); - assertEquals("15 Step", parser.removeTrackNumberFromTitle("15 Step", 1)); - assertEquals("Step", parser.removeTrackNumberFromTitle("15 Step", 15)); - - assertEquals("49ers", parser.removeTrackNumberFromTitle("49ers", 1)); - assertEquals("49ers", parser.removeTrackNumberFromTitle("49ers", 49)); - assertEquals("01", parser.removeTrackNumberFromTitle("01", 1)); - assertEquals("01", parser.removeTrackNumberFromTitle("01 ", 1)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01 ", 1)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01", 1)); - assertEquals("01", parser.removeTrackNumberFromTitle("01", 2)); - assertEquals("01", parser.removeTrackNumberFromTitle("01 ", 2)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01 ", 2)); - assertEquals("01", parser.removeTrackNumberFromTitle(" 01", 2)); - } -} \ No newline at end of file -- cgit v1.2.3