読者です 読者をやめる 読者になる 読者になる

UnitTestのエラー

修正する前にテストが通ることを確認しようかと思ったのですが、これまた難航しています。
DBはderbyを使っています。初derbyなので勝手がわからず。。

example系のDBの初期化時にALTER TABLEでエラー

ALTER TABLE Bill
       ADD FOREIGN KEY (CustomerID)
                             REFERENCES Customer
                             ON DELETE SET NULL;

↑これ系で、↓こんなエラーが発生します。

SET NULL cannot be specified because FOREIGN KEY 'SQL070130020317780'  cannot contain null values.

テスト結果NG

  • org.seasar.buri.engine.processor.impl.NadejyakoBuriTest
java.lang.RuntimeException: Could not parse.
	at org.seasar.nadejako.Nadejako.parse(Nadejako.java:118)
	at org.seasar.nadejako.Nadejako.newInterpreter(Nadejako.java:91)
	at org.seasar.nadejako.Nadejako.getEvaluator(Nadejako.java:72)
	at org.seasar.coffee.script.nadejako.impl.NadejakoScriptImpl.eval(NadejakoScriptImpl.java:41)
	at nade.nade_wp1.nade_wp1_tra2_condition(ANONYMOUS.java:173)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:42)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:50)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:41)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.runThisMethodName(AbstBuriExecProcess.java:115)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.conditionCheck(AbstBuriExecProcess.java:139)
	at nade.nade_wp1.nade_wp1_act5_next(ANONYMOUS.java:128)
	at nade.nade_wp1.nade_wp1_act5_process(ANONYMOUS.java:110)
	at nade.nade_wp1.nade_wp1_act5_start(ANONYMOUS.java:96)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:42)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:50)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:41)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.runThisMethodName(AbstBuriExecProcess.java:115)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.execActivity(AbstBuriExecProcess.java:108)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.startActivity(AbstBuriExecProcess.java:96)
	at nade.nade_wp1.nade_wp1_act4_next(ANONYMOUS.java:79)
	at nade.nade_wp1.nade_wp1_act4_process(ANONYMOUS.java:72)
	at nade.nade_wp1.nade_wp1_act4_start(ANONYMOUS.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.seasar.framework.util.MethodUtil.invoke(MethodUtil.java:42)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:43)
	at org.seasar.framework.aop.interceptors.TraceInterceptor.invoke(TraceInterceptor.java:50)
	at org.seasar.buri.aop.impl.BuriMethodInvocation.proceed(BuriMethodInvocation.java:41)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.runThisMethodName(AbstBuriExecProcess.java:115)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.execActivity(AbstBuriExecProcess.java:108)
	at org.seasar.buri.util.packages.abst.AbstBuriExecProcess.entryActivity(AbstBuriExecProcess.java:88)
	at org.seasar.buri.engine.impl.WakanagoEngineImpl.execActivity(WakanagoEngineImpl.java:219)
	at org.seasar.buri.engine.impl.WakanagoEngineImpl.execute(WakanagoEngineImpl.java:162)
	at org.seasar.buri.engine.processor.impl.SimpleBuriProcessorImpl.toNextStatusOne(SimpleBuriProcessorImpl.java:51)
	at org.seasar.buri.engine.processor.impl.SimpleBuriProcessorImpl.toNextStatus(SimpleBuriProcessorImpl.java:41)
	at org.seasar.buri.engine.processor.impl.NadejyakoBuriTest.testなでじゃこをぶりから呼んでみるTx(NadejyakoBuriTest.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at org.seasar.framework.unit.S2FrameworkTestCase.doRunTest(S2FrameworkTestCase.java:212)
	at org.seasar.extension.unit.S2TestCase.doRunTest(S2TestCase.java:89)
	at org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.java:139)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.seasar.nadejako.parser.ParseException: Encountered "\u3068 \u30ea\u30fc\u30b9 \u304c \u540c\u3058 <-" at line 0, column 0.
Was expecting one of:
    <EOS> ...
    <ADD> ...
    <SUBTRACT> ...
    <MULTIPLY> ...
    <DIVIDE> ...
    <MOD> ...
    <PROPERTY_PARTICLE> ...
    <ASSIGN_PARTICLE> ...
    <PARAMETER_PARTICLE> <LPAREN> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PROPERTY_PARTICLE> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <MULTIPLY> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <DIVIDE> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <MOD> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <ADD> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <SUBTRACT> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <LPAREN> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <PROPERTY_PARTICLE> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <MULTIPLY> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <DIVIDE> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <MOD> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <ADD> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <SUBTRACT> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <LPAREN> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <IDENTIFIER> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <NUMBER_LITERAL> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <STRING_LITERAL> ...
    <PARAMETER_PARTICLE> <IDENTIFIER> <PARAMETER_PARTICLE> <IDENTIFIER> <FUNCTION> ...
    
	at org.seasar.nadejako.parser.NakoParser.generateParseException(NakoParser.java:1388)
	at org.seasar.nadejako.parser.NakoParser.jj_consume_token(NakoParser.java:1271)
	at org.seasar.nadejako.parser.NakoParser.Sentence(NakoParser.java:126)
	at org.seasar.nadejako.parser.NakoParser.Root(NakoParser.java:32)
	at org.seasar.nadejako.Nadejako.parse(Nadejako.java:115)
	... 69 more
  • org.seasar.buri.engine.processor.impl.StandardBuriProcessor01Test
org.seasar.framework.exception.SQLRuntimeException: [ESSR0071]SQLで例外が発生しました。理由はSQL Exception: 構文エラー: Encountered ")" at line 1, column 17。
	at org.seasar.extension.jdbc.util.ConnectionUtil.prepareStatement(ConnectionUtil.java:53)
	at org.seasar.extension.jdbc.impl.BasicStatementFactory.createPreparedStatement(BasicStatementFactory.java:34)
	at org.seasar.extension.jdbc.impl.BasicHandler.prepareStatement(BasicHandler.java:95)
	at org.seasar.extension.jdbc.impl.BasicUpdateHandler.execute(BasicUpdateHandler.java:72)
	at org.seasar.extension.jdbc.impl.BasicUpdateHandler.execute(BasicUpdateHandler.java:65)
	at org.seasar.extension.dataset.states.AbstractRowState.execute(AbstractRowState.java:46)
	at org.seasar.extension.dataset.states.AbstractRowState.update(AbstractRowState.java:40)
	at org.seasar.extension.dataset.impl.SqlTableWriter.doWrite(SqlTableWriter.java:59)
	at org.seasar.extension.dataset.impl.SqlTableWriter.write(SqlTableWriter.java:52)
	at org.seasar.extension.dataset.impl.SqlWriter.write(SqlWriter.java:46)
	at org.seasar.extension.unit.S2TestCase.writeDb(S2TestCase.java:172)
	at org.seasar.extension.unit.S2TestCase.readXlsWriteDb(S2TestCase.java:192)
	at org.seasar.buri.engine.processor.impl.StandardBuriProcessor01Test.test01Tx(StandardBuriProcessor01Test.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:154)
	at org.seasar.framework.unit.S2FrameworkTestCase.doRunTest(S2FrameworkTestCase.java:212)
	at org.seasar.extension.unit.S2TestCase.doRunTest(S2TestCase.java:89)
	at org.seasar.framework.unit.S2FrameworkTestCase.runBare(S2FrameworkTestCase.java:139)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:118)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at junit.framework.TestSuite.runTest(TestSuite.java:208)
	at junit.framework.TestSuite.run(TestSuite.java:203)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: SQL Exception: 構文エラー: Encountered ")" at line 1, column 17。
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
	at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
	at org.seasar.extension.dbcp.impl.ConnectionWrapperImpl.prepareStatement(ConnectionWrapperImpl.java:134)
	at org.seasar.extension.jdbc.util.ConnectionUtil.prepareStatement(ConnectionUtil.java:51)
	... 34 more
  • org.seasar.buri.engine.processor.impl.StandardBuriProcessor02Test
    • ↑とにたような感じ

環境構築失敗系でしょうか?