User: sits    
  Date: 06/07/17 23:12:47

  Modified:    test     diffparsers.t usecompression.t
  Log:
  Final changes from Jason
  
  
  
  Index: diffparsers.t
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/test/diffparsers.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- diffparsers.t     24 Jan 2006 05:03:46 -0000      1.2
  +++ diffparsers.t     18 Jul 2006 06:12:47 -0000      1.3
  @@ -5,7 +5,7 @@
   use strict;
   use warnings;
   
  -use Test::More qw(no_plan);
  +use Test::More qw(no_plan);
   
   use CodestrikerTest::Config;
   use CodestrikerTest::MainPage;
  @@ -14,99 +14,99 @@
   use CodestrikerTest::Util;
   
   CodestrikerTest::Config::ProcessCommandLine();
  -
  -my $main = 
CodestrikerTest::PageFactory->CreatePage($CodestrikerTest::Config::main_url);
  -
  -my @filenames = <testtopictexts/*.txt>;
  -
  -foreach my $filename (@filenames)
  -{
  -    my $repo = 'Local CVS';
  -
  -    $filename =~ /\/([a-zA-Z]+)/;
  -
  -    my $repo_type = $1;
  -
  -    if ($repo_type eq "cvs")
  -    {
  -        $repo = 'Local CVS';
  -    } 
  -    elsif ($repo_type eq "perforce")
  -    {
  -        $repo = 'perforce:sits:[EMAIL PROTECTED]:1666';
  -    }
  -    elsif ($repo_type eq "clearcase")
  -    {
  -        $repo = 'clearcase:c:\\stuff\\view_name\\vob_name';
  -    }
  -    elsif ($repo_type eq "svn")
  -    {
  -        $repo = 'svn:http://svn.collab.net/repos/svn/trunk';
  -    }
  -    elsif ($repo_type eq "vss")
  -    {
  -        $repo = 'vss:c:\\Program Files\\Microsoft Visual 
Studio\\VSS;admin;password';
  -    }
  -
  -    print "# Creating topic for file $filename - $repo_type - $repo\n";
  -    
  -    my $topic_content = 
$main->MakeAndNavigateToNewTopic(topic_file=>$filename,repository=>$repo);
  -
  -    # clean it up.
  -    my $properties = $topic_content->GetLink('Topic Properties');
  -
  -    my @files = $topic_content->GetTopcFileInfo();
  -    my @bench_files = ();
  -    
  -    if ( -e "$filename.bench" )
  -    {
  -        open BENCH,"<$filename.bench" or die "$!";
  -
  -        my $index = 0;
  -        
  -        while ( <BENCH> )
  -        {
  -            chop;
  -            my ($sourcefilename,$version,$added,$removed) = split /\t/;
  -
  -            is( $sourcefilename,$files[$index]->{filename},
  -                "$filename $index - $sourcefilename == 
$files[$index]->{filename}" );
  -            is( $version,$files[$index]->{version}, 
  -                "$filename $index - $version == $files[$index]->{version}" );
  -            is( $added,$files[$index]->{added_lines},
  -                "$filename $index - $added == $files[$index]->{added_lines}" 
);
  -            is( $removed,$files[$index]->{removed_lines},
  -                "$filename $index - $removed == 
$files[$index]->{removed_lines}" );
  -
  -            ++$index;
  -        }
  -        
  -        close(BENCH);
  -    }
  -    else
  -    {
  -        print "# *** creating $filename.bench\n";
  -
  -        open BENCH,">$filename.bench" or die "$!";
  -
  -        my $index = 0;
  -        foreach my $file (@files)
  -        {
  -            print BENCH $files[$index]->{filename} . "\t" . 
  -                        $files[$index]->{version} . "\t" . 
  -                        $files[$index]->{added_lines} . "\t" . 
  -                        $files[$index]->{removed_lines} . "\n"; 
  -
  -            ++$index;
  -        }
  -
  -        close BENCH;
  -    }
  -
  -    ok( $properties->SetTopicProperties( topic_state=>'Deleted'),"change 
delete");
  -}
  -
  -
  +
  +my $main = 
CodestrikerTest::PageFactory->CreatePage($CodestrikerTest::Config::main_url);
  +
  +my @filenames = <testtopictexts/*.txt>;
  +
  +foreach my $filename (@filenames)
  +{
  +    my $repo = 'Local CVS';
  +
  +    $filename =~ /\/([a-zA-Z]+)/;
  +
  +    my $repo_type = $1;
  +
  +    if ($repo_type eq "cvs")
  +    {
  +        $repo = 'Local CVS';
  +    } 
  +    elsif ($repo_type eq "perforce")
  +    {
  +        $repo = 'perforce:[EMAIL PROTECTED]:1666';
  +    }
  +    elsif ($repo_type eq "clearcase")
  +    {
  +        $repo = 'clearcase:c:\\stuff\\view_name\\vob_name';
  +    }
  +    elsif ($repo_type eq "svn")
  +    {
  +        $repo = 'svn:http://svn.collab.net/repos/svn/trunk';
  +    }
  +    elsif ($repo_type eq "vss")
  +    {
  +        $repo = 'vss:c:\\Program Files\\Microsoft Visual 
Studio\\VSS;admin;password';
  +    }
  +
  +    print "# Creating topic for file $filename - $repo_type - $repo\n";
  +    
  +    my $topic_content = 
$main->MakeAndNavigateToNewTopic(topic_file=>$filename,repository=>$repo);
  +
  +    # clean it up.
  +    my $properties = $topic_content->GetLink('Topic Properties');
  +
  +    my @files = $topic_content->GetTopcFileInfo();
  +    my @bench_files = ();
  +    
  +    if ( -e "$filename.bench" )
  +    {
  +        open BENCH,"<$filename.bench" or die "$!";
  +
  +        my $index = 0;
  +        
  +        while ( <BENCH> )
  +        {
  +            chop;
  +            my ($sourcefilename,$version,$added,$removed) = split /\t/;
  +
  +            is( $sourcefilename,$files[$index]->{filename},
  +                "$filename $index - $sourcefilename == 
$files[$index]->{filename}" );
  +            is( $version,$files[$index]->{version}, 
  +                "$filename $index - $version == $files[$index]->{version}" );
  +            is( $added,$files[$index]->{added_lines},
  +                "$filename $index - $added == $files[$index]->{added_lines}" 
);
  +            is( $removed,$files[$index]->{removed_lines},
  +                "$filename $index - $removed == 
$files[$index]->{removed_lines}" );
  +
  +            ++$index;
  +        }
  +        
  +        close(BENCH);
  +    }
  +    else
  +    {
  +        print "# *** creating $filename.bench\n";
  +
  +        open BENCH,">$filename.bench" or die "$!";
  +
  +        my $index = 0;
  +        foreach my $file (@files)
  +        {
  +            print BENCH $files[$index]->{filename} . "\t" . 
  +                        $files[$index]->{version} . "\t" . 
  +                        $files[$index]->{added_lines} . "\t" . 
  +                        $files[$index]->{removed_lines} . "\n"; 
  +
  +            ++$index;
  +        }
  +
  +        close BENCH;
  +    }
  +
  +    ok( $properties->SetTopicProperties( topic_state=>'Deleted'),"change 
delete");
  +}
  +
  +
   
   
   0;
  
  
  
  
  
  Index: usecompression.t
  ===================================================================
  RCS file: /cvsroot/codestriker/codestriker/test/usecompression.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- usecompression.t  14 Dec 2004 21:39:46 -0000      1.1
  +++ usecompression.t  18 Jul 2006 06:12:47 -0000      1.2
  @@ -11,32 +11,32 @@
   use CodestrikerTest::Util;
   
   CodestrikerTest::Config::ProcessCommandLine();
  -
  -# make sure we can do this not compressed.
  -CodestrikerTest::Config::SetConfigOption(qq|\$use_compression = 0;|);
  -
  -my $main = 
CodestrikerTest::PageFactory->CreatePage($CodestrikerTest::Config::main_url);
  -
  -ok( $main->IsCompressed() == 0,"main not IsCompressed" );
  -
  -# now do the rest of the test compressed.
  -CodestrikerTest::Config::SetConfigOption(qq|\$use_compression = 1;|);
  -
  -my $commpressed_comment_tag = "Source was sent compressed.";
  +
  +# make sure we can do this not compressed.
  +CodestrikerTest::Config::SetConfigOption(qq|\$use_compression = 0;|);
  +
  +my $main = 
CodestrikerTest::PageFactory->CreatePage($CodestrikerTest::Config::main_url);
  +
  +ok( $main->IsCompressed() == 0,"main not IsCompressed" );
  +
  +# now do the rest of the test compressed.
  +CodestrikerTest::Config::SetConfigOption(qq|\$use_compression = 1;|);
  +
  +my $commpressed_comment_tag = "Source was sent compressed.";
   
   # create page with no params
   $main = 
CodestrikerTest::PageFactory->CreatePage($CodestrikerTest::Config::main_url);
  -
  -ok( $main->IsCompressed(),"main IsCompressed" );
  +
  +ok( $main->IsCompressed(),"main IsCompressed" );
   
   my $newTopic = $main->GetNewTopicPage();
   
   ok( $newTopic,"Verify new topic page" );
  -
  -ok( $newTopic->{response}->content =~ /$commpressed_comment_tag/ , "look 
$commpressed_comment_tag comment");
  -
  -my $confirmPage;
  -
  +
  +ok( $newTopic->{response}->content =~ /$commpressed_comment_tag/ , "look 
$commpressed_comment_tag comment");
  +
  +my $confirmPage;
  +
   my $titleName = MakeNewTopicName();
   
   $confirmPage = $newTopic->CreateNewTopic(
  @@ -47,15 +47,15 @@
       topic_file=>'newtopic.t');
   
   ok( $confirmPage->TopicCreated(),"create topic \"$titleName\"" );
  -
  -ok( $confirmPage->IsCompressed(),"confirmPage IsCompressed" );
  -
  -ok($main->Get(),"get main page");
  +
  +ok( $confirmPage->IsCompressed(),"confirmPage IsCompressed" );
  +
  +ok($main->Get(),"get main page");
       
  -ok( my $topic_content = $main->GetLink($titleName),"get link 
\"$titleName\"");
  -
  -ok( $topic_content->IsCompressed(),"IsCompressed" );
  -
  +ok( my $topic_content = $main->GetLink($titleName),"get link 
\"$titleName\"");
  +
  +ok( $topic_content->IsCompressed(),"IsCompressed" );
  +
   
   0;
   
  
  
  

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits

Reply via email to