]> git.sesse.net Git - vlc/blob - bindings/java/core/src/test/java/org/videolan/jvlc/VLMTest.java
jvlc: abstract test class added to not-internal tests too
[vlc] / bindings / java / core / src / test / java / org / videolan / jvlc / VLMTest.java
1 /*****************************************************************************
2  * VLMTest.java: VLC Java Bindings
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  *
6  * Authors: Filippo Carone <filippo@carone.org>
7  *
8  *
9  * $Id $
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 package org.videolan.jvlc;
27
28 import junit.framework.Assert;
29
30 import org.junit.Test;
31
32
33 public class VLMTest extends AbstractJVLCTest
34 {
35     private String mediaName = "test";
36     
37     @Test
38     public void testVLMInit()
39     {
40         VLM vlm = jvlc.getVLM();
41         Assert.assertNotNull(vlm);
42     }
43     
44     @Test
45     public void testAddBroadcast()
46     {
47         VLM vlm = jvlc.getVLM();
48         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
49     }
50     
51     @Test
52     public void testShowMedia()
53     {
54         VLM vlm = jvlc.getVLM();
55         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
56         vlm.showMedia(mediaName);
57     }
58     
59     @Test
60     public void testDisableMedia()
61     {
62         VLM vlm = jvlc.getVLM();
63         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
64         vlm.disableMedia(mediaName);
65     }
66
67     
68     @Test
69     public void testPauseMedia()
70     {
71         VLM vlm = jvlc.getVLM();
72         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
73         vlm.playMedia(mediaName);
74         vlm.pauseMedia(mediaName);
75         vlm.stopMedia(mediaName);
76     }
77
78     @Test
79     public void testStopMedia()
80     {
81         VLM vlm = jvlc.getVLM();
82         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
83         vlm.playMedia(mediaName);
84         vlm.stopMedia(mediaName);
85     }
86
87     @Test
88     public void testSeekMedia()
89     {
90         VLM vlm = jvlc.getVLM();
91         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
92         vlm.playMedia(mediaName);
93         vlm.seekMedia(mediaName, 0.3f);
94         vlm.stopMedia(mediaName);
95     }
96     
97     @Test
98     public void testAddMediaInput()
99     {
100         VLM vlm = jvlc.getVLM();
101         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, true, false);
102         vlm.addMediaInput(mediaName, "file://" + mrl);
103     }
104     
105     @Test
106     public void testEnableMedia()
107     {
108         VLM vlm = jvlc.getVLM();
109         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false);
110         vlm.enableMedia(mediaName);
111     }
112     
113     @Test
114     public void testDeleteMedia()
115     {
116         VLM vlm = jvlc.getVLM();
117         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false);
118         vlm.deleteMedia(mediaName);
119     }
120     
121     @Test
122     public void testMediaLoop()
123     {
124         VLM vlm = jvlc.getVLM();
125         vlm.addBroadcast(mediaName, "file://" + mrl, "", null, false, false);
126         vlm.setMediaLoop(mediaName, true);
127     }
128 }