[Rt-commit] r2265 - in rtfm/branches/2.1-TESTING: . inc/Module/Install/RTx lib/RT/FM t

jesse at bestpractical.com jesse at bestpractical.com
Sun Feb 27 19:02:20 EST 2005


Author: jesse
Date: Sun Feb 27 19:02:19 2005
New Revision: 2265

Modified:
   rtfm/branches/2.1-TESTING/   (props changed)
   rtfm/branches/2.1-TESTING/inc/Module/Install/RTx/Factory.pm
   rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
   rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm
   rtfm/branches/2.1-TESTING/t/00smoke.t
   rtfm/branches/2.1-TESTING/t/2basic_api.t
   rtfm/branches/2.1-TESTING/t/ArticleCollection_Overlay.pm.t
   rtfm/branches/2.1-TESTING/t/Article_Overlay.pm.t
Log:
 r6062 at hualien:  jesse | 2005-02-27 18:59:06 -0500
 Working toward test suite passing


Modified: rtfm/branches/2.1-TESTING/inc/Module/Install/RTx/Factory.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/inc/Module/Install/RTx/Factory.pm	(original)
+++ rtfm/branches/2.1-TESTING/inc/Module/Install/RTx/Factory.pm	Sun Feb 27 19:02:19 2005
@@ -29,6 +29,7 @@
         "--datadir"     => "etc",
         "--datafile"    => "etc/initialdata",
         "--dba"         => $RT::DatabaseUser,
+        "--prompt-for-dba-password" => ''
     );
     print "$^X @args\n";
     (system($^X, @args) == 0) or die "...returned with error: $?\n";

Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm	(original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Article_Overlay.pm	Sun Feb 27 19:02:19 2005
@@ -31,7 +31,7 @@
 
 # This object takes custom fields
 
-RT::CustomField->_ForObjectType( _LookupTypes() => 'RTFM Articles' );    #loc
+RT::CustomField->_ForObjectType( CustomFieldLookupType() => 'RTFM Articles' );    #loc
 
 # {{{ Create
 
@@ -515,7 +515,7 @@
 
 # }}}
 
-sub _LookupTypes {
+sub CustomFieldLookupType {
     "RT::FM::Class-RT::FM::Article";
 }
 

Modified: rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm
==============================================================================
--- rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm	(original)
+++ rtfm/branches/2.1-TESTING/lib/RT/FM/Class_Overlay.pm	Sun Feb 27 19:02:19 2005
@@ -191,7 +191,7 @@
     my $cfs = RT::CustomFields->new( $self->CurrentUser );
     if ( $self->CurrentUserHasRight('SeeClass') ) {
         $cfs->LimitToGlobalOrObjectId( $self->Id );
-        $cfs->LimitToLookupType( RT::FM::Article->_LookupTypes );
+        $cfs->LimitToLookupType( RT::FM::Article->CustomFieldLookupType );
     }
     return ($cfs);
 }

Modified: rtfm/branches/2.1-TESTING/t/00smoke.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/00smoke.t	(original)
+++ rtfm/branches/2.1-TESTING/t/00smoke.t	Sun Feb 27 19:02:19 2005
@@ -8,7 +8,7 @@
 ok(RT::Init, "Basic initialization and DB connectivity");
 
 use File::Find;
-File::Find::find({wanted => \&wanted}, '.');
-sub wanted { /^*\.pm\z/s && $_ !~ /Overlay/ && ok(require $_, "Requiring '$_'"); }
+File::Find::find({wanted => \&wanted}, 'lib');
+sub wanted { /^.*\.pm\z/s && $_ !~ /Overlay/ && ok(require $_, "Requiring '$_'"); }
 
 

Modified: rtfm/branches/2.1-TESTING/t/2basic_api.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/2basic_api.t	(original)
+++ rtfm/branches/2.1-TESTING/t/2basic_api.t	Sun Feb 27 19:02:19 2005
@@ -40,7 +40,7 @@
 
 ($id,$msg) = $cf->Create( Name => 'FM::Sample-'.$$,
              Description => 'Test text cf',
-             LookupType => RT::FM::Article->_LookupTypes,
+             LookupType => RT::FM::Article->CustomFieldLookupType,
              Type => 'Text'
              );
 

Modified: rtfm/branches/2.1-TESTING/t/ArticleCollection_Overlay.pm.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/ArticleCollection_Overlay.pm.t	(original)
+++ rtfm/branches/2.1-TESTING/t/ArticleCollection_Overlay.pm.t	Sun Feb 27 19:02:19 2005
@@ -20,7 +20,7 @@
 
  $arts2 =RT::FM::ArticleCollection->new($RT::SystemUser);
 $arts2->LimitSummary (VALUE => 'test');
-is($arts2->Count, 3, 'Found 3 artlcles with summaries matching the word "test"');
+is($arts2->Count, 3, 'Found 3 artlcles with summaries matching the word "test" (found '.$arts2->Count.')');
 
 
 my $new_art = RT::FM::Article->new($RT::SystemUser);

Modified: rtfm/branches/2.1-TESTING/t/Article_Overlay.pm.t
==============================================================================
--- rtfm/branches/2.1-TESTING/t/Article_Overlay.pm.t	(original)
+++ rtfm/branches/2.1-TESTING/t/Article_Overlay.pm.t	Sun Feb 27 19:02:19 2005
@@ -10,12 +10,14 @@
 use_ok(RT::FM::ArticleCollection);
 use_ok(RT::FM::Class);
 
+my $CLASS = 'ArticleTest-'.$$;
+
 my $user = RT::CurrentUser->new('root');
 
 my $class = RT::FM::Class->new($user);
 
 
-my ($id, $msg) = $class->Create(Name =>'ArticleTest');
+my ($id, $msg) = $class->Create(Name =>$CLASS);
 ok ($id, $msg);
 
 
@@ -27,10 +29,10 @@
 ok (UNIVERSAL::isa($article, 'DBIx::SearchBuilder::Record') , "It's a searchbuilder record!");
 
 
-($id, $msg) = $article->Create( Class => 'ArticleTest', Summary => "ArticleTest");
+($id, $msg) = $article->Create( Class => $CLASS, Summary => $CLASS);
 ok ($id, $msg);
 $article->Load($id);
-is ($article->Summary, 'ArticleTest', "The summary is set correct");
+is ($article->Summary, $CLASS, "The summary is set correct");
 my $at = RT::FM::Article->new($RT::SystemUser);
 $at->Load($id);
 is ($at->id , $id);
@@ -40,23 +42,23 @@
 
 
 my  $a1 = RT::FM::Article->new($RT::SystemUser);
- ($id, $msg)  = $a1->Create(Class => 1, Name => 'ValidateNameTest');
+ ($id, $msg)  = $a1->Create(Class => $class->id, Name => 'ValidateNameTest'.$$);
 ok ($id, $msg);
 
 
 
 my  $a2 = RT::FM::Article->new($RT::SystemUser);
-($id, $msg)  = $a2->Create(Class => 1, Name => 'ValidateNameTest');
+($id, $msg)  = $a2->Create(Class => $class->id, Name => 'ValidateNameTest'.$$);
 ok (!$id, $msg);
 
 my  $a3 = RT::FM::Article->new($RT::SystemUser);
-($id, $msg)  = $a3->Create(Class => 1, Name => 'ValidateNameTest2');
+($id, $msg)  = $a3->Create(Class => $class->id, Name => 'ValidateNameTest2'.$$);
 ok ($id, $msg);
-($id, $msg) =$a3->SetName('ValidateNameTest');
+($id, $msg) =$a3->SetName('ValidateNameTest'.$$);
 
 ok (!$id, $msg);
 
-($id, $msg) =$a3->SetName('ValidateNametest2');
+($id, $msg) =$a3->SetName('ValidateNametest2'.$$);
 
 ok ($id, $msg);
 
@@ -65,7 +67,7 @@
 
 
 my $newart = RT::FM::Article->new($RT::SystemUser);
-$newart->Create(Name => 'DeleteTest', Class => '1');
+$newart->Create(Name => 'DeleteTest'.$$, Class => '1');
 $id = $newart->Id;
 
 ok($id, "New article has an id");
@@ -82,15 +84,15 @@
 $a2->Load($id);
 ok (!$a2->Id, "Did not find the article");
 
-
-$RT::Handle->SimpleQuery("DELETE FROM Links");
+# NOT OK
+#$RT::Handle->SimpleQuery("DELETE FROM Links");
 
 my $article_a = RT::FM::Article->new($RT::SystemUser);
-($id, $msg) = $article_a->Create( Class => 'ArticleTest', Summary => "ArticleTestlink1");
+($id, $msg) = $article_a->Create( Class => $CLASS, Summary => "ArticleTestlink1".$$);
 ok($id,$msg);
 
 my $article_b = RT::FM::Article->new($RT::SystemUser);
-($id, $msg) = $article_b->Create( Class => 'ArticleTest', Summary => "ArticleTestlink2");
+($id, $msg) = $article_b->Create( Class => $CLASS, Summary => "ArticleTestlink2".$$);
 ok($id,$msg);
 
 # Create a link between two articles
@@ -196,7 +198,7 @@
 
 
 my $art = RT::FM::Article->new($RT::SystemUser);
-($id, $msg) = $art->Create (Class => 'ArticleTest');
+($id, $msg) = $art->Create (Class => $CLASS);
 ok ($id,$msg);
 
 ok($art->URI);
@@ -206,7 +208,7 @@
 
 
  $art = RT::FM::Article->new($RT::SystemUser);
-($id, $msg) = $art->Create (Class => 'ArticleTest');
+($id, $msg) = $art->Create (Class => $CLASS);
 ok ($id,$msg);
 
 ok($art->URIObj);


More information about the Rt-commit mailing list