root/HTTP-MobileAgent/trunk/t/03_j_phone.t

Revision 826 (checked in by miyagawa, 18 years ago)

added is_wap12

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use Test::More tests => 224;
3
4 BEGIN { use_ok 'HTTP::MobileAgent' }
5
6 my @Tests = (
7     # ua, version, model, packet_compliant, serial_number, vendor, vendor_version, java_infos
8     [ 'J-PHONE/2.0/J-DN02', '2.0', 'J-DN02', undef ],
9     [ 'J-PHONE/3.0/J-PE03_a', '3.0', 'J-PE03_a', undef ],
10     [ 'J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0',
11       '4.0', 'J-SH51', 1, 'JSHA3029293', 'SH', '0001aa', {
12           Profile =>'MIDP-1.0',
13           Configuration => 'CLDC-1.0',
14           'Ext-Profile' => 'JSCL-1.1.0',
15       } ],
16     [ 'J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0',
17       '4.0', 'J-SH51', 1, 'XXXXXXXXX', 'SH', '0001a', {
18           Profile => 'MIDP-1.0',
19           Configuration => 'CLDC-1.0',
20           'Ext-Profile' => 'JSCL-1.1.0',
21       }],
22 );
23
24 for (@Tests) {
25     my($ua, @data) = @$_;
26     my $agent = HTTP::MobileAgent->new($ua);
27     isa_ok $agent, 'HTTP::MobileAgent';
28     isa_ok $agent, 'HTTP::MobileAgent::JPhone';
29     ok !$agent->is_docomo && $agent->is_j_phone && !$agent->is_ezweb;
30     is $agent->name, 'J-PHONE';
31     is $agent->user_agent, $ua,         "ua is $ua";
32
33     is $agent->version, $data[0],       "version is $data[0]";
34     is $agent->model, $data[1],         "model is $data[1]";
35     is $agent->packet_compliant, $data[2], "packet compliant?";
36     if (@data > 3) {
37         is $agent->serial_number, $data[3],     "serial is $data[3]";
38         is $agent->vendor, $data[4],            "vendor is $data[4]";
39         is $agent->vendor_version, $data[5],    "vendor version is $data[5]";
40         is_deeply $agent->java_info, $data[6];
41     }
42 }
43
44 while (<DATA>) {
45     next if /^#/;
46     chomp;
47     local $ENV{HTTP_USER_AGENT} = $_;
48     my $agent = HTTP::MobileAgent->new;
49     isa_ok $agent, 'HTTP::MobileAgent', "$_";
50     is $agent->name, 'J-PHONE';
51     ok !$agent->is_docomo && $agent->is_j_phone && !$agent->is_ezweb;
52 }
53
54 __END__
55 J-PHONE/1.0
56 J-PHONE/2.0/J-DN02
57 J-PHONE/2.0/J-P02
58 J-PHONE/2.0/J-P03
59 J-PHONE/2.0/J-SA02
60 J-PHONE/2.0/J-SH02
61 J-PHONE/2.0/J-SH03
62 J-PHONE/2.0/J-SH03_a
63 J-PHONE/2.0/J-SH04
64 J-PHONE/2.0/J-T04
65 J-PHONE/2.0/J-T05
66 J-PHONE/3.0/J-D03
67 J-PHONE/3.0/J-D04
68 J-PHONE/3.0/J-D05
69 J-PHONE/3.0/J-DN03
70 J-PHONE/3.0/J-K03
71 J-PHONE/3.0/J-K04
72 J-PHONE/3.0/J-K05
73 J-PHONE/3.0/J-N03
74 J-PHONE/3.0/J-N03B
75 J-PHONE/3.0/J-N04
76 J-PHONE/3.0/J-N05
77 J-PHONE/3.0/J-NM01_a
78 J-PHONE/3.0/J-NM02
79 J-PHONE/3.0/J-PE03
80 J-PHONE/3.0/J-PE03_a
81 J-PHONE/3.0/J-SA03_a
82 J-PHONE/3.0/J-SA04
83 J-PHONE/3.0/J-SA04_a
84 J-PHONE/3.0/J-SH04
85 J-PHONE/3.0/J-SH04_a
86 J-PHONE/3.0/J-SH04_b
87 J-PHONE/3.0/J-SH04_c
88 J-PHONE/3.0/J-SH05
89 J-PHONE/3.0/J-SH05_a
90 J-PHONE/3.0/J-SH06
91 J-PHONE/3.0/J-SH07
92 J-PHONE/3.0/J-SH08
93 J-PHONE/3.0/J-T05
94 J-PHONE/3.0/J-T06
95 J-PHONE/3.0/J-T06_a
96 J-PHONE/3.0/J-T07
97 J-PHONE/4.0/J-K51/SNJKWA3001061 KW/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
98 J-PHONE/4.0/J-K51/SNJKWA3040744 KW/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
99 J-PHONE/4.0/J-P51/SNJMAA1036146 MA/JDP51A36 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
100 J-PHONE/4.0/J-SH51 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
101 J-PHONE/4.0/J-SH51/SNJSHA1032366 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
102 J-PHONE/4.0/J-SH51/SNJSHA1041639 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
103 J-PHONE/4.0/J-SH51/SNJSHA2901949 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
104 J-PHONE/4.0/J-SH51/SNJSHA3008160 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
105 J-PHONE/4.0/J-SH51/SNJSHA3016183 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
106 J-PHONE/4.0/J-SH51/SNJSHA3029293 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
107 J-PHONE/4.0/J-SH51/SNXXXXXXXXX SH/0001a Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
108 J-PHONE/4.0/J-SH51_a/SNJSHA1045575 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
109 J-PHONE/4.0/J-SH51_a/SNJSHA1082487 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
110 J-PHONE/4.0/J-SH51_a/SNJSHA1086956 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
111 J-PHONE/4.0/J-SH51_a/SNJSHA3093881 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
112 J-PHONE/4.0/J-SH51_a/SNJSHA5081372 SH/0001aa Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
113 J-PHONE/4.0/J-T51/SNJTSA1077171 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
114 J-PHONE/4.0/J-T51/SNJTSA1082745 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
115 J-PHONE/4.0/J-T51/SNJTSA3001961 TS/1.00 Profile/MIDP-1.0 Configuration/CLDC-1.0 Ext-Profile/JSCL-1.1.0
Note: See TracBrowser for help on using the browser.