Doing simple tests... from the TEST

I want to write a very simple test, and have it contained in a single file (the test).

  class test_basic extends test_base ;
    `uvm_component_utils(test_basic);

    // ...

    virtual task run_phase( uvm_phase phase );
      phase.raise_objection(this, "Objection raised by test_base");

      begin
        txn_type txn;
        txn = txn_type::type_id::create("txn",,);
        
        // can't do this; it's just to illustrate my intent
        start_item (txn, -1, a_sqr);
        if(!txn.randomize() with {}) `uvm_error("RANDERR","Randomization error")
        finish_item(txn);
      end

      phase.drop_objection(this, "Objection raised by test_base");
    endtask

  endclass

Can I do trivial tests like this without creating a sequence?

In reply to bmorris:

Well I thought about deleting the post, but as soon as I posted it, I immediately dug into the sequencer class, and found it has a “execute_item” method:

“Executes the given transaction item directly on this sequencer. A temporary parent
sequence is automatically created for the item.” It worked fine.

      repeat (num) begin
        static udp_transaction txn;
        txn = udp_transaction::type_id::create("txn",,);
        if(!txn.randomize() with {}) `uvm_error("RANDERR","Randomization error")
        sqr_pack.udp_sqr.execute_item(txn);
      end

Anyway I’ll leave the post if anyone else has the same question. feel free to add any additional thoughts