anbuashokcs / jforum2

Automatically exported from code.google.com/p/jforum2
Other
0 stars 0 forks source link

SummaryTest.testListPosts() fail when jforum is freshly installed #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install JForum 2.3.3
2. run the aforementioned testcase
3.

What is the expected output? What do you see instead?
Expectation is success. Instead the testcase fails with the following exception:

net.jforum.exceptions.MailException: freemarker.core.InvalidReferenceException: 
Expression post.text is undefined on line 9, column 3 in 
mail/en_US/summaryMessage.txt.
    at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
    at freemarker.core.Expression.getStringValue(Expression.java:118)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
    at freemarker.core.Environment.visit(Environment.java:428)
    at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.Environment.process(Environment.java:199)
    at freemarker.template.Template.process(Template.java:237)
    at net.jforum.util.mail.Spammer.processTemplate(Spammer.java:323)
    at net.jforum.util.mail.Spammer.prepareMessage(Spammer.java:267)
    at net.jforum.summary.SummaryModel.sendPostsSummary(SummaryModel.java:108)
    at net.jforum.summary.SummaryTest.testSendMails(SummaryTest.java:79)
    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:168)
    at junit.framework.TestCase.runBare(TestCase.java:134)
    at junit.framework.TestResult$1.protect(TestResult.java:110)
    at junit.framework.TestResult.runProtected(TestResult.java:128)
    at junit.framework.TestResult.run(TestResult.java:113)
    at junit.framework.TestCase.run(TestCase.java:124)
    at junit.framework.TestSuite.runTest(TestSuite.java:243)
    at junit.framework.TestSuite.run(TestSuite.java:238)
    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: freemarker.core.InvalidReferenceException: Expression post.text is 
undefined on line 9, column 3 in mail/en_US/summaryMessage.txt.
    ... 38 more

Please use labels and text to provide additional information.

The problem is caused by that there's no posts at all in the database right 
after installation.

The testcase shouldn't assume that there are posts in the database, instead it 
should put one there.

Original issue reported on code.google.com by peter.ri...@gmail.com on 23 Apr 2012 at 9:17

GoogleCodeExporter commented 9 years ago
The stacktrace for this issue is wrong! This is the correct stacktrace:

junit.framework.AssertionFailedError: null
    at junit.framework.Assert.fail(Assert.java:47)
    at junit.framework.Assert.assertTrue(Assert.java:20)
    at junit.framework.Assert.assertTrue(Assert.java:27)
    at net.jforum.summary.SummaryTest.testListPosts(SummaryTest.java:93)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Original comment by peter.ri...@gmail.com on 23 Apr 2012 at 9:23

GoogleCodeExporter commented 9 years ago
This is fixed along with issue 28. Please close this as fixed when 28 is closed.

Original comment by peter.ri...@gmail.com on 24 Apr 2012 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by andow...@gmail.com on 20 May 2012 at 4:39