diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-17 14:47:42 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-12-17 14:47:42 +0100 |
commit | dfc400bbb78624cdc6fabc15072028eeb7a5517f (patch) | |
tree | 0bc6c7cb75164f2e677d314b1007db3fd3fc954b | |
parent | f48a79115d7e98ade1096cd3e5c9ed7bc26fdfb6 (diff) |
add journey tests
-rwxr-xr-x | t/22-db-journey.t | 336 | ||||
-rw-r--r-- | t/in/DB.ICE23.journey.json | 1 | ||||
-rw-r--r-- | t/in/DB.ICE23.json | 1 |
3 files changed, 338 insertions, 0 deletions
diff --git a/t/22-db-journey.t b/t/22-db-journey.t new file mode 100755 index 0000000..a7553a9 --- /dev/null +++ b/t/22-db-journey.t @@ -0,0 +1,336 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use 5.020; + +use utf8; + +use File::Slurp qw(read_file); +use JSON; +use Test::More tests => 144; + +use Travel::Status::DE::HAFAS; + +my $json = JSON->new->utf8->decode( read_file('t/in/DB.ICE23.journey.json') ); + +my $status = Travel::Status::DE::HAFAS->new( + service => 'DB', + journey => { id => '1|196351|0|81|17122023' }, + json => $json +); + +is( $status->errcode, undef, 'no error code' ); +is( $status->errstr, undef, 'no error string' ); + +is( + $status->get_active_service->{name}, + 'Deutsche Bahn', + 'active service name' +); + +my $result = $status->result; + +isa_ok( $result, 'Travel::Status::DE::HAFAS::Journey' ); + +is( $result->name, 'ICE 23', 'name' ); +is( $result->type, 'ICE', 'type' ); +is( $result->type_long, 'Intercity-Express', 'type_long', ); +is( $result->class, 1, 'class' ); +is( $result->line, 'ICE 23', 'line' ); +is( $result->line_no, 91, 'line_no' ); +is( $result->id, '1|196351|0|81|17122023', 'id' ); +is( $result->operator, 'DB Fernverkehr AG', 'operator' ); +is( $result->direction, 'Wien Hbf', 'direction' ); + +is( scalar $result->route, 21, 'route == 21' ); + +is( ( $result->route )[0]->loc->name, 'Dortmund Hbf', 'route[0] name' ); +is( ( $result->route )[0]->direction, 'Wien Hbf', 'route[0] direction' ); +is( ( $result->route )[0]->arr, undef, 'route[0] arr' ); +is( ( $result->route )[0]->rt_arr, undef, 'route[0] rt_arr' ); +is( + ( $result->route )[0]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 043400', + 'route[0] dep' +); +is( ( $result->route )[0]->rt_dep, undef, 'route[0] rt_dep' ); +is( ( $result->route )[0]->arr_delay, undef, 'route[0] arr_delay' ); +is( ( $result->route )[0]->dep_delay, undef, 'route[0] dep_delay' ); +is( ( $result->route )[0]->delay, undef, 'route[0] delay' ); +is( ( $result->route )[0]->load->{FIRST}, 1, 'route[0] load 1st' ); +is( ( $result->route )[0]->load->{SECOND}, 1, 'route[0] load 2nd' ); + +is( ( $result->route )[1]->loc->name, 'Bochum Hbf', 'route[1] name' ); +is( ( $result->route )[1]->direction, undef, 'route[1] direction' ); +is( + ( $result->route )[1]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 044700', + 'route[1] arr' +); +is( ( $result->route )[1]->rt_arr, undef, 'route[1] rt_arr' ); +is( + ( $result->route )[1]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 044800', + 'route[1] dep' +); +is( ( $result->route )[1]->rt_dep, undef, 'route[1] rt_dep' ); +is( ( $result->route )[1]->arr_delay, undef, 'route[1] arr_delay' ); +is( ( $result->route )[1]->dep_delay, undef, 'route[1] dep_delay' ); +is( ( $result->route )[1]->delay, undef, 'route[1] delay' ); +is( ( $result->route )[1]->load->{FIRST}, 1, 'route[1] load 1st' ); +is( ( $result->route )[1]->load->{SECOND}, 1, 'route[1] load 2nd' ); + +is( ( $result->route )[2]->loc->name, 'Essen Hbf', 'route[2] name' ); +is( + ( $result->route )[2]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 045900', + 'route[2] arr' +); +is( ( $result->route )[2]->rt_arr, undef, 'route[2] rt_arr' ); +is( + ( $result->route )[2]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 050100', + 'route[2] dep' +); +is( ( $result->route )[2]->rt_dep, undef, 'route[2] rt_dep' ); +is( ( $result->route )[2]->arr_delay, undef, 'route[2] arr_delay' ); +is( ( $result->route )[2]->dep_delay, undef, 'route[2] dep_delay' ); +is( ( $result->route )[2]->delay, undef, 'route[2] delay' ); +is( ( $result->route )[2]->load->{FIRST}, 1, 'route[2] load 1st' ); +is( ( $result->route )[2]->load->{SECOND}, 1, 'route[2] load 2nd' ); + +is( ( $result->route )[8]->loc->name, 'Mainz Hbf', 'route[8] name' ); +is( + ( $result->route )[8]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 073800', + 'route[8] arr' +); +is( ( $result->route )[8]->rt_arr, undef, 'route[8] rt_arr' ); +is( + ( $result->route )[8]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 074000', + 'route[8] dep' +); +is( ( $result->route )[8]->rt_dep, undef, 'route[8] rt_dep' ); +is( ( $result->route )[8]->arr_delay, undef, 'route[8] arr_delay' ); +is( ( $result->route )[8]->dep_delay, undef, 'route[8] dep_delay' ); +is( ( $result->route )[8]->delay, undef, 'route[8] delay' ); +is( ( $result->route )[8]->load->{FIRST}, 1, 'route[8] load 1st' ); +is( ( $result->route )[8]->load->{SECOND}, 2, 'route[8] load 2nd' ); + +is( + ( $result->route )[9]->loc->name, + 'Frankfurt(M) Flughafen Fernbf', + 'route[9] name' +); +is( + ( $result->route )[9]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 075900', + 'route[9] arr' +); +is( ( $result->route )[9]->rt_arr, undef, 'route[9] rt_arr' ); +is( + ( $result->route )[9]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 080200', + 'route[9] dep' +); +is( ( $result->route )[9]->rt_dep, undef, 'route[9] rt_dep' ); +is( ( $result->route )[9]->arr_delay, undef, 'route[9] arr_delay' ); +is( ( $result->route )[9]->dep_delay, undef, 'route[9] dep_delay' ); +is( ( $result->route )[9]->delay, undef, 'route[9] delay' ); +is( ( $result->route )[9]->load->{FIRST}, undef, 'route[9] load 1st' ); +is( ( $result->route )[9]->load->{SECOND}, undef, 'route[9] load 2nd' ); + +is( ( $result->route )[10]->loc->name, 'Frankfurt(Main)Hbf', 'route[10] name' ); +is( + ( $result->route )[10]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 081400', + 'route[10] arr' +); +is( ( $result->route )[10]->rt_arr, undef, 'route[10] rt_arr' ); +is( + ( $result->route )[10]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 082100', + 'route[10] dep' +); +is( ( $result->route )[10]->rt_dep, undef, 'route[10] rt_dep' ); +is( ( $result->route )[10]->arr_delay, undef, 'route[10] arr_delay' ); +is( ( $result->route )[10]->dep_delay, undef, 'route[10] dep_delay' ); +is( ( $result->route )[10]->delay, undef, 'route[10] delay' ); +is( ( $result->route )[10]->load->{FIRST}, 1, 'route[10] load 1st' ); +is( ( $result->route )[10]->load->{SECOND}, 2, 'route[10] load 2nd' ); + +is( ( $result->route )[12]->loc->name, 'Würzburg Hbf', 'route[12] name' ); +is( + ( $result->route )[12]->sched_arr->strftime('%Y%m%d %H%M%S'), + '20231217 093200', + 'route[12] sched_arr' +); +is( + ( $result->route )[12]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 093300', + 'route[12] arr' +); +is( + ( $result->route )[12]->rt_arr->strftime('%Y%m%d %H%M%S'), + '20231217 093300', + 'route[12] arr' +); +is( + ( $result->route )[12]->sched_dep->strftime('%Y%m%d %H%M%S'), + '20231217 093400', + 'route[12] sched_dep' +); +is( + ( $result->route )[12]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 093600', + 'route[12] dep' +); +is( + ( $result->route )[12]->rt_dep->strftime('%Y%m%d %H%M%S'), + '20231217 093600', + 'route[12] dep' +); +is( ( $result->route )[12]->arr_delay, 1, 'route[12] arr_delay' ); +is( ( $result->route )[12]->dep_delay, 2, 'route[12] dep_delay' ); +is( ( $result->route )[12]->delay, 2, 'route[12] delay' ); +is( ( $result->route )[12]->load->{FIRST}, 2, 'route[12] load 1st' ); +is( ( $result->route )[12]->load->{SECOND}, 2, 'route[12] load 2nd' ); + +is( ( $result->route )[13]->loc->name, 'Nürnberg Hbf', 'route[13] name' ); +is( + ( $result->route )[13]->sched_arr->strftime('%Y%m%d %H%M%S'), + '20231217 102700', + 'route[13] sched_arr' +); +is( + ( $result->route )[13]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 102900', + 'route[13] arr' +); +is( + ( $result->route )[13]->rt_arr->strftime('%Y%m%d %H%M%S'), + '20231217 102900', + 'route[13] arr' +); +is( + ( $result->route )[13]->sched_dep->strftime('%Y%m%d %H%M%S'), + '20231217 103100', + 'route[13] sched_dep' +); +is( + ( $result->route )[13]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 103300', + 'route[13] dep' +); +is( + ( $result->route )[13]->rt_dep->strftime('%Y%m%d %H%M%S'), + '20231217 103300', + 'route[13] dep' +); +is( ( $result->route )[13]->arr_delay, 2, 'route[13] arr_delay' ); +is( ( $result->route )[13]->dep_delay, 2, 'route[13] dep_delay' ); +is( ( $result->route )[13]->delay, 2, 'route[13] delay' ); +is( ( $result->route )[13]->load->{FIRST}, 3, 'route[13] load 1st' ); +is( ( $result->route )[13]->load->{SECOND}, 2, 'route[13] load 2nd' ); + +is( ( $result->route )[15]->loc->name, 'Plattling', 'route[15] name' ); +is( + ( $result->route )[15]->sched_arr->strftime('%Y%m%d %H%M%S'), + '20231217 115700', + 'route[15] sched_arr' +); +is( + ( $result->route )[15]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 115700', + 'route[15] arr' +); +is( + ( $result->route )[15]->rt_arr->strftime('%Y%m%d %H%M%S'), + '20231217 115700', + 'route[15] arr' +); +is( + ( $result->route )[15]->sched_dep->strftime('%Y%m%d %H%M%S'), + '20231217 115900', + 'route[15] sched_dep' +); +is( + ( $result->route )[15]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 115900', + 'route[15] dep' +); +is( + ( $result->route )[15]->rt_dep->strftime('%Y%m%d %H%M%S'), + '20231217 115900', + 'route[15] dep' +); +is( ( $result->route )[15]->arr_delay, 0, 'route[15] arr_delay' ); +is( ( $result->route )[15]->dep_delay, 0, 'route[15] dep_delay' ); +is( ( $result->route )[15]->delay, 0, 'route[15] delay' ); +is( ( $result->route )[15]->load->{FIRST}, 2, 'route[15] load 1st' ); +is( ( $result->route )[15]->load->{SECOND}, 2, 'route[15] load 2nd' ); + +is( ( $result->route )[16]->loc->name, 'Passau Hbf', 'route[16] name' ); +is( + ( $result->route )[16]->sched_arr->strftime('%Y%m%d %H%M%S'), + '20231217 122500', + 'route[16] sched_arr' +); +is( + ( $result->route )[16]->arr->strftime('%Y%m%d %H%M%S'), + '20231217 122700', + 'route[16] arr' +); +is( + ( $result->route )[16]->rt_arr->strftime('%Y%m%d %H%M%S'), + '20231217 122700', + 'route[16] arr' +); +is( + ( $result->route )[16]->sched_dep->strftime('%Y%m%d %H%M%S'), + '20231217 122900', + 'route[16] sched_dep' +); +is( + ( $result->route )[16]->dep->strftime('%Y%m%d %H%M%S'), + '20231217 122900', + 'route[16] dep' +); +is( + ( $result->route )[16]->rt_dep->strftime('%Y%m%d %H%M%S'), + '20231217 122900', + 'route[16] dep' +); +is( ( $result->route )[16]->arr_delay, 2, 'route[16] arr_delay' ); +is( ( $result->route )[16]->dep_delay, 0, 'route[16] dep_delay' ); +is( ( $result->route )[16]->delay, 0, 'route[16] delay' ); +is( ( $result->route )[16]->load->{FIRST}, undef, 'route[16] load 1st' ); +is( ( $result->route )[16]->load->{SECOND}, undef, 'route[16] load 2nd' ); + +is( scalar $result->route_interesting, 3, 'route_interesting == 3' ); +is( ( $result->route_interesting )[0]->loc->name, + 'Dortmund Hbf', 'route_interesting[0]' ); +is( ( $result->route_interesting )[1]->loc->name, + 'Bochum Hbf', 'route_interesting[1]' ); +is( ( $result->route_interesting )[2]->loc->name, + 'Essen Hbf', 'route_interesting[2]' ); + +# there is no station, so corresponding accessors must be undef +is( $result->rt_datetime, undef, 'rt_datetime' ); +is( $result->sched_datetime, undef, 'sched_datetime' ); +is( $result->datetime, undef, 'sched_datetime' ); +is( $result->delay, undef, 'delay' ); +is( $result->is_cancelled, undef, 'is_cancelled' ); +is( $result->is_partially_cancelled, undef, 'is_partially_cancelled' ); +is( $result->rt_platform, undef, 'rt_platform' ); +is( $result->sched_platform, undef, 'sched_platform' ); +is( $result->platform, undef, 'platform' ); +is( $result->is_changed_platform, 0, 'is_changed_platform' ); +is( $result->load, undef, 'load' ); +is( $result->station, undef, 'station' ); +is( $result->station_eva, undef, 'station_eva' ); +is( $result->origin, undef, 'origin' ); +is( $result->destination, undef, 'destination' ); + +is( scalar $result->messages, 12, 'messages' ); diff --git a/t/in/DB.ICE23.journey.json b/t/in/DB.ICE23.journey.json new file mode 100644 index 0000000..5264769 --- /dev/null +++ b/t/in/DB.ICE23.journey.json @@ -0,0 +1 @@ +{"id":"2d4m7jaum2scww8g","lang":"deu","ver":"1.15","cInfo":{"code":"OK"},"svcResL":[{"res":{"planrtTS":"1702800592","fpE":"20241214","fpB":"20221211","common":{"opL":[{"name":"DB Fernverkehr AG","icoX":1},{"name":"Österreichische Bundesbahnen","icoX":3}],"polyL":[],"prodL":[{"number":"23","name":"ICE 23","cls":1,"prodCtx":{"admin":"80____","catCode":"0","catOutL":"Intercity-Express","matchId":"91","num":"23","name":"ICE 23","catIn":"ICE","catOut":"ICE","catOutS":"ICE"},"oprX":0,"icoX":0},{"name":"ICE 23","icoX":0,"oprX":1,"prodCtx":{"catOutS":"ICE","catOut":"ICE","catIn":"ICE","name":"ICE 23","num":"23","matchId":"23","catOutL":"Intercity-Express","catCode":"0","admin":"81____"},"cls":1,"number":"23"}],"layerL":[{"annoCnt":0,"id":"standard","index":0,"name":"standard"}],"tcocL":[{"c":"FIRST","r":1},{"r":1,"c":"SECOND"},{"r":1,"c":"FIRST"},{"c":"SECOND","r":1},{"r":1,"c":"FIRST"},{"c":"SECOND","r":1},{"c":"FIRST","r":1},{"r":1,"c":"SECOND"},{"r":1,"c":"FIRST"},{"r":1,"c":"SECOND"},{"c":"FIRST","r":1},{"c":"SECOND","r":1},{"r":1,"c":"FIRST"},{"c":"SECOND","r":1},{"r":1,"c":"FIRST"},{"c":"SECOND","r":1},{"c":"FIRST","r":1},{"r":2,"c":"SECOND"},{"c":"FIRST","r":1},{"c":"SECOND","r":2},{"c":"FIRST","r":1},{"c":"SECOND","r":2},{"r":2,"c":"FIRST"},{"r":2,"c":"SECOND"},{"r":3,"c":"FIRST"},{"r":2,"c":"SECOND"},{"r":2,"c":"FIRST"},{"r":2,"c":"SECOND"},{"r":2,"c":"FIRST"},{"r":2,"c":"SECOND"},{"c":"FIRST","r":3},{"r":2,"c":"SECOND"}],"locL":[{"type":"S","name":"Dortmund Hbf","pCls":191,"extId":"8000080","crd":{"type":"WGS84","y":51517872,"x":7459276,"crdSysX":0,"layerX":0,"z":0},"icoX":2,"lid":"A=1@O=Dortmund Hbf@X=7459294@Y=51517899@U=81@L=8000080@","state":"F"},{"extId":"8000298","icoX":0,"crd":{"x":13450775,"y":48573778,"type":"WGS84","z":0,"layerX":0,"crdSysX":0},"pCls":555,"name":"Passau Hbf","type":"S","state":"F","lid":"A=1@O=Passau Hbf@X=13450775@Y=48573635@U=81@L=8000298@"},{"extId":"8103000","crd":{"crdSysX":0,"layerX":0,"type":"WGS84","y":48185103,"x":16377114},"icoX":0,"pCls":415,"name":"Wien Hbf","type":"S","state":"F","lid":"A=1@O=Wien Hbf@X=16377114@Y=48185103@U=81@L=8103000@"},{"state":"F","lid":"A=1@O=Bochum Hbf@X=7223273@Y=51478607@U=81@L=8000041@","icoX":0,"crd":{"layerX":0,"crdSysX":0,"z":0,"type":"WGS84","x":7223264,"y":51478490},"extId":"8000041","pCls":447,"name":"Bochum Hbf","type":"S"},{"name":"Essen Hbf","type":"S","icoX":2,"crd":{"type":"WGS84","x":7013860,"y":51451378,"layerX":0,"crdSysX":0,"z":0},"extId":"8000098","pCls":447,"state":"F","lid":"A=1@O=Essen Hbf@X=7014795@Y=51451351@U=81@L=8000098@"},{"state":"F","lid":"A=1@O=Duisburg Hbf@X=6775907@Y=51429786@U=81@L=8000086@","name":"Duisburg Hbf","type":"S","icoX":2,"crd":{"type":"WGS84","y":51429615,"x":6776060,"crdSysX":0,"layerX":0,"z":0},"extId":"8000086","pCls":447},{"state":"F","lid":"A=1@O=Düsseldorf Hbf@X=6794317@Y=51219960@U=81@L=8000085@","name":"Düsseldorf Hbf","type":"S","extId":"8000085","icoX":2,"crd":{"layerX":0,"crdSysX":0,"z":0,"type":"WGS84","x":6794011,"y":51219708},"pCls":447},{"state":"F","lid":"A=1@O=Köln Hbf@X=6958730@Y=50943029@U=81@L=8000207@","name":"Köln Hbf","type":"S","extId":"8000207","crd":{"crdSysX":0,"layerX":0,"z":0,"type":"WGS84","y":50942823,"x":6959197},"icoX":2,"pCls":319},{"extId":"8000044","crd":{"y":50731963,"x":7096678,"type":"WGS84","z":0,"crdSysX":0,"layerX":0},"icoX":0,"pCls":319,"name":"Bonn Hbf","type":"S","state":"F","lid":"A=1@O=Bonn Hbf@X=7097136@Y=50732008@U=81@L=8000044@"},{"lid":"A=1@O=Koblenz Hbf@X=7588343@Y=50350928@U=81@L=8000206@","state":"F","type":"S","name":"Koblenz Hbf","pCls":559,"extId":"8000206","icoX":0,"crd":{"layerX":0,"crdSysX":0,"z":0,"type":"WGS84","x":7588343,"y":50350775}},{"name":"Mainz Hbf","type":"S","icoX":0,"crd":{"layerX":0,"crdSysX":0,"z":0,"type":"WGS84","x":8258453,"y":50001239},"extId":"8000240","pCls":319,"state":"F","lid":"A=1@O=Mainz Hbf@X=8258723@Y=50001113@U=81@L=8000240@"},{"lid":"A=1@O=Frankfurt(M) Flughafen Fernbf@X=8570181@Y=50053169@U=81@L=8070003@","state":"F","pCls":31,"icoX":0,"crd":{"type":"WGS84","y":50052926,"x":8569776,"crdSysX":0,"layerX":0,"z":0},"extId":"8070003","type":"S","name":"Frankfurt(M) Flughafen Fernbf"},{"state":"F","lid":"A=1@O=Frankfurt(Main)Hbf@X=8663785@Y=50107149@U=81@L=8000105@","icoX":4,"crd":{"z":0,"layerX":0,"crdSysX":0,"x":8663003,"y":50106817,"type":"WGS84"},"extId":"8000105","pCls":447,"name":"Frankfurt(Main)Hbf","type":"S"},{"state":"F","lid":"A=1@O=Hanau Hbf@X=8929003@Y=50120957@U=81@L=8000150@","extId":"8000150","crd":{"layerX":0,"crdSysX":0,"z":0,"type":"WGS84","x":8929210,"y":50120903},"icoX":0,"pCls":575,"name":"Hanau Hbf","type":"S"},{"lid":"A=1@O=Würzburg Hbf@X=9935777@Y=49801795@U=81@L=8000260@","state":"F","type":"S","name":"Würzburg Hbf","pCls":299,"crd":{"type":"WGS84","y":49802163,"x":9935930,"crdSysX":0,"layerX":0,"z":0},"icoX":0,"extId":"8000260"},{"state":"F","lid":"A=1@O=Nürnberg Hbf@X=11082989@Y=49445615@U=81@L=8000284@","name":"Nürnberg Hbf","type":"S","crd":{"z":0,"crdSysX":0,"layerX":0,"y":49445435,"x":11082270,"type":"WGS84"},"icoX":0,"extId":"8000284","pCls":447},{"icoX":0,"crd":{"type":"WGS84","x":12099669,"y":49011751,"layerX":0,"crdSysX":0,"z":0},"extId":"8000309","pCls":555,"name":"Regensburg Hbf","type":"S","state":"F","lid":"A=1@O=Regensburg Hbf@X=12099615@Y=49011670@U=81@L=8000309@"},{"lid":"A=1@O=Plattling@X=12863941@Y=48779622@U=81@L=8000301@","state":"F","type":"S","name":"Plattling","pCls":555,"extId":"8000301","crd":{"z":0,"crdSysX":0,"layerX":0,"y":48779604,"x":12863959,"type":"WGS84"},"icoX":0},{"state":"F","lid":"A=1@O=Linz Hbf@X=14292129@Y=48290178@U=81@L=8100013@","extId":"8100013","crd":{"layerX":0,"crdSysX":0,"type":"WGS84","x":14292129,"y":48290178},"icoX":0,"pCls":287,"name":"Linz Hbf","type":"S"},{"state":"F","lid":"A=1@O=St.Pölten Hbf@X=15624672@Y=48208304@U=81@L=8100008@","name":"St.Pölten Hbf","type":"S","icoX":0,"crd":{"type":"WGS84","y":48208304,"x":15624672,"crdSysX":0,"layerX":0},"extId":"8100008","pCls":31},{"lid":"A=1@O=Wien Meidling@X=16333085@Y=48174451@U=81@L=8100514@","state":"F","type":"S","name":"Wien Meidling","pCls":159,"crd":{"type":"WGS84","y":48174451,"x":16333085,"crdSysX":0,"layerX":0},"icoX":0,"extId":"8100514"}],"crdSysL":[{"dim":3,"type":"WGS84","id":"standard","index":0}],"remL":[{"prio":200,"icoX":5,"code":"CK","type":"A","txtN":"Sicher & kontaktlos ohne Ticketkontrolle reisen mit Komfort Check-in (Dortmund Hbf - Passau Hbf)"},{"code":"FR","icoX":6,"prio":260,"type":"A","txtN":"Fahrradmitnahme reservierungspflichtig"},{"icoX":7,"code":"FB","prio":260,"txtN":"Fahrradmitnahme begrenzt möglich (Dortmund Hbf - Passau Hbf)","type":"A"},{"prio":260,"code":"FB","icoX":7,"txtN":"Fahrradmitnahme begrenzt möglich (Passau Hbf - Wien Hbf)","type":"A"},{"code":"BR","icoX":8,"prio":450,"type":"A","txtN":"Bordrestaurant (Passau Hbf - Wien Hbf)"},{"code":"RO","icoX":9,"prio":560,"type":"A","txtN":"Rollstuhlstellplatz (Passau Hbf - Wien Hbf)"},{"prio":560,"code":"OA","icoX":5,"txtN":"Rollstuhlstellplatz - Voranmeldung unter +43 5 1717 (Passau Hbf - Wien Hbf)","type":"A"},{"prio":560,"code":"OC","icoX":5,"txtN":"rollstuhltaugliches WC (Passau Hbf - Wien Hbf)","type":"A"},{"type":"A","txtN":"Ruhezone (Passau Hbf - Wien Hbf)","code":"HD","icoX":5,"prio":605},{"prio":610,"icoX":10,"code":"KK","type":"A","txtN":"Kleinkindabteil (Passau Hbf - Wien Hbf)"},{"prio":710,"code":"WV","icoX":5,"txtN":"WLAN verfügbar (Passau Hbf - Wien Hbf)","type":"A"},{"txtN":"Wagen 37 verkehrt abweichend als 1./2. Klasse-Sitzwagen statt Bordbistro mit Kleinkindabteil. Das Kleinkindabteil befindet sich in Wagen 36. Der Zug verkehrt mit zusätzlichen Sitzplätzen.","type":"M","txtS":"Würzburg Hbf->Passau Hbf: Information. ","code":"","icoX":11}],"icoL":[{"res":"ICE"},{"txt":"DB Fernverkehr AG","res":"D"},{"res":"EST"},{"res":"D","txt":"Österreichische Bundesbahnen"},{"res":"ECE"},{"res":"attr_info"},{"res":"attr_bike_r"},{"res":"attr_bike"},{"res":"attr_resto"},{"res":"attr_wchair"},{"res":"attr_baby"},{"res":"HimInfo"}]},"journey":{"sDaysL":[{"fLocX":0,"tLocX":2,"sDaysB":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003FE4C000000000007FFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000000000","sDaysR":"fährt 17. Dez 2023 bis 15. Jul 2024; nicht 25., 26., 28., 29. Dez 2023, 1. Jan bis 16. Feb 2024, 23. Mär bis 7. Apr 2024 "}],"date":"20231217","subscr":"F","dirFlg":"1","dirTxt":"Wien Hbf","msgL":[{"type":"REM","fLocX":0,"tIdx":16,"fIdx":0,"tLocX":1,"remX":0,"tagL":["RES_JNY_DTL"]},{"tIdx":20,"fLocX":0,"type":"REM","tagL":["RES_JNY_DTL"],"remX":1,"tLocX":2,"fIdx":0},{"remX":2,"tagL":["RES_JNY_DTL"],"tLocX":1,"fIdx":0,"tIdx":16,"fLocX":0,"type":"REM"},{"tagL":["RES_JNY_DTL"],"remX":3,"tLocX":2,"fIdx":16,"tIdx":20,"fLocX":1,"type":"REM"},{"tagL":["RES_JNY_DTL"],"remX":4,"tLocX":2,"fIdx":16,"tIdx":20,"fLocX":1,"type":"REM"},{"type":"REM","fLocX":1,"tIdx":20,"fIdx":16,"tLocX":2,"remX":5,"tagL":["RES_JNY_DTL"]},{"fIdx":16,"tLocX":2,"tagL":["RES_JNY_DTL"],"remX":6,"type":"REM","fLocX":1,"tIdx":20},{"tLocX":2,"fIdx":16,"remX":7,"tagL":["RES_JNY_DTL"],"type":"REM","tIdx":20,"fLocX":1},{"type":"REM","tIdx":20,"fLocX":1,"tLocX":2,"fIdx":16,"tagL":["RES_JNY_DTL"],"remX":8},{"fIdx":16,"tLocX":2,"remX":9,"tagL":["RES_JNY_DTL"],"type":"REM","fLocX":1,"tIdx":20},{"fIdx":16,"tLocX":2,"remX":10,"tagL":["RES_JNY_DTL"],"type":"REM","fLocX":1,"tIdx":20},{"tIdx":-1,"type":"REM","tagL":["RES_JNY_H2"],"remX":11,"fIdx":-1,"prio":120}],"pos":{"layerX":0,"crdSysX":0,"x":9540458,"y":50025842},"stopL":[{"dTrnCmpSX":{"tcocX":[0,1]},"dDirTxt":"Wien Hbf","dProgType":"REPORTED","type":"N","dTimeS":"043400","idx":0,"dDirFlg":"1","locX":0,"dInR":true,"dProdX":0,"dPlatfS":"16","dTZOffset":60},{"type":"N","dProgType":"REPORTED","dTrnCmpSX":{"tcocX":[2,3]},"idx":1,"aOutR":true,"aTZOffset":60,"aPlatfS":"3","aProdX":0,"dTimeS":"044800","dInR":true,"aProgType":"REPORTED","locX":3,"dTZOffset":60,"dPlatfS":"3","dProdX":0,"aTimeS":"044700"},{"dInR":true,"aProgType":"REPORTED","locX":4,"dTZOffset":60,"dPlatfS":"2","dProdX":0,"aTimeS":"045900","type":"N","dProgType":"REPORTED","dTrnCmpSX":{"tcocX":[4,5]},"aTZOffset":60,"aOutR":true,"idx":2,"aPlatfS":"2","aProdX":0,"dTimeS":"050100"},{"idx":3,"aTZOffset":60,"aOutR":true,"aPlatfS":"3","dTimeS":"051400","aProdX":0,"type":"N","dProgType":"REPORTED","dTrnCmpSX":{"tcocX":[6,7]},"dTZOffset":60,"dPlatfS":"3","aTimeS":"051200","dProdX":0,"aProgType":"REPORTED","dInR":true,"locX":5},{"dProgType":"REPORTED","type":"N","dTrnCmpSX":{"tcocX":[8,9]},"idx":4,"aOutR":true,"aTZOffset":60,"aProdX":0,"dTimeS":"052700","aPlatfS":"16","dInR":true,"aProgType":"REPORTED","locX":6,"dTZOffset":60,"dProdX":0,"aTimeS":"052500","dPlatfS":"16"},{"aProgType":"REPORTED","dInR":true,"locX":7,"dTZOffset":60,"aTimeS":"055000","dProdX":0,"dPlatfS":"7","dProgType":"REPORTED","type":"N","dTrnCmpSX":{"tcocX":[10,11]},"aOutR":true,"idx":5,"aTZOffset":60,"dTimeS":"055300","aProdX":0,"aPlatfS":"7"},{"dTrnCmpSX":{"tcocX":[12,13]},"type":"N","dProgType":"REPORTED","aPlatfS":"3","dTimeS":"061400","aProdX":0,"idx":6,"aTZOffset":60,"aOutR":true,"locX":8,"aProgType":"REPORTED","dInR":true,"dPlatfS":"3","aTimeS":"061200","dProdX":0,"dTZOffset":60},{"dTZOffset":60,"dPlatfS":"4","dProdX":0,"aTimeS":"064600","dInR":true,"aProgType":"REPORTED","locX":9,"idx":7,"aOutR":true,"aTZOffset":60,"aPlatfS":"4","aProdX":0,"dTimeS":"064800","type":"N","dProgType":"REPORTED","dTrnCmpSX":{"tcocX":[14,15]}},{"locX":10,"dInR":true,"aProgType":"REPORTED","dProdX":0,"aTimeS":"073800","dPlatfS":"5a/b","dTZOffset":60,"dTrnCmpSX":{"tcocX":[16,17]},"dProgType":"REPORTED","type":"N","aProdX":0,"dTimeS":"074000","aPlatfS":"5a/b","aOutR":true,"aTZOffset":60,"idx":8},{"dInR":true,"aProgType":"REPORTED","locX":11,"dTZOffset":60,"dPlatfS":"Fern 5","dProdX":0,"aTimeS":"075900","type":"N","dProgType":"REPORTED","idx":9,"aOutR":true,"aTZOffset":60,"aPlatfS":"Fern 5","aProdX":0,"dTimeS":"080200"},{"aPlatfS":"6","aProdX":0,"dTimeS":"082100","aOutR":true,"aTZOffset":60,"idx":10,"dTrnCmpSX":{"tcocX":[18,19]},"type":"N","dProgType":"REPORTED","dPlatfS":"6","dProdX":0,"aTimeS":"081400","dTZOffset":60,"locX":12,"dInR":true,"aProgType":"REPORTED"},{"dProgType":"REPORTED","type":"N","dTrnCmpSX":{"tcocX":[20,21]},"idx":11,"aOutR":true,"aTZOffset":60,"dTimeS":"083800","aProdX":0,"aPlatfS":"103","aProgType":"REPORTED","dInR":true,"locX":13,"dTZOffset":60,"aTimeS":"083700","dProdX":0,"dPlatfS":"103"},{"type":"N","dProgType":"PROGNOSED","aTimeR":"093300","dTrnCmpSX":{"tcocX":[22,23]},"aOutR":true,"idx":12,"aTZOffset":60,"aPlatfS":"5","aProdX":0,"dTimeS":"093400","dInR":true,"aProgType":"PROGNOSED","locX":14,"dTimeR":"093600","dTZOffset":60,"dPlatfS":"5","dProdX":0,"aTimeS":"093200"},{"type":"N","dProgType":"PROGNOSED","dTrnCmpSX":{"tcocX":[24,25]},"aTimeR":"102900","aOutR":true,"idx":13,"aTZOffset":60,"aPlatfS":"9","aProdX":0,"dTimeS":"103100","dInR":true,"aProgType":"PROGNOSED","locX":15,"dTimeR":"103300","dTZOffset":60,"dPlatfS":"9","dProdX":0,"aTimeS":"102700"},{"dInR":true,"aProgType":"PROGNOSED","locX":16,"dTimeR":"112800","dTZOffset":60,"dPlatfS":"9","dProdX":0,"aTimeS":"112300","type":"N","dProgType":"PROGNOSED","aTimeR":"112600","dTrnCmpSX":{"tcocX":[26,27]},"aOutR":true,"idx":14,"aTZOffset":60,"aPlatfS":"9","aProdX":0,"dTimeS":"112500"},{"dTimeR":"115900","locX":17,"aProgType":"PROGNOSED","dInR":true,"aTimeS":"115700","dProdX":0,"dPlatfS":"3","dTZOffset":60,"aTimeR":"115700","dTrnCmpSX":{"tcocX":[28,29]},"dProgType":"PROGNOSED","type":"N","dTimeS":"115900","aProdX":0,"aPlatfS":"3","aTZOffset":60,"aOutR":true,"idx":15},{"border":true,"dPlatfS":"5","aTimeS":"122500","dProdX":1,"dTZOffset":60,"locX":1,"dTimeR":"122900","aProgType":"PROGNOSED","dInR":true,"aPlatfS":"5","dTimeS":"122900","aProdX":0,"idx":16,"aTZOffset":60,"aOutR":true,"aTimeR":"122700","type":"N","dProgType":"PROGNOSED"},{"dTimeS":"132800","aProdX":1,"aPlatfS":"8A-F","aOutR":true,"idx":17,"aTZOffset":60,"aTimeR":"132600","dProgType":"PROGNOSED","type":"N","aTimeS":"132600","dProdX":1,"dPlatfS":"8A-F","dTZOffset":60,"dTimeR":"132800","locX":18,"aProgType":"PROGNOSED","dInR":true},{"locX":19,"dTimeR":"141600","dInR":true,"aProgType":"PROGNOSED","dPlatfS":"3","dProdX":1,"aTimeS":"141400","dTZOffset":60,"aTimeR":"141400","type":"N","dProgType":"PROGNOSED","aPlatfS":"3","aProdX":1,"dTimeS":"141600","aOutR":true,"idx":18,"aTZOffset":60},{"dPlatfS":"7","dProdX":1,"aTimeS":"144000","dTZOffset":60,"locX":20,"dTimeR":"144200","dInR":true,"aProgType":"PROGNOSED","aPlatfS":"7","aProdX":1,"dTimeS":"144200","idx":19,"aTZOffset":60,"aOutR":true,"aTimeR":"144000","type":"N","dProgType":"PROGNOSED"},{"aPlatfS":"7A-B","aTimeS":"144700","aProdX":1,"aTZOffset":60,"aOutR":true,"idx":20,"locX":2,"aTimeR":"144700","type":"N","aProgType":"PROGNOSED"}],"jid":"1|196351|0|81|17122023","dTrnCmpSX":{"tcocX":[30,31]},"isRchbl":true,"status":"P","prodX":0}},"err":"OK","meth":"JourneyDetails"}],"ext":"DB.R21.12.a"} diff --git a/t/in/DB.ICE23.json b/t/in/DB.ICE23.json new file mode 100644 index 0000000..44fce25 --- /dev/null +++ b/t/in/DB.ICE23.json @@ -0,0 +1 @@ +{"svcResL":[{"res":{"common":{"opL":[{"icoX":0,"name":"DB Fernverkehr AG"}],"remL":[],"polyL":[],"icoL":[{"res":"D","txt":"DB Fernverkehr AG"},{"res":"ICE"},{"res":"EST"}],"prodL":[{"prodCtx":{"catOutL":"Intercity-Express","catIn":"ICE","catOutS":"ICE","lineId":"0_80_____91","name":"ICE 23","admin":"80____","line":"91","catOut":"ICE","num":"23","catCode":"0","matchId":"91"},"number":"23","nameS":"91","oprX":0,"cls":1,"name":"ICE 23","icoX":1}],"locL":[{"lid":"A=1@O=Dortmund Hbf@X=7459294@Y=51517899@U=81@L=8000080@","crd":{"type":"WGS84","y":51517872,"crdSysX":0,"z":0,"x":7459276,"layerX":0},"state":"F","pCls":191,"extId":"8000080","name":"Dortmund Hbf","icoX":2,"type":"S"},{"crd":{"y":48573778,"type":"WGS84","x":13450775,"layerX":0,"z":0,"crdSysX":0},"lid":"A=1@O=Passau Hbf@X=13450775@Y=48573635@U=81@L=8000298@","state":"F","pCls":555,"extId":"8000298","name":"Passau Hbf","icoX":1,"type":"S"}],"layerL":[{"annoCnt":0,"id":"standard","index":0,"name":"standard"}],"crdSysL":[{"id":"standard","dim":3,"type":"WGS84","index":0}]},"jnyL":[{"date":"20231217","pos":{"x":9530301,"y":50034148,"layerX":0,"crdSysX":0},"stopL":[{"dTZOffset":60,"dTimeS":"043400","locX":0},{"aTimeS":"122500","aTZOffset":60,"locX":1}],"prodX":0,"sDaysL":[{"sDaysR":"fährt 16. Dez 2023 bis 15. Jul 2024; nicht 25., 26., 28., 29. Dez 2023, 1. Jan bis 16. Feb 2024, 23. Mär bis 7. Apr 2024 ","sDaysB":"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003FE4C000000000007FFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFE00000000000000000000000000000000000000"}],"jid":"1|196351|0|81|17122023"}],"fpE":"20241214","fpB":"20221211","planrtTS":"1702800532"},"meth":"JourneyMatch","err":"OK"}],"ext":"DB.R21.12.a","cInfo":{"code":"OK"},"id":"8gmi5je6m2cywg8g","lang":"deu","ver":"1.15"} |