Browse Source

去掉异常

remotes/1611766341912730171/master
richie 5 years ago
parent
commit
b331e15152
  1. 17
      src/test/java/com/fanruan/api/data/open/BaseTableDataTest.java

17
src/test/java/com/fanruan/api/data/open/BaseTableDataTest.java

@ -1,7 +1,6 @@
package com.fanruan.api.data.open; package com.fanruan.api.data.open;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
import com.fr.general.data.TableDataException;
import com.fr.measure.metric.DBMetric; import com.fr.measure.metric.DBMetric;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import org.junit.Assert; import org.junit.Assert;
@ -21,7 +20,7 @@ public class BaseTableDataTest {
Calculator calculator = Calculator.createCalculator(); Calculator calculator = Calculator.createCalculator();
DemoTableData tableData = new DemoTableData(); DemoTableData tableData = new DemoTableData();
DataModel model = tableData.createDataModel(calculator); DataModel model = tableData.createDataModel(calculator);
Object r = model.getValueAt(0, 0); Object r = model.getValueAt(0, 0);
Assert.assertEquals("abc", r); Assert.assertEquals("abc", r);
} }
@ -32,37 +31,37 @@ public class BaseTableDataTest {
public DataModel createDataModel(Calculator calculator) { public DataModel createDataModel(Calculator calculator) {
return new DataModel() { return new DataModel() {
@Override @Override
public int getColumnCount() throws TableDataException { public int getColumnCount() {
return 1; return 1;
} }
@Override @Override
public int getColumnIndex(String s) throws TableDataException { public int getColumnIndex(String s) {
return 1; return 1;
} }
@Override @Override
public String getColumnName(int i) throws TableDataException { public String getColumnName(int i) {
return "test"; return "test";
} }
@Override @Override
public boolean hasRow(int i) throws TableDataException { public boolean hasRow(int i) {
return i < 1; return i < 1;
} }
@Override @Override
public int getRowCount() throws TableDataException { public int getRowCount() {
return 1; return 1;
} }
@Override @Override
public Object getValueAt(int i, int i1) throws TableDataException { public Object getValueAt(int i, int i1) {
return "abc"; return "abc";
} }
@Override @Override
public void release() throws Exception { public void release() {
} }

Loading…
Cancel
Save