|
@@ -24,8 +24,13 @@ package com.dmdirc.addons.mediasource_vlc;
|
24
|
24
|
|
25
|
25
|
import com.dmdirc.interfaces.config.IdentityController;
|
26
|
26
|
import com.dmdirc.plugins.PluginInfo;
|
|
27
|
+import com.dmdirc.util.io.FileUtils;
|
27
|
28
|
import com.dmdirc.util.io.TextFile;
|
28
|
29
|
import java.io.IOException;
|
|
30
|
+import java.io.UnsupportedEncodingException;
|
|
31
|
+import java.net.URISyntaxException;
|
|
32
|
+import java.nio.charset.Charset;
|
|
33
|
+
|
29
|
34
|
import org.junit.Test;
|
30
|
35
|
import static org.junit.Assert.*;
|
31
|
36
|
import static org.mockito.Mockito.*;
|
|
@@ -33,12 +38,16 @@ import static org.mockito.Mockito.*;
|
33
|
38
|
public class VlcMediaSourcePluginTest {
|
34
|
39
|
|
35
|
40
|
@Test
|
36
|
|
- public void testProcessInformation1() throws IOException {
|
|
41
|
+ public void testProcessInformation1() throws IOException, URISyntaxException,
|
|
42
|
+ UnsupportedEncodingException {
|
37
|
43
|
final PluginInfo pluginInfo = mock(PluginInfo.class);
|
38
|
44
|
final IdentityController identityController = mock(IdentityController.class);
|
39
|
45
|
final VlcMediaSourcePlugin plugin = new VlcMediaSourcePlugin(pluginInfo, identityController);
|
40
|
|
- final TextFile index = new TextFile(getClass().getResourceAsStream("index-1.html"));
|
41
|
|
- final TextFile info = new TextFile(getClass().getResourceAsStream("info-1.html"));
|
|
46
|
+
|
|
47
|
+ final TextFile index = new TextFile(FileUtils.getPathForResource(
|
|
48
|
+ getClass().getResource("index-1.html")), Charset.forName("UTF-8"));
|
|
49
|
+ final TextFile info = new TextFile(FileUtils.getPathForResource(
|
|
50
|
+ getClass().getResource("info-1.html")), Charset.forName("UTF-8"));
|
42
|
51
|
|
43
|
52
|
plugin.parseInformation(info.getLines(), index.getLines());
|
44
|
53
|
|