什么会导致 table 异常中没有行?
What would cause no rows in table exception?
我不知道从哪里开始解决这个问题。我想知道我是否应该尝试不同的夹具测试。
当我 运行 我的技巧测试时出现此错误:
fitnesse.fixtures.TestSecurityDaoFixtureTest
fit.exception.FitFailureException: table 在 fitnesse.fixtures.TableFixture.doRows(TableFixture.java:15) 在 fit.Fixture.doTable(Fixture.java: 没有行154)在fitlibrary.traverse.FitHandler.doTable(未知来源)在fitlibrary.flow.DoFlowOnTable.runTable(未知来源)在fitlibrary.flow.DoFlowOnTable.runTable(未知来源)在fitlibrary.flow.DoFlow.runTable(未知来源)在fitlibrary.flow.DoFlow.runStorytest(未知源)在 fitlibrary.suite.BatchFitLibrary.doTables(未知来源)在 fitlibrary.suite.BatchFitLibrary.doStorytest(未知来源)在 fitlibrary.suite.BatchFitLibrary.doTables(未知来源)在 fitlibrary.suite.FitLibraryServer.doTables(未知来源)在 fitlibrary.suite.FitLibraryServer.doTables(未知来源)在 fit.FitServerBridge.process(未知来源)在 fit.FitServerBridge.run(未知来源)在 fitlibrary.suite.FitLibraryServer.main(未知来源)
和
FindSecurity 缺少 class 或缺少方法。可能:
public Type getFindSecurity() { }
public Type findSecurity() { }
这是我的实际代码:
package fitnesse.fixtures;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.LocalDate;
import org.junit.BeforeClass;
import org.springframework.context.ApplicationContext;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.List;
/**
* Created by V616248 on 12/17/2014.
*/
public class TestSomethingDaoFixtureTest extends BaseFixtureTest {
private static ApplicationContext context;
private static SomethingDao dao;
private static Utility utility;
@BeforeClass
public void setUp() {
System.out.println("in setup");
utility= new Utility();
utility.setUp();
}
/**
*
*/
public void findSomething(){
System.out.println("Before find");
List<Something> something1 = dao.findBySomethingCodeAndDate(getText(1, 0), new
LocalDate());
System.out.println("After find");
if(something1 != null) {
right(1, 0);
} else {
wrong(1, 0);
}
System.out.println("This is a test show results");
}
/**
*
* @param fitnessRows
*/
public void showResults(int fitnessRows) {
findSomething();
}
}
我的 content.txt 文件:
!|fitnesse.fixtures.TestSomethingDaoFixtureTest|
!|找到东西|
|ABCD101|
Utility setup method:
public void setUp() {
System.out.println("exception 1");
context = UnitTestConfig.createApplicationContext();
System.out.println("exception 2");
categoryDao = context.getBean(CategoryDao.class);
dao = context.getBean(SomethingDao.class);
System.out.println("exception 3");
PlatformTransactionManager tm = context.getBean(PlatformTransactionManager.class);
System.out.println("exception 4");
TransactionTemplate tt = new TransactionTemplate(tm);
System.out.println("exception 5");
tt.execute(new TransactionCallback<Void>() {
@Override
public Void doInTransaction(TransactionStatus status) {
System.out.println("exception 6");
DateTime currentDateTime = new DateTime(DateTimeZone.getDefault());
System.out.println("exception 7");
LocalDate localDate = new LocalDate();
System.out.println("exception 8");
Category inCategory = null;
System.out.println("exception 9");
try {
System.out.println("exception 10");
Category category = new Category("5d6d0db0-4d38-424d-8f82-14aab7798ad4", currentDateTime, "O607412",
"G-00A", "BEFORE ALLOC-FIRM LONG");
System.out.println("exception 11");
categoryDao.save(category);
System.out.println("exception 12");
inCategory = categoryDao.findOne(new Long(1));
System.out.println("exception 13");
System.out.println("exception 14");
Something something= new Something("1234",
currentDateTime,
"O607412",
localDate,
inCategory,
"ABCD101",
"Test 1",
new Double(100),
new Double(100),
new Double(0), false);
System.out.println("Now saving Something");
dao.save(something1);
System.out.println("After Save 1");
dao.save(something3);
} catch (Exception e) {
e.printStackTrace();
System.out.println("exception" +e.toString());
}
return null;
}
});
}
我试图在第一行的第一个单元格中发表评论。当我将真实数据放在第一个单元格中并将评论放在最后一个单元格中时,我的运气就更好了。
例子:
|!TestMyData|100| <-- 没用
|100|!TestMyData| <-- 这有效
我不知道从哪里开始解决这个问题。我想知道我是否应该尝试不同的夹具测试。 当我 运行 我的技巧测试时出现此错误: fitnesse.fixtures.TestSecurityDaoFixtureTest
fit.exception.FitFailureException: table 在 fitnesse.fixtures.TableFixture.doRows(TableFixture.java:15) 在 fit.Fixture.doTable(Fixture.java: 没有行154)在fitlibrary.traverse.FitHandler.doTable(未知来源)在fitlibrary.flow.DoFlowOnTable.runTable(未知来源)在fitlibrary.flow.DoFlowOnTable.runTable(未知来源)在fitlibrary.flow.DoFlow.runTable(未知来源)在fitlibrary.flow.DoFlow.runStorytest(未知源)在 fitlibrary.suite.BatchFitLibrary.doTables(未知来源)在 fitlibrary.suite.BatchFitLibrary.doStorytest(未知来源)在 fitlibrary.suite.BatchFitLibrary.doTables(未知来源)在 fitlibrary.suite.FitLibraryServer.doTables(未知来源)在 fitlibrary.suite.FitLibraryServer.doTables(未知来源)在 fit.FitServerBridge.process(未知来源)在 fit.FitServerBridge.run(未知来源)在 fitlibrary.suite.FitLibraryServer.main(未知来源)
和
FindSecurity 缺少 class 或缺少方法。可能:
public Type getFindSecurity() { }
public Type findSecurity() { }
这是我的实际代码:
package fitnesse.fixtures;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.LocalDate;
import org.junit.BeforeClass;
import org.springframework.context.ApplicationContext;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;
import org.springframework.transaction.support.TransactionTemplate;
import java.util.List;
/**
* Created by V616248 on 12/17/2014.
*/
public class TestSomethingDaoFixtureTest extends BaseFixtureTest {
private static ApplicationContext context;
private static SomethingDao dao;
private static Utility utility;
@BeforeClass
public void setUp() {
System.out.println("in setup");
utility= new Utility();
utility.setUp();
}
/**
*
*/
public void findSomething(){
System.out.println("Before find");
List<Something> something1 = dao.findBySomethingCodeAndDate(getText(1, 0), new
LocalDate());
System.out.println("After find");
if(something1 != null) {
right(1, 0);
} else {
wrong(1, 0);
}
System.out.println("This is a test show results");
}
/**
*
* @param fitnessRows
*/
public void showResults(int fitnessRows) {
findSomething();
}
}
我的 content.txt 文件: !|fitnesse.fixtures.TestSomethingDaoFixtureTest| !|找到东西| |ABCD101|
Utility setup method:
public void setUp() {
System.out.println("exception 1");
context = UnitTestConfig.createApplicationContext();
System.out.println("exception 2");
categoryDao = context.getBean(CategoryDao.class);
dao = context.getBean(SomethingDao.class);
System.out.println("exception 3");
PlatformTransactionManager tm = context.getBean(PlatformTransactionManager.class);
System.out.println("exception 4");
TransactionTemplate tt = new TransactionTemplate(tm);
System.out.println("exception 5");
tt.execute(new TransactionCallback<Void>() {
@Override
public Void doInTransaction(TransactionStatus status) {
System.out.println("exception 6");
DateTime currentDateTime = new DateTime(DateTimeZone.getDefault());
System.out.println("exception 7");
LocalDate localDate = new LocalDate();
System.out.println("exception 8");
Category inCategory = null;
System.out.println("exception 9");
try {
System.out.println("exception 10");
Category category = new Category("5d6d0db0-4d38-424d-8f82-14aab7798ad4", currentDateTime, "O607412",
"G-00A", "BEFORE ALLOC-FIRM LONG");
System.out.println("exception 11");
categoryDao.save(category);
System.out.println("exception 12");
inCategory = categoryDao.findOne(new Long(1));
System.out.println("exception 13");
System.out.println("exception 14");
Something something= new Something("1234",
currentDateTime,
"O607412",
localDate,
inCategory,
"ABCD101",
"Test 1",
new Double(100),
new Double(100),
new Double(0), false);
System.out.println("Now saving Something");
dao.save(something1);
System.out.println("After Save 1");
dao.save(something3);
} catch (Exception e) {
e.printStackTrace();
System.out.println("exception" +e.toString());
}
return null;
}
});
}
我试图在第一行的第一个单元格中发表评论。当我将真实数据放在第一个单元格中并将评论放在最后一个单元格中时,我的运气就更好了。 例子: |!TestMyData|100| <-- 没用 |100|!TestMyData| <-- 这有效