r $td;
$mt->run_modulemaker_and_chdir;
is(system("$cwd/scripts/swit_init"), 0);
isnt(-f "conf/swit.yaml", undef);
isnt(-f "conf/seal.key", undef) or ASTU_Wait;
unlike(read_file("lib/TTT/UI/Index.pm")
d/startup_classes_test");
system("chmod a+rxw $td");
my $tree = YAML::LoadFile('conf/swit.yaml');
isnt($tree, undef);
$tree->{startup_classes} = [ 'TTT::SC' ];
$tree->{pages}->{"aga.html"} = { class
f $elog ? read_file($elog) : "");
unlike($res, qr/010_db/);
isnt(-f "A", undef) or ASTU_Wait($res . (-f $elog ? read_file($elog) : ""));
isnt(-f "D", undef);
my $alog = read_file('t/logs/access_log')
is(HTML::Tested::Seal->instance->decrypt($oldf), 12);
} else {
write_file('curf', $curf);
isnt(-f 'curf', undef);
}
});
package M;
use base 'WWW::Mechanize';
sub get {
Test::More::diag("MG
`$pros`;
is($?, 0) or ASTU_Wait($res);
isnt(-f 't/logs/nytprof', undef) or ASTU_Wait(read_file('t/conf/httpd.conf'));
my @outs = glob('t/logs/nytprof*');
isnt(@outs, 0);
my $dres = `nytprofhtml -f
= `$pros`;
is($?, 0) or ASTU_Wait($res);
isnt(-f 't/logs/nytprof', undef) or ASTU_Wait(read_file('t/conf/httpd.conf'));
@outs = glob('t/logs/nytprof*');
isnt(@outs, 0);
$dres = `nytprofhtml -f $out
;
ok(-f 'LICENSE');
Apache::SWIT::Subsystem::Maker->new->write_initial_files();
isnt(-f './t/001_load.t', undef);
isnt(-f './conf/startup.pl', undef);
my $res = `scripts/swit_app.pl add_ht_page BB`;
he::SWIT::Maker::Config->instance;
$tree->{pages}->{"index"}->{entry_points}->{r}->{foo} = 'boo';
isnt(delete $tree->{pages}->{bb}->{entry_points}, undef);
$tree->{pages}->{bb}->{handler} = 'some_hand
$res = join('', `perl Makefile.PL && make 2>&1`);
is($?, 0) or diag($res);
unlike($res, qr/950/);
isnt(-f 'blib/lib/TTT/InstallationContent.pm', undef);
sleep 1;
append_file("templates/index.tt", "<!
ok(-f 'lib/TTT/AnotherClass.pm');
my $res = `./scripts/swit_app.pl add_class AnotherClass 2>&1`;
isnt($?, 0);
like($res, qr/refusing/);
`./scripts/swit_app.pl add_ht_page TTT::SomePage`;
ok(-f 'lib/
('templates/somepage.tt', "bobo");
$res = `./scripts/swit_app.pl add_ht_page TTT::SomePage 2>&1`;
isnt($?, 0);
like(read_file('templates/somepage.tt'), qr/bobo/);
like(read_file('conf/swit.yaml'), qr/
TT/UI/AnotherPage.pm');
my $lines = `perl Makefile.PL && make install SITEPREFIX=$td/inst 2>&1`;
isnt($?, 0) or ASTU_Wait($lines);
like($lines, qr/APACHE_SWIT_DB_NAME/);
ok(-f "t/conf/schema.sql");
_files();
is(-f './lib/TTT/DB/Connection.pm', undef);
is(-f './t/T/TTT/DB/Connection.pm', undef);
isnt(-f './t/001_load.t', undef);
is(-f 'lib/TTT/DB/Base.pm', undef);
is(read_file('lib/TTT.pm'), $ttt
;
is(-d "$td/inst/share/ttt", undef) or do {
# diag($res);
# diag("$td");
#readline(\*STDIN);
};
isnt(-d "$td/inst/share/perl", undef) or do {
## diag($res);
# diag("$td");
#readline(\*STDIN);
};
ok
');
eval "use lib 'lib'";
is(-f 'lib/MU/TheSub.pm', undef);
use_ok('HTML::Tested', qw(HT HTV));
isnt(-f "t/dual/thesub/001_load.t", undef) or ASTU_Wait($td);
my $s001 = read_file("t/dual/thesub/001_
wmv = "./scripts/swit_app.pl mv";
$res = `$swmv lib/TTT/UI/TheTable lib/TTT/UI/TheTable/T 2>&1`;
isnt($?, 0) or diag($res);
like($res, qr/Rolled back/);
is(dist_md5(), $md5) or diag($res);
is_deeply(
'../TTT' ]);
$res = `./scripts/swit_app.pl add_ht_page TheTable 2>&1`;
is($?, 0) or diag($res);
isnt(-f 'lib/TTT/UI/TheTable.pm', undef) or ASTU_Wait($mt->root_dir);
ok(-f 'templates/thetable.tt');
/TTT/UI/TheTable.pm lib/TTT/UI/TheTable/D.pm 2>&1`;
is($?, 0) or diag($res);
isnt(-f 'templates/thetable/d.tt', undef);
isnt(-f 'lib/TTT/UI/TheTable/D.pm', undef);
my $dpm = read_file('lib/TTT/UI/The
it/r#);
like($t->mech->content, qr/hello world/);
is(-f '/tmp/swit_worker.res', undef);
sleep 2;
isnt(-f '/tmp/swit_worker.res', undef);
my $rfstr = read_file('/tmp/swit_worker.res');
like($rfstr, q
> 'Apache::SWIT::Session' });
# in direct work is done synchroniously
$t->work_r(make_url => 1);
isnt(-f '/tmp/swit_worker.res', undef);
$rfstr = read_file('/tmp/swit_worker.res');
like($rfstr, qr/hi
unlink('/tmp/swit_worker.res');
# and check that it works for update
$t->work_u(make_url => 1);
isnt(-f '/tmp/swit_worker.res', undef);
$rfstr = read_file('/tmp/swit_worker.res');
like($rfstr, qr/wo
old one_col_table 2>&1`;
is(@res, 0) or diag(join('', @res));
ok(-f 'lib/TTT/DB/OneColTable.pm');
isnt(-f 't/dual/021_one_col_table.t', undef) or do {
diag($mt->root_dir);
# readline(\*STDIN);
};
$
fo_r)/die;$1/;
write_file('t/dual/002_the_table_error.t', $tstr);
$res = `make test_direct 2>&1`;
isnt($?, 0) or ASTU_Wait($res);
like($res, qr/011_the_table.+ok/) or ASTU_Wait;
append_file('t/dual/0
->ht_thetable_form_u(ht => { col1 => '99', col2 => '99' });
ENDS
$res = `make test_apache 2>&1`;
isnt($?, 0) or ASTU_Wait($res);
my $elog = read_file('t/logs/error_log');
like($res, qr/011_the_table
is($t->redirect_request, undef);
$t->ht_ht_error_u(ht => { name => "bad", password => "hru" });
isnt($t->redirect_request, undef);
is($t->redirect_request->param("error"), "validie");
is($t->redirec
ru" });
isnt($t->redirect_request, undef);
$t->ok_follow_link(text => 'doesnt matter');
is($t->redirect_request, undef);
$t->ht_ht_error_u(ht => { name => "FORBID", password => "hru" });
isnt($t->re
k('T::Test'); }
my $t = T::Test->new;
$t->reset_db;
my $a = TTT::DB::C->create({ a => 'ccc' });
isnt($a, undef);
ok(TTT::DB::C->search(a => 'ccc'));
conv_silent_system("psql -d $ENV{APACHE_SWIT_DB_N
C->create({ a => 'ccc' });
isnt($b, undef);
is($a->id, $b->id);
chdir('/');
$t->reset_db;
ok(!TTT::DB::C->search(a => 'ccc'));
$b = TTT::DB::C->create({ a => 'ccc' });
isnt($b, undef);
is($a->id, $b-
s = `./scripts/swit_app.pl hdhdhd 2>&1`;
isnt($?, 0) or ASTU_Wait($res);
$res = `./scripts/swit_app.pl freeze_schema 2>&1`;
is($?, 0) or ASTU_Wait($res);
isnt(-f 'conf/frozen.sql', undef);
like(read_
M
$res = `make test 2>&1`;
is($?, 0) or ASTU_Wait($res);
append_file("t/mig/db.sql", "boom\n");
$res = `make test_mig 2>&1`;
isnt($?, 0) or ASTU_Wait($res);
like($res, qr/Unable to do/);
chdir '/';
akefile.PL 2>&1 && make install SITEPREFIX=$td/inst 2>&1`;
is($?, 0) or diag($res);
isnt(-d "$td/inst/share/perl", undef) or diag($res);
isnt(-f "$td/inst/bin/swit_init", undef) or ASTU_Wait("$td");
ge main;
my $rc1 = Foo->ht_make_root_class;
isnt($rc1->can('ht_add_widget'), undef);
my $rc2 = Foo->ht_make_root_class('Apache::SWIT::Test::Request');
isnt($rc2->can('ht_add_widget'), undef);
eval {
$res = `perl Makefile.PL 2>&1`;
$res = $mt->run_make_install;
is(-d "$td/inst/share/ttt", undef);
isnt(-d "$td/inst/share/perl", undef);
chdir $td;
is(Apache::SWIT::Maker::Config->instance->app_name
m('TheSub');
is(-f 'lib/MU/TheSub.pm', undef);
$res = `./scripts/swit_app.pl override P89 2>&1`;
isnt($?, 0);
like($res, qr/Unable/);
like($res, qr/P89/);
$res = `./scripts/swit_app.pl override P1`;
t_direct 2>&1`;
isnt($?, 0) or ASTU_Wait($res);
like($res, qr/VAR1.*first/ms);
like($res, qr/Failed at.*001_load.t line 47.*001_load.t line 47/ms);
$res = `make test_apache 2>&1`;
isnt($?, 0) or ASTU
.pl 2>&1`;
isnt($?, 0) or diag($res);
like($res, qr/\bmv\b/);
like($res, qr/\bscaffold\b.*generates/);
like($res, qr/\brun_server\b/);
my $hlp_res = `./scripts/swit_app.pl help 2>&1`;
isnt($?, 0);
is
_infdef, 'defme_foooooo');
$s->write_stash;
isnt($s->session_value, undef);
unlike($s->session_value, qr/[^\w]/);
eval { thaw($s->session_value); };
isnt($@, '');
my $s2 = MySession->new(session_va
this way.
$t->ht_another_page_u(param => { file => "$td/fff" }
, ht => { up => "$td/up.txt" });
isnt(-f "$td/fff", undef);
$ENV{SWIT_HAS_APACHE} = 1;
$t = T::Test->new({ session_class => 'Apache::S
ga' });
@x = $t->ht_another_page_r(base_url => '/test/ht_page/r'
, ht => { hello => 'life' });
isnt($x[0], undef);
is(read_file("$td/up.txt"), "Hello\nworld\n");
is(unlink("$td/uuu"), 0);
# give
fo/r?the_tab_id=%s'
, cdbi_bind => [ col_a => 'Primary' ]
, column_title => 'ColA'
, 0 => { isnt_sealed => 1 });
__PACKAGE__->ht_add_widget(::HTV."::Marked"
, 'col_b', cdbi_bind => ''
, co
->ht_upload_u(ht => { the_upload => '/etc/passwd' });
my ($enc_loid) = ($res[0] =~ /loid=(\w+)/);
isnt($enc_loid, undef) or exit 1;
my $loid = HTML::Tested::Seal->instance->decrypt($enc_loid);
cmp_ok