[vuser] r585 committed - - Create new GroupEntry object....

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 3, 2009, 12:36:02 AM12/3/09
to vuser-...@googlegroups.com
Revision: 585
Author: perlstalker
Date: Wed Dec 2 21:35:45 2009
Log: - Create new GroupEntry object.
- Move long test question to the start of the tests so the variable
can be used by multiple tests.

http://code.google.com/p/vuser/source/detail?r=585

Added:
/VUser-Google-ProvisioningAPI/trunk/lib/VUser/Google/Groups/GroupEntry.pm
Modified:
/VUser-Google-ProvisioningAPI/trunk/lib/VUser/Google/Groups/V2_0.pm

/VUser-Google-ProvisioningAPI/trunk/t/tests/Test/VUser/Google/Provisioning/V2_0.pm

=======================================
--- /dev/null
+++
/VUser-Google-ProvisioningAPI/trunk/lib/VUser/Google/Groups/GroupEntry.pm
Wed Dec 2 21:35:45 2009
@@ -0,0 +1,30 @@
+package VUser::Google::Groups::GroupEntry;
+use warnings;
+use strict;
+
+our $VERSION = '0.2.0';
+
+use Moose;
+
+has 'GroupId' => (is => 'rw', isa => 'Str');
+has 'GroupName' => (is => 'rw', isa => 'Str');
+has 'Description' => (is => 'rw', isa => 'Str');
+has 'emailPermission' => (is => 'rw', isa => 'Str');
+
+sub as_hash {
+ my $self = shift;
+
+ my %hash = (
+ groupId => $self->GroupId,
+ groupName => $self->GroupName,
+ description => $self->Description,
+ emailPermission => $self->EmailPermission,
+ );
+
+ return %hash;
+}
+
+no Moose;
+__PACKAGE__->meta->make_immutable;
+
+1;
=======================================
--- /VUser-Google-ProvisioningAPI/trunk/lib/VUser/Google/Groups/V2_0.pm Tue
Nov 17 23:17:24 2009
+++ /VUser-Google-ProvisioningAPI/trunk/lib/VUser/Google/Groups/V2_0.pm Wed
Dec 2 21:35:45 2009
@@ -11,6 +11,17 @@

#### Methods ####
sub CreateGroup {
+ my $self = shift;
+ my %options = ();
+
+ if (ref $_[0]
+ and $_[0]->isa('VUser::Google::Groups::GroupEntry')) {
+ %options = $_[0]->as_hash;
+ }
+ else {
+ %options = @_;
+ }
+
}

sub UpdateGroup {
=======================================
---
/VUser-Google-ProvisioningAPI/trunk/t/tests/Test/VUser/Google/Provisioning/V2_0.pm
Wed Dec 2 20:57:26 2009
+++
/VUser-Google-ProvisioningAPI/trunk/t/tests/Test/VUser/Google/Provisioning/V2_0.pm
Wed Dec 2 21:35:45 2009
@@ -5,6 +5,8 @@
use Test::Most;
use base 'Test::VUser::Google::Provisioning';

+use vars qw($SKIP_LONG_TESTS);
+
sub CreateUser : Tests(12) {
my $test = shift;
my $class = $test->class;
@@ -71,11 +73,9 @@
my $num_users = 110;

SKIP: {
- print STDERR "\nRetrieve tests require that $num_users test users be
created and deleted.\n";
- print STDERR "These tests can take a long time.\n";
- print STDERR "Would you like to skip these tests? [y/N]: ";
- my $response = <STDIN>;
- skip "Skipping long tests at user request.", 3 if $response =~ /^y/i;
+ if ($Test::VUser::Google::SKIP_LONG_TESTS) {
+ skip "Skipping long tests at user request.", 3;
+ }

## Create 110 test users
note "Creating $num_users test users. This will take a while.";
Reply all
Reply to author
Forward
0 new messages