Added test for transaction/2 once bug 818 is resolved.
This commit is contained in:
parent
33cbe20ffb
commit
2cd33e3b83
|
@ -21,6 +21,7 @@ all() ->
|
||||||
transaction_should_commit_on_success,
|
transaction_should_commit_on_success,
|
||||||
transaction_should_abort_on_exception,
|
transaction_should_abort_on_exception,
|
||||||
transaction_should_abort_on_user_abort,
|
transaction_should_abort_on_user_abort,
|
||||||
|
transaction_error_should_return_error,
|
||||||
update_should_save_value_if_successful,
|
update_should_save_value_if_successful,
|
||||||
update_should_accept_args_for_fun,
|
update_should_accept_args_for_fun,
|
||||||
port_should_tune_transaction_timeouts,
|
port_should_tune_transaction_timeouts,
|
||||||
|
@ -58,7 +59,6 @@ end_per_testcase(_TestCase, Config) ->
|
||||||
ok = bdberl:close(?config(db, Config)),
|
ok = bdberl:close(?config(db, Config)),
|
||||||
ok = bdberl:delete_database("api_test.db").
|
ok = bdberl:delete_database("api_test.db").
|
||||||
|
|
||||||
|
|
||||||
open_should_create_database_if_none_exists(Config) ->
|
open_should_create_database_if_none_exists(Config) ->
|
||||||
DbName = filename:join([?config(priv_dir, Config), "api_test.db"]),
|
DbName = filename:join([?config(priv_dir, Config), "api_test.db"]),
|
||||||
true = filelib:is_file(DbName).
|
true = filelib:is_file(DbName).
|
||||||
|
@ -120,6 +120,20 @@ transaction_should_abort_on_user_abort(Config) ->
|
||||||
{error, transaction_aborted} = bdberl:transaction(F),
|
{error, transaction_aborted} = bdberl:transaction(F),
|
||||||
not_found = bdberl:get(Db, mykey).
|
not_found = bdberl:get(Db, mykey).
|
||||||
|
|
||||||
|
transaction_error_should_return_error(Config) ->
|
||||||
|
{skip, waiting_on_bug_818}.
|
||||||
|
%% Db = ?config(db, Config),
|
||||||
|
%% F = fun() ->
|
||||||
|
%% bdberl:put(Db, mykey, should_not_see_this),
|
||||||
|
%% %% Explicitly kill the transaction so that when transaction/2
|
||||||
|
%% %% tries to commit it will fail
|
||||||
|
%% bdberl:txn_abort(),
|
||||||
|
%% %% Value to return
|
||||||
|
%% avalue
|
||||||
|
%% end,
|
||||||
|
%% %% This should fail as there is no transaction to commit
|
||||||
|
%% {error,{txn_commit,no_txn}} = bdberl:transaction(F).
|
||||||
|
|
||||||
update_should_save_value_if_successful(Config) ->
|
update_should_save_value_if_successful(Config) ->
|
||||||
Db = ?config(db, Config),
|
Db = ?config(db, Config),
|
||||||
ok = bdberl:put(Db, mykey, avalue),
|
ok = bdberl:put(Db, mykey, avalue),
|
||||||
|
|
Loading…
Reference in a new issue