Rename libresonic -> airsonic

Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>
This commit is contained in:
Andrew DeMaria
2017-07-13 21:34:28 -06:00
parent 11dc3f6b1f
commit 94dbd3ef94
417 changed files with 3172 additions and 3188 deletions
@@ -1,4 +1,4 @@
package org.libresonic.player;
package org.airsonic.player;
import java.io.IOException;
import java.util.Map;
@@ -19,11 +19,11 @@ public class MissingTranslations {
private static void diff(String locale1, String locale2) throws IOException {
Properties en = new Properties();
en.load(MissingTranslations.class.getResourceAsStream("/org/libresonic/player/i18n/ResourceBundle_" + locale1 + ".properties"));
en.load(MissingTranslations.class.getResourceAsStream("/org/airsonic/player/i18n/ResourceBundle_" + locale1 + ".properties"));
SortedMap<Object,Object> enSorted = new TreeMap<Object, Object>(en);
Properties mk = new Properties();
mk.load(MissingTranslations.class.getResourceAsStream("/org/libresonic/player/i18n/ResourceBundle_" + locale2 + ".properties"));
mk.load(MissingTranslations.class.getResourceAsStream("/org/airsonic/player/i18n/ResourceBundle_" + locale2 + ".properties"));
System.out.println("\nMessages present in locale " + locale1 + " and missing in locale " + locale2 + ":");
int count = 0;
@@ -1,8 +1,8 @@
package org.libresonic.player;
package org.airsonic.player;
import org.airsonic.player.dao.DaoHelper;
import org.airsonic.player.service.MediaScannerService;
import org.apache.commons.io.FileUtils;
import org.libresonic.player.dao.DaoHelper;
import org.libresonic.player.service.MediaScannerService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -15,43 +15,43 @@ import java.util.stream.Collectors;
public class TestCaseUtils {
private static File libresonicHomeDirForTest = null;
private static File airsonicHomeDirForTest = null;
/**
* Returns the path of the LIBRESONIC_HOME directory to use for tests.
* Returns the path of the AIRSONIC_HOME directory to use for tests.
* This will create a temporary directory.
*
* @return LIBRESONIC_HOME directory path.
* @return AIRSONIC_HOME directory path.
* @throws RuntimeException if it fails to create the temp directory.
*/
public static String libresonicHomePathForTest() {
public static String airsonicHomePathForTest() {
if (libresonicHomeDirForTest == null) {
if (airsonicHomeDirForTest == null) {
try {
libresonicHomeDirForTest = Files.createTempDirectory("libresonic_test_").toFile();
airsonicHomeDirForTest = Files.createTempDirectory("airsonic_test_").toFile();
} catch (IOException e) {
throw new RuntimeException("Error while creating temporary LIBRESONIC_HOME directory for tests");
throw new RuntimeException("Error while creating temporary AIRSONIC_HOME directory for tests");
}
System.out.println("LIBRESONIC_HOME directory will be "+libresonicHomeDirForTest.getAbsolutePath());
System.out.println("AIRSONIC_HOME directory will be "+airsonicHomeDirForTest.getAbsolutePath());
}
return libresonicHomeDirForTest.getAbsolutePath();
return airsonicHomeDirForTest.getAbsolutePath();
}
/**
* Cleans the LIBRESONIC_HOME directory used for tests.
* Cleans the AIRSONIC_HOME directory used for tests.
*
* @throws IOException
*/
public static void cleanLibresonicHomeForTest() throws IOException {
public static void cleanAirsonicHomeForTest() throws IOException {
File libresonicHomeDir = new File(libresonicHomePathForTest());
if (libresonicHomeDir.exists() && libresonicHomeDir.isDirectory()) {
System.out.println("Delete libresonic home (ie. "+libresonicHomeDir.getAbsolutePath()+").");
File airsonicHomeDir = new File(airsonicHomePathForTest());
if (airsonicHomeDir.exists() && airsonicHomeDir.isDirectory()) {
System.out.println("Delete airsonic home (ie. "+airsonicHomeDir.getAbsolutePath()+").");
try {
FileUtils.deleteDirectory(libresonicHomeDir);
FileUtils.deleteDirectory(airsonicHomeDir);
} catch (IOException e) {
System.out.println("Error while deleting libresonic home.");
System.out.println("Error while deleting airsonic home.");
e.printStackTrace();
throw e;
}
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.controller;
package org.airsonic.player.controller;
import junit.framework.TestCase;
import org.libresonic.player.util.Pair;
import org.airsonic.player.util.Pair;
import java.awt.*;
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.controller;
package org.airsonic.player.controller;
import junit.framework.TestCase;
@@ -1,10 +1,10 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.libresonic.player.util.LibresonicHomeRule;
import org.airsonic.player.util.HomeRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
@@ -19,10 +19,10 @@ import org.springframework.test.context.junit4.rules.SpringMethodRule;
public class DaoTestCaseBean2 {
@ClassRule
public static final SpringClassRule classRule = new SpringClassRule() {
LibresonicHomeRule libresonicRule = new LibresonicHomeRule();
HomeRule airsonicRule = new HomeRule();
@Override
public Statement apply(Statement base, Description description) {
Statement newBase = libresonicRule.apply(base, description);
Statement newBase = airsonicRule.apply(base, description);
return super.apply(newBase, description);
}
};
@@ -1,8 +1,8 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.InternetRadio;
import org.airsonic.player.domain.InternetRadio;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -1,27 +1,27 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.MusicFolder;
import org.airsonic.player.domain.MusicFolder;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.File;
@@ -1,6 +1,6 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.libresonic.player.domain.MusicFolder;
import org.airsonic.player.domain.MusicFolder;
import java.io.File;
import java.util.ArrayList;
@@ -1,11 +1,11 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.airsonic.player.domain.PlayQueue;
import org.airsonic.player.domain.PlayerTechnology;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.PlayQueue;
import org.libresonic.player.domain.Player;
import org.libresonic.player.domain.PlayerTechnology;
import org.libresonic.player.domain.TranscodeScheme;
import org.airsonic.player.domain.Player;
import org.airsonic.player.domain.TranscodeScheme;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -1,10 +1,10 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.airsonic.player.domain.PodcastStatus;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.PodcastChannel;
import org.libresonic.player.domain.PodcastEpisode;
import org.libresonic.player.domain.PodcastStatus;
import org.airsonic.player.domain.PodcastChannel;
import org.airsonic.player.domain.PodcastEpisode;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
@@ -1,9 +1,9 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.airsonic.player.domain.Player;
import org.airsonic.player.domain.Transcoding;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.Player;
import org.libresonic.player.domain.Transcoding;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@@ -1,11 +1,11 @@
package org.libresonic.player.dao;
package org.airsonic.player.dao;
import org.airsonic.player.domain.AvatarScheme;
import org.airsonic.player.domain.User;
import org.airsonic.player.domain.UserSettings;
import org.junit.Before;
import org.junit.Test;
import org.libresonic.player.domain.AvatarScheme;
import org.libresonic.player.domain.TranscodeScheme;
import org.libresonic.player.domain.User;
import org.libresonic.player.domain.UserSettings;
import org.airsonic.player.domain.TranscodeScheme;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
@@ -1,28 +1,28 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
import junit.framework.TestCase;
/**
* Unit test of {@link org.libresonic.player.domain.CacheElement}.
* Unit test of {@link CacheElement}.
*
* @author Sindre Mehus
*/
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
import junit.framework.TestCase;
@@ -1,27 +1,25 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
import junit.framework.TestCase;
import org.libresonic.player.domain.PlayQueue.SortOrder;
import org.libresonic.player.domain.PlayQueue.Status;
import java.io.File;
import java.io.IOException;
@@ -44,16 +42,16 @@ public class PlayQueueTestCase extends TestCase {
public void testStatus() throws Exception {
PlayQueue playQueue = new PlayQueue();
assertEquals(Status.PLAYING, playQueue.getStatus());
assertEquals(PlayQueue.Status.PLAYING, playQueue.getStatus());
playQueue.setStatus(Status.STOPPED);
assertEquals(Status.STOPPED, playQueue.getStatus());
playQueue.setStatus(PlayQueue.Status.STOPPED);
assertEquals(PlayQueue.Status.STOPPED, playQueue.getStatus());
playQueue.addFiles(true, new TestMediaFile());
assertEquals(Status.PLAYING, playQueue.getStatus());
assertEquals(PlayQueue.Status.PLAYING, playQueue.getStatus());
playQueue.clear();
assertEquals(Status.PLAYING, playQueue.getStatus());
assertEquals(PlayQueue.Status.PLAYING, playQueue.getStatus());
}
public void testMoveUp() throws Exception {
@@ -141,13 +139,13 @@ public class PlayQueueTestCase extends TestCase {
public void testPlayAfterEndReached() throws Exception {
PlayQueue playQueue = createPlaylist(2, "A", "B", "C");
playQueue.setStatus(Status.PLAYING);
playQueue.setStatus(PlayQueue.Status.PLAYING);
playQueue.next();
assertNull(playQueue.getCurrentFile());
assertEquals(Status.STOPPED, playQueue.getStatus());
assertEquals(PlayQueue.Status.STOPPED, playQueue.getStatus());
playQueue.setStatus(Status.PLAYING);
assertEquals(Status.PLAYING, playQueue.getStatus());
playQueue.setStatus(PlayQueue.Status.PLAYING);
assertEquals(PlayQueue.Status.PLAYING, playQueue.getStatus());
assertEquals(0, playQueue.getIndex());
assertEquals("A", playQueue.getCurrentFile().getName());
}
@@ -213,7 +211,7 @@ public class PlayQueueTestCase extends TestCase {
assertEquals("Error in sort.", new Integer(3), playQueue.getCurrentFile().getTrackNumber());
// Order by track.
playQueue.sort(SortOrder.TRACK);
playQueue.sort(PlayQueue.SortOrder.TRACK);
assertEquals("Error in sort().", null, playQueue.getFile(0).getTrackNumber());
assertEquals("Error in sort().", new Integer(1), playQueue.getFile(1).getTrackNumber());
assertEquals("Error in sort().", new Integer(2), playQueue.getFile(2).getTrackNumber());
@@ -221,7 +219,7 @@ public class PlayQueueTestCase extends TestCase {
assertEquals("Error in sort().", new Integer(3), playQueue.getCurrentFile().getTrackNumber());
// Order by artist.
playQueue.sort(SortOrder.ARTIST);
playQueue.sort(PlayQueue.SortOrder.ARTIST);
assertEquals("Error in sort().", "Artist A", playQueue.getFile(0).getArtist());
assertEquals("Error in sort().", "Artist B", playQueue.getFile(1).getArtist());
assertEquals("Error in sort().", "Artist C", playQueue.getFile(2).getArtist());
@@ -229,7 +227,7 @@ public class PlayQueueTestCase extends TestCase {
assertEquals("Error in sort().", new Integer(3), playQueue.getCurrentFile().getTrackNumber());
// Order by album.
playQueue.sort(SortOrder.ALBUM);
playQueue.sort(PlayQueue.SortOrder.ALBUM);
assertEquals("Error in sort().", "Album A", playQueue.getFile(0).getAlbumName());
assertEquals("Error in sort().", "Album B", playQueue.getFile(1).getAlbumName());
assertEquals("Error in sort().", "Album C", playQueue.getFile(2).getAlbumName());
@@ -1,23 +1,23 @@
/*
* This file is part of Libresonic.
* This file is part of Airsonic.
*
* Libresonic is free software: you can redistribute it and/or modify
* Airsonic 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.
*
* Libresonic is distributed in the hope that it will be useful,
* Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
* along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2014 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
import junit.framework.TestCase;
@@ -1,27 +1,27 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
import junit.framework.TestCase;
import static org.libresonic.player.domain.TranscodeScheme.*;
import static org.airsonic.player.domain.TranscodeScheme.*;
/**
* Unit test of {@link TranscodeScheme}.
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.domain;
package org.airsonic.player.domain;
/**
* Unit test of {@link Version}.
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2014 (C) Sindre Mehus
*/
package org.libresonic.player.io;
package org.airsonic.player.io;
import junit.framework.TestCase;
import org.libresonic.player.util.HttpRange;
import org.airsonic.player.util.HttpRange;
import java.io.*;
@@ -1,4 +1,4 @@
package org.libresonic.player.service;
package org.airsonic.player.service;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
@@ -28,8 +28,8 @@ public class JWTSecurityServiceTest {
@Parameterized.Parameters
public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {
{ "http://localhost:8080/libresonic/stream?id=4", "/libresonic/stream?id=4" },
{ "/libresonic/stream?id=4", "/libresonic/stream?id=4" },
{ "http://localhost:8080/airsonic/stream?id=4", "/airsonic/stream?id=4" },
{ "/airsonic/stream?id=4", "/airsonic/stream?id=4" },
});
}
@@ -1,4 +1,4 @@
package org.libresonic.player.service;
package org.airsonic.player.service;
import org.apache.commons.io.FileUtils;
import org.junit.ClassRule;
@@ -6,8 +6,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.libresonic.player.TestCaseUtils;
import org.libresonic.player.util.LibresonicHomeRule;
import org.airsonic.player.TestCaseUtils;
import org.airsonic.player.util.HomeRule;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.rules.SpringClassRule;
import org.springframework.test.context.junit4.rules.SpringMethodRule;
@@ -23,23 +23,23 @@ public class LegacyDatabaseStartupTestCase {
@ClassRule
public static final SpringClassRule classRule = new SpringClassRule() {
LibresonicHomeRule libresonicRule = new LibresonicHomeRule() {
HomeRule airsonicRule = new HomeRule() {
@Override
protected void before() throws Throwable {
super.before();
String homeParent = TestCaseUtils.libresonicHomePathForTest();
System.setProperty("libresonic.home", TestCaseUtils.libresonicHomePathForTest());
TestCaseUtils.cleanLibresonicHomeForTest();
String homeParent = TestCaseUtils.airsonicHomePathForTest();
System.setProperty("airsonic.home", TestCaseUtils.airsonicHomePathForTest());
TestCaseUtils.cleanAirsonicHomeForTest();
File dbDirectory = new File(homeParent, "/db");
FileUtils.forceMkdir(dbDirectory);
org.libresonic.player.util.FileUtils.copyResourcesRecursively(getClass().getResource("/db/pre-liquibase/db"), new File(homeParent));
org.airsonic.player.util.FileUtils.copyResourcesRecursively(getClass().getResource("/db/pre-liquibase/db"), new File(homeParent));
}
};
@Override
public Statement apply(Statement base, Description description) {
Statement spring = super.apply(base, description);
return libresonicRule.apply(spring, description);
return airsonicRule.apply(spring, description);
}
};
@@ -1,8 +1,11 @@
package org.libresonic.player.service;
package org.airsonic.player.service;
import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import org.airsonic.player.dao.*;
import org.airsonic.player.domain.MediaFile;
import org.airsonic.player.domain.MusicFolder;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.ClassRule;
@@ -11,13 +14,10 @@ import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.libresonic.player.TestCaseUtils;
import org.libresonic.player.dao.*;
import org.libresonic.player.domain.Album;
import org.libresonic.player.domain.Artist;
import org.libresonic.player.domain.MediaFile;
import org.libresonic.player.domain.MusicFolder;
import org.libresonic.player.util.LibresonicHomeRule;
import org.airsonic.player.TestCaseUtils;
import org.airsonic.player.domain.Album;
import org.airsonic.player.domain.Artist;
import org.airsonic.player.util.HomeRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
@@ -40,12 +40,12 @@ import static org.junit.Assert.assertNotNull;
* A unit test class to test the MediaScannerService.
* <p>
* This class uses the Spring application context configuration present in the
* /org/libresonic/player/service/mediaScannerServiceTestCase/ directory.
* /org/airsonic/player/service/mediaScannerServiceTestCase/ directory.
* <p>
* The media library is found in the /MEDIAS directory.
* It is composed of 2 musicFolders (Music and Music2) and several little weight audio files.
* <p>
* At runtime, the subsonic_home dir is set to target/test-classes/org/libresonic/player/service/mediaScannerServiceTestCase.
* At runtime, the subsonic_home dir is set to target/test-classes/org/airsonic/player/service/mediaScannerServiceTestCase.
* An empty database is created on the fly.
*/
@ContextConfiguration(locations = {
@@ -58,12 +58,12 @@ public class MediaScannerServiceTestCase {
@ClassRule
public static final SpringClassRule classRule = new SpringClassRule() {
LibresonicHomeRule libresonicRule = new LibresonicHomeRule();
HomeRule airsonicRule = new HomeRule();
@Override
public Statement apply(Statement base, Description description) {
Statement spring = super.apply(base, description);
return libresonicRule.apply(spring, description);
return airsonicRule.apply(spring, description);
}
};
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service;
package org.airsonic.player.service;
import junit.framework.TestCase;
import org.libresonic.player.domain.MusicIndex;
import org.airsonic.player.domain.MusicIndex;
import java.util.List;
@@ -1,6 +1,9 @@
package org.libresonic.player.service;
package org.airsonic.player.service;
import com.google.common.collect.Lists;
import org.airsonic.player.dao.MediaFileDao;
import org.airsonic.player.domain.MediaFile;
import org.airsonic.player.domain.Playlist;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.output.ByteArrayOutputStream;
import org.junit.Assert;
@@ -9,11 +12,8 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.libresonic.player.dao.MediaFileDao;
import org.libresonic.player.dao.PlaylistDao;
import org.libresonic.player.domain.MediaFile;
import org.libresonic.player.domain.Playlist;
import org.libresonic.player.service.playlist.DefaultPlaylistExportHandler;
import org.airsonic.player.dao.PlaylistDao;
import org.airsonic.player.service.playlist.DefaultPlaylistExportHandler;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
@@ -1,6 +1,11 @@
package org.libresonic.player.service;
package org.airsonic.player.service;
import com.google.common.collect.Lists;
import org.airsonic.player.dao.MediaFileDao;
import org.airsonic.player.dao.PlaylistDao;
import org.airsonic.player.domain.MediaFile;
import org.airsonic.player.domain.Playlist;
import org.airsonic.player.service.playlist.DefaultPlaylistImportHandler;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -9,12 +14,6 @@ import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.libresonic.player.dao.MediaFileDao;
import org.libresonic.player.dao.PlaylistDao;
import org.libresonic.player.domain.MediaFile;
import org.libresonic.player.domain.Playlist;
import org.libresonic.player.service.playlist.DefaultPlaylistExportHandler;
import org.libresonic.player.service.playlist.DefaultPlaylistImportHandler;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service;
package org.airsonic.player.service;
import junit.framework.TestCase;
/**
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service;
package org.airsonic.player.service;
import junit.framework.TestCase;
import org.libresonic.player.TestCaseUtils;
import org.airsonic.player.TestCaseUtils;
import java.io.File;
import java.util.Arrays;
@@ -37,9 +37,9 @@ public class SettingsServiceTestCase extends TestCase {
@Override
protected void setUp() throws Exception {
String libresonicHome = TestCaseUtils.libresonicHomePathForTest();
System.setProperty("libresonic.home", libresonicHome);
new File(libresonicHome, "libresonic.properties").delete();
String airsonicHome = TestCaseUtils.airsonicHomePathForTest();
System.setProperty("airsonic.home", airsonicHome);
new File(airsonicHome, "airsonic.properties").delete();
settingsService = newSettingsService();
}
@@ -49,8 +49,8 @@ public class SettingsServiceTestCase extends TestCase {
return settingsService;
}
public void testLibresonicHome() {
assertEquals("Wrong Libresonic home.", TestCaseUtils.libresonicHomePathForTest(), SettingsService.getLibresonicHome().getAbsolutePath());
public void testAirsonicHome() {
assertEquals("Wrong Airsonic home.", TestCaseUtils.airsonicHomePathForTest(), SettingsService.getAirsonicHome().getAbsolutePath());
}
public void testDefaultValues() {
@@ -1,23 +1,23 @@
/*
* This file is part of Libresonic.
* This file is part of Airsonic.
*
* Libresonic is free software: you can redistribute it and/or modify
* Airsonic 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.
*
* Libresonic is distributed in the hope that it will be useful,
* Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
* along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2015 (C) Sindre Mehus
*/
package org.libresonic.player.service;
package org.airsonic.player.service;
import junit.framework.TestCase;
@@ -1,27 +1,27 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service;
package org.airsonic.player.service;
import junit.framework.TestCase;
import org.libresonic.player.domain.Player;
import org.libresonic.player.domain.TransferStatus;
import org.airsonic.player.domain.Player;
import org.airsonic.player.domain.TransferStatus;
import java.util.Arrays;
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service.metadata;
package org.airsonic.player.service.metadata;
import junit.framework.TestCase;
import org.libresonic.player.domain.MediaFile;
import org.airsonic.player.domain.MediaFile;
/**
* Unit test of {@link MediaFile}.
@@ -1,26 +1,26 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.service.metadata;
package org.airsonic.player.service.metadata;
import junit.framework.TestCase;
import org.libresonic.player.domain.MediaFile;
import org.airsonic.player.domain.MediaFile;
import java.io.File;
@@ -1,4 +1,4 @@
package org.libresonic.player.util;
package org.airsonic.player.util;
import org.apache.commons.lang.StringUtils;
@@ -1,14 +1,14 @@
package org.libresonic.player.util;
package org.airsonic.player.util;
import org.junit.rules.ExternalResource;
import org.libresonic.player.TestCaseUtils;
import org.airsonic.player.TestCaseUtils;
public class LibresonicHomeRule extends ExternalResource {
public class HomeRule extends ExternalResource {
@Override
protected void before() throws Throwable {
super.before();
System.setProperty("libresonic.home", TestCaseUtils.libresonicHomePathForTest());
System.setProperty("airsonic.home", TestCaseUtils.airsonicHomePathForTest());
TestCaseUtils.cleanLibresonicHomeForTest();
TestCaseUtils.cleanAirsonicHomeForTest();
}
}
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.util;
package org.airsonic.player.util;
import junit.framework.TestCase;
@@ -1,23 +1,23 @@
/*
This file is part of Libresonic.
This file is part of Airsonic.
Libresonic is free software: you can redistribute it and/or modify
Airsonic 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.
Libresonic is distributed in the hope that it will be useful,
Airsonic 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 Libresonic. If not, see <http://www.gnu.org/licenses/>.
along with Airsonic. If not, see <http://www.gnu.org/licenses/>.
Copyright 2016 (C) Libresonic Authors
Copyright 2016 (C) Airsonic Authors
Based upon Subsonic, Copyright 2009 (C) Sindre Mehus
*/
package org.libresonic.player.util;
package org.airsonic.player.util;
import junit.framework.TestCase;
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<bean id="sonosHelper" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.libresonic.player.service.sonos.SonosHelper" />
<constructor-arg value="org.airsonic.player.service.sonos.SonosHelper" />
</bean>
</beans>
@@ -7,7 +7,7 @@
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.hsqldb.jdbcDriver" />
<property name="url" value="jdbc:hsqldb:file:#{systemProperties['libresonic.home']}/db/libresonic" />
<property name="url" value="jdbc:hsqldb:file:#{systemProperties['airsonic.home']}/db/airsonic" />
<property name="username" value="sa" />
<property name="password" value="" />
</bean>
@@ -11,7 +11,7 @@
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="Libresonic Server configuration" enabled="true">
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="Airsonic Server configuration" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="SERVER_NAME" elementType="Argument">
<stringProp name="Argument.name">SERVER_NAME</stringProp>