Ignore:
Timestamp:
01/29/09 13:35:57 (3 years ago)
Author:
CrawfordCurrie
Message:

Item455: port to foswiki Item5974: correct CSS for search results table Item5938: load CSS for ACTIONSEARCH Item5606: Item5915: respect global settings for time format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ActionTrackerPlugin/test/unit/ActionTrackerPlugin/ActionNotifyTests.pm

    r1340 r2226  
    44use strict; 
    55 
    6 use TWiki::Plugins::ActionTrackerPlugin::Action; 
    7 use TWiki::Plugins::ActionTrackerPlugin::ActionSet; 
    8 use TWiki::Plugins::ActionTrackerPlugin::ActionNotify; 
    9 use TWiki::Plugins::ActionTrackerPlugin::Format; 
    10 use TWiki::Plugins::ActionTrackerPlugin::Options; 
     6use Foswiki::Plugins::ActionTrackerPlugin::Action; 
     7use Foswiki::Plugins::ActionTrackerPlugin::ActionSet; 
     8use Foswiki::Plugins::ActionTrackerPlugin::ActionNotify; 
     9use Foswiki::Plugins::ActionTrackerPlugin::Format; 
     10use Foswiki::Plugins::ActionTrackerPlugin::Options; 
    1111use Time::ParseDate; 
    12 use TWiki::Attrs; 
    13 use TWiki::Store::RcsLite; 
     12use Foswiki::Attrs; 
     13use Foswiki::Store::RcsLite; 
    1414 
    1515sub new { 
     
    2222 
    2323    $this->SUPER::set_up(); 
    24     $TWiki::cfg{Plugins}{ActionTrackerPlugin}{Enabled} = 1; 
     24    $Foswiki::cfg{Plugins}{ActionTrackerPlugin}{Enabled} = 1; 
    2525 
    2626    # Use RcsLite so we can manually gen topic revs 
    27     $TWiki::cfg{StoreImpl} = 'RcsLite'; 
     27    $Foswiki::cfg{StoreImpl} = 'RcsLite'; 
    2828 
    2929    # Need this to get the actionnotify template 
     
    3131        my $d = "$lib/../templates"; 
    3232        if (-e "$d/actionnotify.tmpl") { 
    33             $TWiki::cfg{TemplateDir} = $d; 
     33            $Foswiki::cfg{TemplateDir} = $d; 
    3434            last; 
    3535        } 
    3636    } 
    3737 
    38     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     38    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    3939 
    4040    # Actor 1 - wikiname in main, not a member of any groups 
     
    8484                        'actor6@correct-address'); 
    8585 
    86     TWiki::Func::saveTopic($this->{users_web}, "TWikiFormGroup", undef, <<'HERE'); 
     86    Foswiki::Func::saveTopic($this->{users_web}, "TWikiFormGroup", undef, <<'HERE'); 
    8787Garbage 
    8888      * Set GROUP = ActorThree, ActorFour 
    8989More garbage 
    9090HERE 
    91     TWiki::Func::saveTopic($this->{users_web}, "WebNotify", undef, <<HERE); 
     91    Foswiki::Func::saveTopic($this->{users_web}, "WebNotify", undef, <<HERE); 
    9292Garbage 
    9393   * $this->{users_web}.ActorFive - actor5\@correct.address 
     
    9595   * $this->{users_web}.ActorSix 
    9696HERE 
    97     TWiki::Func::saveTopic($this->{test_web}, "WebNotify", undef, <<HERE 
     97    Foswiki::Func::saveTopic($this->{test_web}, "WebNotify", undef, <<HERE 
    9898   * $this->{users_web}.ActorEight - actor-8\@correct.address 
    9999HERE 
    100100                              ); 
    101     TWiki::Func::saveTopic($this->{users_web}, "EMailGroup", undef, <<'HERE'); 
    102    * Set GROUP = actorTwo@another-address.net,ActorFour 
    103 HERE 
    104  
    105     TWiki::Func::saveTopic($this->{test_web}, "Topic1", undef, <<'HERE'); 
     101    Foswiki::Func::saveTopic($this->{users_web}, "EMailGroup", undef, <<'HERE'); 
     102   * Set GROUP = ActorTwo,ActorFour 
     103HERE 
     104 
     105    Foswiki::Func::saveTopic($this->{test_web}, "Topic1", undef, <<'HERE'); 
    106106%ACTION{who="ActorOne,ActorTwo,ActorThree,ActorFour,ActorFive,ActorSix,ActorSeven,ActorEight" due="3 Jan 02" state=open}% A1: ontime 
    107107HERE 
    108     TWiki::Func::saveTopic($this->{test_web}, "Topic2", undef, <<'HERE'); 
     108    Foswiki::Func::saveTopic($this->{test_web}, "Topic2", undef, <<'HERE'); 
    109109%ACTION{who="ActorOne,ActorTwo,ActorThree,ActorFour,ActorFive,ActorSix,actor.7@seven.net,ActorEight" due="2 Jan 02" state=closed}% A2: closed 
    110110HERE 
    111     TWiki::Func::saveTopic($this->{users_web}, "Topic1", undef, <<'HERE'); 
     111    Foswiki::Func::saveTopic($this->{users_web}, "Topic1", undef, <<'HERE'); 
    112112%ACTION{who="ActorOne,ActorTwo,ActorThree,ActorFour,ActorFive,ActorSix,actor.7@seven.net,ActorEight,NonEntity",due="3 Jan 01",state=open}% A3: late 
    113113%ACTION{who=TWikiFormGroup,due="4 Jan 01",state=open}% A4: late  
    114114HERE 
    115     TWiki::Func::saveTopic($this->{users_web}, "Topic2", undef, <<'HERE'); 
     115    Foswiki::Func::saveTopic($this->{users_web}, "Topic2", undef, <<'HERE'); 
    116116%ACTION{who=EMailGroup,due="2001-01-05",state=open}% A5: late 
    117117%ACTION{who="ActorOne,ActorTwo,ActorThree,ActorFour,TWikiFormGroup,ActorFive,ActorSix,actor.7@seven.net,ActorEight,EMailGroup",due="6 Jan 99",open}% A6: late 
    118118HERE 
    119119 
    120     my $rcs = new TWiki::Store::RcsLite($this->{twiki}, $this->{test_web}, "ActionChanged" ); 
     120    my $rcs = new Foswiki::Store::RcsLite($this->{twiki}, $this->{test_web}, "ActionChanged" ); 
    121121    my $t1 = Time::ParseDate::parsedate("21 Jun 2001"); 
    122122    $rcs->addRevisionFromText(<<HERE, 'Initial revision', 'crawford', $t1); 
     
    153153       ); 
    154154    my $who = 
    155       TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress('a@b.c',\%ma); 
     155      Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress('a@b.c',\%ma); 
    156156    $this->assert_str_equals( 'a@b.c', $who); 
    157157 
    158158    $who = 
    159       TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("$this->{users_web}.BimboChimp",\%ma); 
     159      Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("$this->{users_web}.BimboChimp",\%ma); 
    160160    $this->assert_str_equals( 'bimbo@zoo.org', $who); 
    161161 
    162162    $who = 
    163       TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("BimboChimp",\%ma); 
     163      Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("BimboChimp",\%ma); 
    164164    $this->assert_str_equals( 'bimbo@zoo.org', $who); 
    165165 
    166166    $who = 
    167       TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("PaxoHen,BimboChimp , BonzoClown",\%ma); 
     167      Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("PaxoHen,BimboChimp , BonzoClown",\%ma); 
    168168    $this->assert_str_equals( 'chicken@farm.net,bimbo@zoo.org,bonzo@circus.com', $who); 
    169169 
    170     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorOne",\%ma); 
     170    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorOne",\%ma); 
    171171    $this->assert_str_equals( 'actor-1@an-address.net', $who); 
    172  
    173     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("EMailGroup",\%ma); 
    174     $this->assert_str_equals( "actorTwo\@another-address.net,actorfour\@yet-another-address.net", $who); 
    175     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("TWikiFormGroup",\%ma); 
    176     $this->assert_str_equals( "actor3\@yet-another-address.net,actorfour\@yet-another-address.net", $who); 
    177  
    178     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorFive",\%ma); 
     172    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("EMailGroup",\%ma); 
     173    $this->assert_str_equals( "actorTwo\@another-address.net,actorfour\@yet-another-address.net", join(',',sort split(/[, ]+/, $who))); 
     174    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("TWikiFormGroup",\%ma); 
     175    $this->assert_str_equals( "actor3\@yet-another-address.net,actorfour\@yet-another-address.net", join(',',sort split(/[, ]+/, $who))); 
     176 
     177    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorFive",\%ma); 
    179178    $this->assert_str_equals('actor5@example.com', $who); 
    180     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorEight",\%ma); 
     179    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorEight",\%ma); 
    181180    $this->assert_null($who); 
    182     TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_loadWebNotify($this->{users_web},\%ma); 
    183     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorFive",\%ma); 
     181    Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_loadWebNotify($this->{users_web},\%ma); 
     182    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorFive",\%ma); 
    184183    $this->assert_str_equals( "actor5\@example.com", $who); 
    185     TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_loadWebNotify($this->{test_web},\%ma); 
    186     $who = TWiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorEight",\%ma); 
     184    Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_loadWebNotify($this->{test_web},\%ma); 
     185    $who = Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::_getMailAddress("ActorEight",\%ma); 
    187186    $this->assert_str_equals( "actor-8\@correct.address", $who); 
    188187} 
     
    192191    my $html; 
    193192 
    194     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("2 Jan 2002"); 
    195     TWiki::Plugins::ActionTrackerPlugin::ActionNotify::doNotifications($this->{twiki}->{webName}, "web='($this->{test_web}|$this->{users_web})' late" ); 
     193    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("2 Jan 2002"); 
     194    Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::doNotifications($this->{twiki}->{webName}, "web='($this->{test_web}|$this->{users_web})' late" ); 
    196195    if(scalar(@FoswikiFnTestCase::mails!= 8)) { 
    197196        my $mess = scalar(@FoswikiFnTestCase::mails)." mails received"; 
     
    287286sub test_C_ChangedSince { 
    288287    my $this = shift; 
    289     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("2 Jan 2002"); 
    290     TWiki::Plugins::ActionTrackerPlugin::ActionNotify::doNotifications( 
     288    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("2 Jan 2002"); 
     289    Foswiki::Plugins::ActionTrackerPlugin::ActionNotify::doNotifications( 
    291290        $this->{twiki}->{webName}, 'changedsince="1 dec 2001" web="'.$this->{test_web}.'"' ); 
    292291    my $saw = ""; 
Note: See TracChangeset for help on using the changeset viewer.