File: 42-object-introspect-avahi.t

package info (click to toggle)
libnet-dbus-perl 0.33.6-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 724 kB
  • ctags: 417
  • sloc: perl: 4,714; sh: 34; makefile: 6
file content (98 lines) | stat: -rw-r--r-- 2,994 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- perl -*-
use Test::More tests => 10;

use strict;
use warnings;

BEGIN {
    use_ok('Net::DBus::Binding::Introspector');
};

local $/ = undef;
my $xml = <DATA>;

my $introspector = Net::DBus::Binding::Introspector->new(object_path => "/org/freedesktop/Avahi/ServiceBrowser",
							 xml => $xml);

isa_ok($introspector, "Net::DBus::Binding::Introspector");

ok($introspector->has_interface("org.freedesktop.DBus.Introspectable"),
   "org.freedesktop.DBus.Introspectable interface present");

ok($introspector->has_interface("org.freedesktop.Avahi.ServiceBrowser"),
   "org.freedesktop.Avahi.ServiceBrowser interface present");

ok($introspector->has_method("Free"), "Free method present");
ok($introspector->has_signal("ItemNew"), "ItemNew signal present");
ok($introspector->has_signal("ItemRemove"), "ItemRemove signal present");
ok($introspector->has_signal("Failure"), "Failure signal present");
ok($introspector->has_signal("AllForNow"), "AllForNow signal present");
ok($introspector->has_signal("CacheExhausted"), "CacheExhausted signal present");


__DATA__
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<?xml-stylesheet type="text/xsl" href="introspect.xsl"?>
<!DOCTYPE node SYSTEM "introspect.dtd">

<!-- $Id: ServiceBrowser.introspect 948 2005-11-12 18:55:52Z lennart $ -->

<!--
  This file is part of avahi.
 
  avahi is free software; you can redistribute it and/or modify it
  under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.

  avahi 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 Lesser General Public
  License along with avahi; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  02111-1307 USA.
-->

<node>
  
  <interface name="org.freedesktop.DBus.Introspectable">
    <method name="Introspect">
      <arg name="data" type="s" direction="out" />
    </method>
  </interface>

  <interface name="org.freedesktop.Avahi.ServiceBrowser">

    <method name="Free"/>
      
    <signal name="ItemNew">
      <arg name="interface" type="i"/>
      <arg name="protocol" type="i"/>
      <arg name="name" type="s"/>
      <arg name="type" type="s"/>
      <arg name="domain" type="s"/>
      <arg name="flags" type="u"/>
    </signal>

    <signal name="ItemRemove">
      <arg name="interface" type="i"/>
      <arg name="protocol" type="i"/>
      <arg name="name" type="s"/>
      <arg name="type" type="s"/>
      <arg name="domain" type="s"/>
      <arg name="flags" type="u"/>
    </signal>

    <signal name="Failure">
      <arg name="error" type="s"/>
    </signal>

    <signal name="AllForNow"/>

    <signal name="CacheExhausted"/>

  </interface> 
</node>