未验证 提交 072d15a8 编写于 作者: B Beyyes 提交者: GitHub

Fix more corner cases to improve code coverage, fix sonar code smells

上级 dc68e6bc
......@@ -65,10 +65,6 @@ public abstract class AbstractFragInsStateTracker implements IFragInstanceStateT
this.localhostInternalPort = IoTDBDescriptor.getInstance().getConfig().getInternalPort();
}
public abstract void start();
public abstract void abort();
protected FragmentInstanceInfo fetchInstanceInfo(FragmentInstance instance)
throws ClientManagerException, TException {
TEndPoint endPoint = instance.getHostDataNode().internalEndPoint;
......
......@@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.iotdb.db.queryengine.plan.scheduler;
import org.apache.iotdb.commons.service.metric.PerformanceOverviewMetrics;
......
......@@ -23,9 +23,7 @@ import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.commons.client.IClientManager;
import org.apache.iotdb.commons.client.async.AsyncDataNodeInternalServiceClient;
import org.apache.iotdb.commons.client.sync.SyncDataNodeInternalServiceClient;
import org.apache.iotdb.db.queryengine.common.FragmentInstanceId;
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
import org.apache.iotdb.db.queryengine.common.PlanFragmentId;
import org.apache.iotdb.db.queryengine.execution.QueryStateMachine;
import org.apache.iotdb.db.queryengine.execution.fragment.FragmentInfo;
import org.apache.iotdb.db.queryengine.metric.QueryExecutionMetricSet;
......@@ -177,16 +175,4 @@ public class ClusterScheduler implements IScheduler {
public FragmentInfo getFragmentInfo() {
return null;
}
@Override
public void abortFragmentInstance(FragmentInstanceId instanceId, Throwable failureCause) {}
@Override
public void cancelFragment(PlanFragmentId planFragmentId) {}
// Send the instances to other nodes
private void sendFragmentInstances() {}
// After sending, start to collect the states of these fragment instances
private void startMonitorInstances() {}
}
......@@ -81,6 +81,10 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
private static final PerformanceOverviewMetrics PERFORMANCE_OVERVIEW_METRICS =
PerformanceOverviewMetrics.getInstance();
private static final String DISPATCH_FAILED = "[DispatchFailed]";
private static final String UNEXPECTED_ERRORS = "Unexpected errors: ";
public FragmentInstanceDispatcherImpl(
QueryType type,
MPPQueryContext queryContext,
......@@ -119,11 +123,11 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
} catch (FragmentInstanceDispatchException e) {
return immediateFuture(new FragInstanceDispatchResult(e.getFailureStatus()));
} catch (Throwable t) {
logger.warn("[DispatchFailed]", t);
logger.warn(DISPATCH_FAILED, t);
return immediateFuture(
new FragInstanceDispatchResult(
RpcUtils.getStatus(
TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage())));
TSStatusCode.INTERNAL_SERVER_ERROR, UNEXPECTED_ERRORS + t.getMessage())));
} finally {
QUERY_EXECUTION_METRIC_SET.recordExecutionCost(
DISPATCH_READ, System.nanoTime() - startTime);
......@@ -149,10 +153,10 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
}
}
} catch (Throwable t) {
logger.warn("[DispatchFailed]", t);
logger.warn(DISPATCH_FAILED, t);
failureStatusList.add(
RpcUtils.getStatus(
TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage()));
TSStatusCode.INTERNAL_SERVER_ERROR, UNEXPECTED_ERRORS + t.getMessage()));
}
}
if (failureStatusList.isEmpty()) {
......@@ -194,10 +198,10 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
} catch (FragmentInstanceDispatchException e) {
dataNodeFailureList.add(e.getFailureStatus());
} catch (Throwable t) {
logger.warn("[DispatchFailed]", t);
logger.warn(DISPATCH_FAILED, t);
dataNodeFailureList.add(
RpcUtils.getStatus(
TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage()));
TSStatusCode.INTERNAL_SERVER_ERROR, UNEXPECTED_ERRORS + t.getMessage()));
}
}
PERFORMANCE_OVERVIEW_METRICS.recordScheduleLocalCost(
......
......@@ -18,8 +18,6 @@
*/
package org.apache.iotdb.db.queryengine.plan.scheduler;
import org.apache.iotdb.db.queryengine.common.FragmentInstanceId;
import org.apache.iotdb.db.queryengine.common.PlanFragmentId;
import org.apache.iotdb.db.queryengine.execution.fragment.FragmentInfo;
import io.airlift.units.Duration;
......@@ -33,8 +31,4 @@ public interface IScheduler {
Duration getTotalCpuTime();
FragmentInfo getFragmentInfo();
void abortFragmentInstance(FragmentInstanceId instanceId, Throwable failureCause);
void cancelFragment(PlanFragmentId planFragmentId);
}
......@@ -69,6 +69,8 @@ public class LoadTsFileDispatcherImpl implements IFragInstanceDispatcher {
internalServiceClientManager;
private final ExecutorService executor;
private static final String NODE_CONNECTION_ERROR = "can't connect to node {}";
public LoadTsFileDispatcherImpl(
IClientManager<TEndPoint, SyncDataNodeInternalServiceClient> internalServiceClientManager) {
this.internalServiceClientManager = internalServiceClientManager;
......
......@@ -32,7 +32,6 @@ import org.apache.iotdb.commons.partition.StorageExecutor;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.mpp.FragmentInstanceDispatchException;
import org.apache.iotdb.db.queryengine.common.FragmentInstanceId;
import org.apache.iotdb.db.queryengine.common.MPPQueryContext;
import org.apache.iotdb.db.queryengine.common.PlanFragmentId;
import org.apache.iotdb.db.queryengine.execution.QueryStateMachine;
......@@ -354,16 +353,6 @@ public class LoadTsFileScheduler implements IScheduler {
return null;
}
@Override
public void abortFragmentInstance(FragmentInstanceId instanceId, Throwable failureCause) {
// Do nothing
}
@Override
public void cancelFragment(PlanFragmentId planFragmentId) {
// Do nothing
}
public enum LoadCommand {
EXECUTE,
ROLLBACK
......
......@@ -333,10 +333,6 @@ public class QueryStatement extends Statement {
return resultSetFormat == ResultSetFormat.ALIGN_BY_DEVICE;
}
public boolean disableAlign() {
return resultSetFormat == ResultSetFormat.DISABLE_ALIGN;
}
public boolean isOrderByTime() {
return orderByComponent != null && orderByComponent.isOrderByTime();
}
......@@ -474,9 +470,6 @@ public class QueryStatement extends Statement {
public void semanticCheck() {
if (isAggregationQuery()) {
if (disableAlign()) {
throw new SemanticException("AGGREGATION doesn't support disable align clause.");
}
if (groupByComponent != null && isGroupByLevel()) {
throw new SemanticException("GROUP BY CLAUSES doesn't support GROUP BY LEVEL now.");
}
......@@ -600,9 +593,6 @@ public class QueryStatement extends Statement {
if (isAlignByDevice()) {
throw new SemanticException("Last query doesn't support align by device.");
}
if (disableAlign()) {
throw new SemanticException("Disable align cannot be applied to LAST query.");
}
for (ResultColumn resultColumn : selectComponent.getResultColumns()) {
Expression expression = resultColumn.getExpression();
if (!(expression instanceof TimeSeriesOperand)) {
......@@ -635,9 +625,6 @@ public class QueryStatement extends Statement {
if (getSeriesOffset() > 0) {
throw new SemanticException("select into: soffset clauses are not supported.");
}
if (disableAlign()) {
throw new SemanticException("select into: disable align clauses are not supported.");
}
if (isLastQuery()) {
throw new SemanticException("select into: last clauses are not supported.");
}
......
......@@ -32,28 +32,35 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class StatementGeneratorTest {
@Test
public void testRawDataQuery() {
List<String> selectExprList = Arrays.asList("s1", "s2");
List<String> prefixPaths = Collections.singletonList("root.sg1.d1");
public void rawDataQueryTest() {
String sql = "SELECT s1, s2 FROM root.sg1.d1 WHERE time > 1 and s3 > 2 LIMIT 10 OFFSET 11";
checkQueryStatement(
"SELECT s1, s2 FROM root.sg1.d1 LIMIT 10 OFFSET 10", selectExprList, prefixPaths, 10, 10);
sql,
Arrays.asList("s1", "s2"),
Collections.singletonList("root.sg1.d1"),
"Time > 1 & s3 > 2",
10,
11);
}
@Test
public void testGroupByTagWithDuplicatedKeys() {
public void groupByTagWithDuplicatedKeysTest() {
try {
checkQueryStatement(
"SELECT avg(*) FROM root.sg.** GROUP BY TAGS(k1, k2, k1)",
Collections.emptyList(),
Collections.emptyList(),
"",
10,
10);
Assert.fail();
} catch (SemanticException e) {
Assert.assertEquals("duplicated key in GROUP BY TAGS: k1", e.getMessage());
assertEquals("duplicated key in GROUP BY TAGS: k1", e.getMessage());
}
}
......@@ -62,7 +69,8 @@ public class StatementGeneratorTest {
private void checkQueryStatement(
String sql,
List<String> selectExprList,
List<String> prefixPaths,
List<String> fromPrefixPaths,
String wherePredicateString,
int rowLimit,
int rowOffset) {
QueryStatement statement =
......@@ -72,20 +80,24 @@ public class StatementGeneratorTest {
int cnt = 0;
for (ResultColumn resultColumn : statement.getSelectComponent().getResultColumns()) {
String selectExpr = resultColumn.getExpression().toString();
Assert.assertEquals(selectExprList.get(cnt++), selectExpr);
assertEquals(selectExprList.get(cnt++), selectExpr);
}
Assert.assertEquals(selectExprList.size(), cnt);
assertEquals(selectExprList.size(), statement.getSelectComponent().getResultColumns().size());
// check FROM clause
cnt = 0;
for (PartialPath path : statement.getFromComponent().getPrefixPaths()) {
Assert.assertEquals(prefixPaths.get(cnt++), path.toString());
assertEquals(fromPrefixPaths.get(cnt++), path.toString());
}
Assert.assertEquals(prefixPaths.size(), cnt);
assertEquals(fromPrefixPaths.size(), statement.getFromComponent().getPrefixPaths().size());
// check WHERE clause
assertEquals(
wherePredicateString, statement.getWhereCondition().getPredicate().getExpressionString());
// check LIMIT & OFFSET clause
Assert.assertEquals(rowLimit, statement.getRowLimit());
Assert.assertEquals(rowOffset, statement.getRowOffset());
assertEquals(rowLimit, statement.getRowLimit());
assertEquals(rowOffset, statement.getRowOffset());
// TODO: add more clause
}
......
......@@ -135,10 +135,11 @@ public class QueryStatementTest {
checkErrorQuerySql(errorSql);
} catch (SemanticException e) {
assertEquals(errorMsg, e.getMessage());
continue;
} catch (Exception ex) {
logger.error("Meets error in test sql: {}", errorSql, ex);
fail();
fail(String.format("Meets exception %s in test sql: `%s`", errorMsg, errorSql));
}
fail(String.format("Sql: `%s` must throw exception: %s", errorSql, errorMsg));
}
}
......
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.iotdb.db.utils;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.db.exception.StorageGroupNotReadyException;
import org.apache.iotdb.db.exception.metadata.PathNotExistException;
import org.apache.iotdb.db.exception.query.QueryProcessException;
import org.apache.iotdb.db.exception.sql.SemanticException;
import org.apache.iotdb.db.protocol.thrift.OperationType;
import org.apache.iotdb.rpc.TSStatusCode;
import org.junit.Test;
import java.io.IOException;
import static org.apache.iotdb.db.utils.ErrorHandlingUtils.onIoTDBException;
import static org.apache.iotdb.db.utils.ErrorHandlingUtils.onNonQueryException;
import static org.apache.iotdb.db.utils.ErrorHandlingUtils.onNpeOrUnexpectedException;
import static org.apache.iotdb.db.utils.ErrorHandlingUtils.onQueryException;
import static org.junit.Assert.assertEquals;
public class ErrorHandlingUtilsTest {
@Test
public void onNpeOrUnexpectedExceptionTest() {
TSStatus status =
onNpeOrUnexpectedException(
new IOException("test-IOException"),
OperationType.EXECUTE_STATEMENT,
TSStatusCode.EXECUTE_STATEMENT_ERROR);
assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(), status.getCode());
status =
onNpeOrUnexpectedException(
new NullPointerException("test-NullPointerException"),
OperationType.EXECUTE_STATEMENT,
TSStatusCode.EXECUTE_STATEMENT_ERROR);
assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(), status.getCode());
status =
onNpeOrUnexpectedException(
new RuntimeException("test-RuntimeException"),
OperationType.EXECUTE_STATEMENT,
TSStatusCode.EXECUTE_STATEMENT_ERROR);
assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(), status.getCode());
}
@Test
public void onQueryExceptionTest() {
TSStatus status =
onQueryException(
new StorageGroupNotReadyException("test-StorageGroupNotReadyException", 0),
OperationType.EXECUTE_STATEMENT);
assertEquals(TSStatusCode.STORAGE_ENGINE_NOT_READY.getStatusCode(), status.getCode());
status =
onQueryException(
new SemanticException("test-SemanticException"), OperationType.EXECUTE_STATEMENT);
assertEquals(TSStatusCode.SEMANTIC_ERROR.getStatusCode(), status.getCode());
}
@Test
public void onNonQueryExceptionTest() {
TSStatus status =
onNonQueryException(
new PathNotExistException("test-PathNotExistException"),
OperationType.EXECUTE_STATEMENT);
assertEquals(TSStatusCode.PATH_NOT_EXIST.getStatusCode(), status.getCode());
}
@Test
public void onIoTDBExceptionTest() {
TSStatus status =
onIoTDBException(
new QueryProcessException("test-QueryProcessException"),
OperationType.EXECUTE_STATEMENT,
TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());
assertEquals(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode(), status.getCode());
}
}
......@@ -27,15 +27,7 @@ public class NotImplementedException extends RuntimeException {
super();
}
public NotImplementedException(String message, Throwable cause) {
super(message, cause);
}
public NotImplementedException(String message) {
super(message);
}
public NotImplementedException(Throwable cause) {
super(cause);
}
}
......@@ -27,19 +27,7 @@ public class TsFileRuntimeException extends RuntimeException {
private static final long serialVersionUID = 6455048223316780984L;
public TsFileRuntimeException() {
super();
}
public TsFileRuntimeException(String message, Throwable cause) {
super(message, cause);
}
public TsFileRuntimeException(String message) {
super(message);
}
public TsFileRuntimeException(Throwable cause) {
super(cause);
}
}
......@@ -20,25 +20,7 @@
package org.apache.iotdb.tsfile.exception.cache;
public class CacheException extends Exception {
public CacheException() {
// do nothing
}
public CacheException(String message) {
super(message);
}
public CacheException(String message, Throwable cause) {
super(message, cause);
}
public CacheException(Throwable cause) {
super(cause);
}
public CacheException(
String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}
......@@ -28,11 +28,6 @@ public class CompressionTypeNotSupportedException extends RuntimeException {
private static final long serialVersionUID = -2244072267816916609L;
private final Class<?> codecClass;
public CompressionTypeNotSupportedException(Class<?> codecClass) {
super("codec not supported: " + codecClass.getName());
this.codecClass = codecClass;
}
public CompressionTypeNotSupportedException(String codecType) {
super("codec not supported: " + codecType);
this.codecClass = null;
......
......@@ -26,22 +26,9 @@ import org.apache.iotdb.tsfile.exception.TsFileRuntimeException;
* This Exception extends super class {@link TsFileRuntimeException}
*/
public class TsFileDecodingException extends TsFileRuntimeException {
private static final long serialVersionUID = -8632392900655017028L;
public TsFileDecodingException() {
// do nothing
}
public TsFileDecodingException(String message, Throwable cause) {
super(message, cause);
}
public TsFileDecodingException(String message) {
super(message);
}
public TsFileDecodingException(Throwable cause) {
super(cause);
}
}
......@@ -29,19 +29,7 @@ public class TsFileEncodingException extends TsFileRuntimeException {
private static final long serialVersionUID = -7225811149696714845L;
public TsFileEncodingException() {
// do nothing
}
public TsFileEncodingException(String message, Throwable cause) {
super(message, cause);
}
public TsFileEncodingException(String message) {
super(message);
}
public TsFileEncodingException(Throwable cause) {
super(cause);
}
}
......@@ -24,12 +24,4 @@ public class QueryFilterOptimizationException extends Exception {
public QueryFilterOptimizationException(String msg) {
super(msg);
}
public QueryFilterOptimizationException(Throwable cause) {
super(cause);
}
public QueryFilterOptimizationException(String message, Throwable cause) {
super(message, cause);
}
}
......@@ -21,16 +21,7 @@ package org.apache.iotdb.tsfile.exception.filter;
/** Some wrong filter parameters invoke. */
public class UnSupportFilterDataTypeException extends RuntimeException {
public UnSupportFilterDataTypeException(String message, Throwable cause) {
super(message, cause);
}
public UnSupportFilterDataTypeException(String message) {
super(message);
}
public UnSupportFilterDataTypeException(Throwable cause) {
super(cause);
}
}
......@@ -23,17 +23,7 @@ import java.io.IOException;
public class TsFileNotCompleteException extends IOException {
public TsFileNotCompleteException() {}
public TsFileNotCompleteException(String message) {
super(message);
}
public TsFileNotCompleteException(String message, Throwable cause) {
super(message, cause);
}
public TsFileNotCompleteException(Throwable cause) {
super(cause);
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.iotdb.tsfile.exception;
import org.apache.iotdb.tsfile.exception.cache.CacheException;
import org.apache.iotdb.tsfile.exception.compress.CompressionTypeNotSupportedException;
import org.apache.iotdb.tsfile.exception.compress.GZIPCompressOverflowException;
import org.apache.iotdb.tsfile.exception.encoding.TsFileDecodingException;
import org.apache.iotdb.tsfile.exception.encoding.TsFileEncodingException;
import org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException;
import org.apache.iotdb.tsfile.exception.filter.StatisticsClassException;
import org.apache.iotdb.tsfile.exception.filter.UnSupportFilterDataTypeException;
import org.apache.iotdb.tsfile.exception.write.NoMeasurementException;
import org.apache.iotdb.tsfile.exception.write.PageException;
import org.apache.iotdb.tsfile.exception.write.TsFileNotCompleteException;
import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
import org.apache.iotdb.tsfile.exception.write.UnknownColumnTypeException;
import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
public class TsFileExceptionTest {
private static final String MOCK = "mock";
@Test
public void testNotCompatibleTsFileException() {
NotCompatibleTsFileException e = new NotCompatibleTsFileException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testNotImplementedException() {
NotImplementedException e = new NotImplementedException(MOCK);
assertEquals(MOCK, e.getMessage());
e = new NotImplementedException();
assertNull(e.getMessage());
}
@Test
public void testNullFieldException() {
NullFieldException e = new NullFieldException();
assertEquals("Field is null", e.getMessage());
}
@Test
public void testPathParseException() {
PathParseException e = new PathParseException(MOCK);
assertEquals("mock is not a legal path.", e.getMessage());
}
@Test
public void testTsFileRuntimeException() {
TsFileRuntimeException e = new TsFileRuntimeException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testTsFileStatisticsMistakesException() {
TsFileStatisticsMistakesException e = new TsFileStatisticsMistakesException(MOCK);
assertEquals(MOCK, e.getMessage());
}
// test for cache exception
@Test
public void testCacheException() {
CacheException e = new CacheException(MOCK);
assertEquals(MOCK, e.getMessage());
}
// test for compress exception
@Test
public void testCompressionTypeNotSupportedException() {
CompressionTypeNotSupportedException e = new CompressionTypeNotSupportedException(MOCK);
assertEquals("codec not supported: " + MOCK, e.getMessage());
}
@Test
public void testGZIPCompressOverflowException() {
GZIPCompressOverflowException e = new GZIPCompressOverflowException();
assertEquals("compressed data is larger than the given byte container.", e.getMessage());
}
// test for encoding exception
@Test
public void testTsFileDecodingException() {
TsFileDecodingException e = new TsFileDecodingException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testTsFileEncodingException() {
TsFileEncodingException e = new TsFileEncodingException(MOCK);
assertEquals(MOCK, e.getMessage());
}
// test for filter exception
@Test
public void testQueryFilterOptimizationException() {
QueryFilterOptimizationException e = new QueryFilterOptimizationException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testStatisticsClassException() {
StatisticsClassException e = new StatisticsClassException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testUnSupportFilterDataTypeException() {
UnSupportFilterDataTypeException e = new UnSupportFilterDataTypeException(MOCK);
assertEquals(MOCK, e.getMessage());
}
// test for write exception
@Test
public void testNoMeasurementException() {
NoMeasurementException e = new NoMeasurementException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testPageException() {
PageException e = new PageException(MOCK);
assertEquals(MOCK, e.getMessage());
e = new PageException(MOCK, new IOException());
assertEquals(MOCK, e.getMessage());
e = new PageException(new IOException());
assertEquals("java.io.IOException", e.getMessage());
}
@Test
public void testTsFileNotCompleteException() {
TsFileNotCompleteException e = new TsFileNotCompleteException(MOCK);
assertEquals(MOCK, e.getMessage());
}
@Test
public void testUnknownColumnTypeException() {
UnknownColumnTypeException e = new UnknownColumnTypeException(MOCK);
assertEquals("Column type not found: " + MOCK, e.getMessage());
}
@Test
public void testUnSupportedDataTypeException() {
UnSupportedDataTypeException e = new UnSupportedDataTypeException(MOCK);
assertEquals("Unsupported dataType: " + MOCK, e.getMessage());
}
@Test
public void testWriteProcessException() {
WriteProcessException e = new WriteProcessException(MOCK);
assertEquals(MOCK, e.getMessage());
e = new WriteProcessException(MOCK, new IOException());
assertEquals(MOCK, e.getMessage());
e = new WriteProcessException(new IOException());
assertEquals("java.io.IOException", e.getMessage());
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册