Skip to content

Commit

Permalink
add ut
Browse files Browse the repository at this point in the history
Signed-off-by: lixianhai <lixianhai.lxh@alibaba-inc.com>
  • Loading branch information
smartlxh authored and lixianhai committed Nov 13, 2023
1 parent 6febfd7 commit 9243322
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.starrocks.qe.ConnectContext;
import com.starrocks.qe.DDLStmtExecutor;
import com.starrocks.qe.GlobalVariable;
import com.starrocks.qe.SessionVariable;
import com.starrocks.server.GlobalStateMgr;
import com.starrocks.sql.ast.AddPartitionClause;
import com.starrocks.sql.ast.DropTableStmt;
Expand All @@ -55,6 +56,8 @@
import com.starrocks.thrift.TImmutablePartitionResult;
import com.starrocks.thrift.TListMaterializedViewStatusResult;
import com.starrocks.thrift.TListTableStatusResult;
import com.starrocks.thrift.TLoadTxnBeginRequest;
import com.starrocks.thrift.TLoadTxnBeginResult;
import com.starrocks.thrift.TLoadTxnCommitRequest;
import com.starrocks.thrift.TLoadTxnCommitResult;
import com.starrocks.thrift.TResourceUsage;
Expand Down Expand Up @@ -383,6 +386,27 @@ public void testCreatePartitionApi() throws TException {
Assert.assertEquals(1, partition.partitions.size());
}

@Test
public void testLoadTxnBegin() throws Exception {
FrontendServiceImpl impl = new FrontendServiceImpl(exeEnv);
TLoadTxnBeginRequest request = new TLoadTxnBeginRequest();
request.setLabel("test_label");
request.setDb("test");
request.setTbl("site_access_auto");
request.setUser("root");
request.setPasswd("");

new MockUp<SessionVariable>() {
@Mock
public boolean isEnableLoadProfile() {
return true;
}
};

TLoadTxnBeginResult result = impl.loadTxnBegin(request);
Assert.assertEquals(result.getStatus().getStatus_code(), TStatusCode.OK);
}

@Test
public void testCreatePartitionApiSlice() throws TException {
Database db = GlobalStateMgr.getCurrentState().getDb("test");
Expand Down

0 comments on commit 9243322

Please sign in to comment.