@@ -66,8 +66,6 @@ public void setUp() throws Exception {
6666 public void tearDown () throws Exception {
6767 }
6868
69- // Does not work yet (<- this comment was here in the 0.10 code)
70- // @Ignore("Didn't work in the 0.10 either by the comment so still ignored")
7169 @ Test
7270 public void getPad () throws Exception {
7371 Element src = ElementFactory .make ("fakesrc" , "src" );
@@ -78,26 +76,23 @@ public void getPad() throws Exception {
7876 assertNotNull ("Could not get sink pad" , sinkPad );
7977 src = null ;
8078 sink = null ;
81- WeakReference <Pad > srcRef = new WeakReference <Pad >(srcPad );
82- WeakReference <Pad > sinkRef = new WeakReference <Pad >(sinkPad );
79+ WeakReference <Pad > srcRef = new WeakReference <>(srcPad );
80+ WeakReference <Pad > sinkRef = new WeakReference <>(sinkPad );
8381 srcPad = null ;
8482 sinkPad = null ;
8583 assertTrue ("Src pad not garbage collected" , GCTracker .waitGC (srcRef ));
8684 assertTrue ("Sink pad not garbage collected" , GCTracker .waitGC (sinkRef ));
8785 }
8886
8987 @ Test
90- public void padLink ()
91- throws Exception {
88+ public void padLink () throws Exception {
9289 Element src = ElementFactory .make ("fakesrc" , "src" );
9390 Element sink = ElementFactory .make ("fakesink" , "src" );
9491 Pad srcPad = src .getStaticPad ("src" );
9592 Pad sinkPad = sink .getStaticPad ("sink" );
9693 srcPad .link (sinkPad );
9794 }
9895
99- // @Ignore("This seems to fail because gst1.0 doesn't actually send the event because pads " +
100- // "are now created in FLUSHING state")
10196 @ Test
10297 public void addEventProbe () {
10398 Element elem = ElementFactory .make ("identity" , "src" );
@@ -263,6 +258,9 @@ public PadProbeReturn dataReceived(Pad pad, Buffer buffer) {
263258 // push data
264259 res = src .push (buf2 );
265260 assertNotSame ("data_prober.probeData() should not have been called" , buf2 , b .get ());
261+
262+ elem .stop ();
263+
266264 }
267265
268266 @ Test
@@ -278,8 +276,9 @@ public void addProbe_Data() {
278276 Pad .PROBE probe = (Pad pad , PadProbeInfo info ) -> {
279277 assertTrue ("Info type does not include buffer" ,
280278 info .getType ().contains (PadProbeType .BUFFER ));
281- assertTrue (info .getEvent () == null );
282- assertTrue (info .getQuery () == null );
279+ // These cause assertion messages to be logged by GStreamer
280+ // assertTrue(info.getEvent() == null);
281+ // assertTrue(info.getQuery() == null);
283282 b .set (info .getBuffer ());
284283 return PadProbeReturn .OK ;
285284 };
@@ -299,6 +298,9 @@ public void addProbe_Data() {
299298 // push data
300299 res = src .push (buf2 );
301300 assertNotSame ("Probe (Data) should not have been called" , buf2 , b .get ());
301+
302+ elem .stop ();
303+
302304 }
303305
304306 @ Test
@@ -330,7 +332,6 @@ public void addProbe_Idle() {
330332 public void addProbe_Query () {
331333 ProbeTester .test (PadProbeType .QUERY_BOTH , info -> {
332334 Query q = info .getQuery ();
333- // System.out.println(q.getStructure());
334335 return q instanceof AllocationQuery ;
335336 });
336337
0 commit comments