Getting: item has already been added errors with concordion

16 views
Skip to first unread message

Patrick van der Velde

unread,
Oct 11, 2010, 8:30:52 PM10/11/10
to concordio...@googlegroups.com
Hi All

With some help from people on this group I managed to get my tests to
run. Thanks heaps for all your help. Now however I'm getting weird
test results.

My Html looks like this (it's basically a copy of the html in the blog
posts here: http://living-in-concordion.blogspot.com/2009/05/your-first-concordionnet-project-part-4.html):

<html xmlns:concordion="http://www.concordion.org/2007/concordion">
<head>
<link href="concordion.css"
rel="stylesheet"
type="text/css" />
</head>
<body>
<h1>Startup</h1>
<p>
The result of <b concordion:set="#FirstOperand">2</b> * <b
concordion:set="#SecondOperand">2</b>. The result
will be: <b
concordion:assertEquals="Multiplication(#FirstOperand,
#SecondOperand)">4</b>
</p>
</body>
</html>

And the code looks like:
using System.Diagnostics.CodeAnalysis;
using Concordion.Integration;

namespace Apollo.UI.Common.Spec.System
{
[ConcordionTest]
[SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules",
"SA1600:ElementsMustBeDocumented",
Justification = "Specification tests do not need documentation.")]
public sealed class StartupTest
{
[SuppressMessage("Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1401:FieldsMustBePrivate",
Justification = "For Concordion the fields must be public.")]
public long FirstOperand;

[SuppressMessage("Microsoft.StyleCop.CSharp.MaintainabilityRules",
"SA1401:FieldsMustBePrivate",
Justification = "For Concordion the fields must be public.")]
public long SecondOperand;

public long Multiplication(long first, long second)
{
return -1;
}
}
}

The output of concordion contains a whole set of errors all stating:

Item has already been added. Key in dictionary: 'TEXT' Key being added: 'TEXT'

While evaluating expression: #FirstOperand

System.ArgumentException: Item has already been added. Key in
dictionary: 'TEXT' Key being added: 'TEXT'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at Concordion.Internal.Commands.LocalTextDecorator.Setup(CommandCall
commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)
at Concordion.Internal.Commands.ExceptionCatchingDecorator.Setup(CommandCall
commandCall, IEvaluator evaluator, IResultRecorder resultRecorder)

From the Concordion (java version) website I see that TEXT is a
default variable that contains the text of the current element.

Does anybody have any idea of why this is going wrong? I'm using
Concordion 0.5.44.78.

Thanks

Patrick

Patrick van der Velde

unread,
Oct 14, 2010, 7:07:51 AM10/14/10
to concordio...@googlegroups.com
Hi All

Does anybody have any suggestions for the problem described below? Is
it a bug in my code (most likely, although I couldn't directly find
any variable called TEXT) or is it something wrong with
Concordion.net?

Thanks

Patrick

Patrick van der Velde

unread,
Oct 15, 2010, 5:27:13 PM10/15/10
to concordio...@googlegroups.com
Hi All

I've tracked the error back to the OGNL library. I've had to created
signed version of Concordion and OGNL because my product assemblies
are signed (and I'm using the InternalsVisible attribute to allow
testing of internals). It turns out that the version of OGNL.NET that
I found on the internet (http://sourceforge.net/projects/ognlnet/)
isn't the same as the version that Concordion uses. Can anybody point
me to the source of the OGNL library that Concordion uses?

Thanks

Patrick

On Fri, Oct 15, 2010 at 00:07, Patrick van der Velde

Reply all
Reply to author
Forward
0 new messages