Index: /trunk/Nebulous-Server/t/20_client_copy.t
===================================================================
--- /trunk/Nebulous-Server/t/20_client_copy.t	(revision 2878)
+++ /trunk/Nebulous-Server/t/20_client_copy.t	(revision 2878)
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 20_client_copy.t,v 1.1 2005-01-04 02:13:21 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 8;
+
+use lib qw( ./t ./lib );
+
+use PS::IPP::IData::Client;
+use PS::IPP::IData::Util qw( :standard );
+use Test::IData;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::IData->setup;
+
+{
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->create( "foo" );
+
+    ok( $idata->copy( "foo", "foobar" ), "copied object" );
+
+    my $locations1 = $idata->find_instances( "foobar" );
+    my $locations2 = $idata->find_instances( "foobar" );
+
+    is( scalar @$locations1, 1, "old object has an instances" );
+    is( scalar @$locations2, 1, "new object has an instances" );
+}
+
+Test::IData->setup;
+
+{
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+
+    ok( ! $idata->copy( "foo", "foobar" ), "copy non-existant object" );
+
+    my $locations = $idata->find_instances( "foobar" );
+
+    is( $locations, undef, "new object has no instances" );
+}
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy();
+};
+like( $@, qr/2 were expected/, "no params" );
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy( "foo" );
+};
+like( $@, qr/2 were expected/, "not enough params" );
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy( "foo", "bar", "baz" );
+};
+like( $@, qr/2 were expected/, "too many params" );
+
+Test::IData->cleanup;
Index: /trunk/Nebulous/t/20_client_copy.t
===================================================================
--- /trunk/Nebulous/t/20_client_copy.t	(revision 2878)
+++ /trunk/Nebulous/t/20_client_copy.t	(revision 2878)
@@ -0,0 +1,83 @@
+#!/usr/bin/perl
+
+# Copryight (C) 2004-2005  Joshua Hoblitt
+#
+# $Id: 20_client_copy.t,v 1.1 2005-01-04 02:13:21 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use Apache::Test qw( -withtestmore );
+
+plan tests => 8;
+
+use lib qw( ./t ./lib );
+
+use PS::IPP::IData::Client;
+use PS::IPP::IData::Util qw( :standard );
+use Test::IData;
+
+my $hostport = Apache::Test->config->{ 'hostport' };
+
+Test::IData->setup;
+
+{
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->create( "foo" );
+
+    ok( $idata->copy( "foo", "foobar" ), "copied object" );
+
+    my $locations1 = $idata->find_instances( "foobar" );
+    my $locations2 = $idata->find_instances( "foobar" );
+
+    is( scalar @$locations1, 1, "old object has an instances" );
+    is( scalar @$locations2, 1, "new object has an instances" );
+}
+
+Test::IData->setup;
+
+{
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+
+    ok( ! $idata->copy( "foo", "foobar" ), "copy non-existant object" );
+
+    my $locations = $idata->find_instances( "foobar" );
+
+    is( $locations, undef, "new object has no instances" );
+}
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy();
+};
+like( $@, qr/2 were expected/, "no params" );
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy( "foo" );
+};
+like( $@, qr/2 were expected/, "not enough params" );
+
+Test::IData->setup;
+
+eval {
+    my $idata = PS::IPP::IData::Client->new(
+        proxy => "http://$hostport/idata",
+    );
+    $idata->copy( "foo", "bar", "baz" );
+};
+like( $@, qr/2 were expected/, "too many params" );
+
+Test::IData->cleanup;
