sub start_app_server {
my($self) = @_;
+ return unless $self->{app_server_cmd};
my $child = Child->new(sub { exec($self->{app_server_cmd}) } );
$self->{app_server_proc} = $child->start;
}
sub stop_app_server {
my($self) = @_;
- $self->{app_server_proc}->kill("KILL");
+ if (my $proc = $self->{app_server_proc}) {
+ $proc->kill("KILL");
+ }
}
sub test_directory {
sub done {
my($self) = @_;
- if(exists $self->{selenium_rc}{xvnc_server_proc} and
- exists $self->{selenium_rc}{selenium_server_proc}) {
- $self->stop_selenium_server;
- }
+ $self->stop_selenium_server;
$self->stop_app_server;
}
+sub DESTROY { shift->done }
+
1;
__END__