ADD: more tests
This commit is contained in:
parent
d7fb6dc7a4
commit
aee624bbc0
@ -29,7 +29,6 @@ sub init {
|
|||||||
$self->createQuery();
|
$self->createQuery();
|
||||||
|
|
||||||
$self->createDSN();
|
$self->createDSN();
|
||||||
$self->tryToConnect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub createDSN
|
sub createDSN
|
||||||
@ -85,27 +84,6 @@ sub createQuery
|
|||||||
$self->log(LOGDEBUG, "created query " . $self->{sqlquery});
|
$self->log(LOGDEBUG, "created query " . $self->{sqlquery});
|
||||||
}
|
}
|
||||||
|
|
||||||
sub tryToConnect
|
|
||||||
{
|
|
||||||
my $self = shift;
|
|
||||||
|
|
||||||
my $dsn = $self->{dsn};
|
|
||||||
my $user = $self->{user};
|
|
||||||
my $pass = $self->{pass};
|
|
||||||
|
|
||||||
$self->log(LOGDEBUG, "DSN try:" . $dsn);
|
|
||||||
|
|
||||||
my $dbh = DBI->connect($dsn, $user , $pass );
|
|
||||||
|
|
||||||
if ($dbh->err())
|
|
||||||
{
|
|
||||||
$self->log(LOGERROR, "error connecting to DB: " . $dbh->errstr());
|
|
||||||
return DECLINED;
|
|
||||||
}
|
|
||||||
|
|
||||||
$dbh->disconnect;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub prepareParams
|
sub prepareParams
|
||||||
{
|
{
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
Loading…
Reference in New Issue
Block a user