I think it is fixed now. I have the following test case,
class UnicodeModule extends TelluriumDataDrivenModule{
void defineModule() {
typeHandler "unicode", "org.telluriumsource.ddt.UnicodeTypeHandler"
fs.FieldSet(name: "record", description: "Data format for testing
Unicode") {
Test(value: "testUnicode")
Field(name: "title", description: "test title")
Field(name: "abstract", type: "unicode", description: "abstract")
Field(name: "email", description: "email")
Field(name: "indicator", type: "boolean", description: "indicator")
}
defineTest("testUnicode") {
String title = bind("record.title")
String abst = bind("record.abstract")
String email = bind("record.email")
boolean indicator = bind("record.indicator")
compareResult(false, indicator)
println "$title, $abst, $email, $indicator"
}
}
}
Here is the output result:
<TestResults>
<Total>1</Total>
<Skipped>0</Skipped>
<Succeeded>0</Succeeded>
<Failed>1</Failed>
<Test name='testUnicode'>
<Step>1</Step>
<Passed>false</Passed>
<Input>
<test>testUnicode</test>
<title>Test Title</title>
<abstract>My abstract is ... Nühe &</abstract>
<email>[email protected]</email>
<indicator>true</indicator>
</Input>
<Assertion Expected='false' Actual='true' Passed='false'
Error='expected:<false> but was:<true>' />
<Status>PROCEEDED</Status>
<Runtime>0.042533587</Runtime>
</Test>
</TestResults>
Please update to the latest snapshot:
http://maven.kungfuters.org/content/repositories/snapshots/org/telluriumsource/tellurium-core/0.8.0-SNAPSHOT/tellurium-core-0.8.0-20110428.222648-56.jar
1777K uploaded (tellurium-core-0.8.0-20110428.222648-56.jar
Thanks,
Jian
On Thu, Apr 28, 2011 at 3:19 AM, ADJ <[email protected]> wrote:
> Hi,
>
> I used the compareResult function to check if a test has succedded or
> failed.
> So I prefer this function doesn't throw an exception for a false
> comparison.
>
> Regards.
>
>
>
> On 27 avr, 16:17, Jian Fang <[email protected]> wrote:
> > Would it be fine if an exception is thrown for false comparison result
> just
> > like JUnit comparison?
> >
> >
> >
> > On Wed, Apr 27, 2011 at 3:18 AM, ADJ <[email protected]> wrote:
> > > Hi,
> >
> > > The "compareResult" function set all my tests to "Succeeded" even if
> > > they failled with the last snapshot.
> >
> > > Regards.
> >
> > > On 27 avr, 00:16, Jian Fang <[email protected]> wrote:
> > > > Seems the current way to add the comparison result to the result
> listener
> > > > does not work. I
> > > > disabled that feature for the time being until I have a better
> > > > implementation. Please try the
> > > > new snapshot here:
> >
> > > >
> http://maven.kungfuters.org/content/repositories/snapshots/org/tellur...
> >
> > > > Thanks.On Tue, Apr 26, 2011 at 2:09 AM, ADJ <[email protected]>
> > > wrote:
> > > > > Hi Jian,
> >
> > > > > the "compareResult" function doesn't work well in the last
> snapshot.
> >
> > > > > Here the result of my login test with a bad username.
> > > > > In the result, there is a new node "Step 0".
> > > > > The node Step 1 should be set at false.
> >
> > > > > <Test name="">
> > > > > <Step>0</Step>
> > > > > <Passed>false</Passed>
> > > > > <Input />
> > > > > <Assertion Expected="true" Actual="false" Passed="false"
> > > > > Error="expected:<true> but was:<false>" />
> > > > > <Assertion Expected="true" Actual="false" Passed="false"
> > > > > Error="expected:<true> but was:<false>" />
> > > > > <Status>null</Status>
> > > > > <Runtime>0E-9</Runtime>
> > > > > </Test>
> > > > > - <Test name="Login">
> > > > > <Step>1</Step>
> > > > > <Passed>true</Passed>
> > > > > - <Input>
> > > > > <test>Login</test>
> > > > > <login>LoginDoes not exist</login>
> > > > > <password>*****************</password>
> > > > > <displayname>*****************</displayname>
> > > > > </Input>
> > > > > <Status>PROCEEDED</Status>
> > > > > <Runtime>33.676117393</Runtime>
> > > > > </Test>
> >
> > > > > Thanks for your help.
> > > > > Regards.
> >
> > > > > On 21 avr, 23:40, Jian Fang <[email protected]> wrote:
> > > > > > Try this one.
> >
> > >http://maven.kungfuters.org/content/repositories/snapshots/org/tellur.
> ..
> >
> > > > > > I am not sure if this problem was introduced during last
> refactoring
> > > for
> > > > > > dependency injection.
> >
> > > > > > Anyway, thanks for reporting.
> >
> > > > > > On Thu, Apr 21, 2011 at 5:16 PM, Jian Fang <
> [email protected]
> >
> > > > > wrote:
> > > > > > > Will take a look soon.
> >
> > > > > > > On Thu, Apr 21, 2011 at 3:11 AM, ADJ <[email protected]>
> > > wrote:
> >
> > > > > > >> Hi,
> >
> > > > > > >> I can change the filename value with this last artifact.
> > > > > > >> Many thanks for your help.
> >
> > > > > > >> I've got one error after each test.
> > > > > > >> <Exception>
> > > > > > >> No such property: expected for class:
> > > > > > >> org.telluriumsource.test.report.AssertionResult
> >
> > >
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:
> > > > > > >> 49)
> > > > > > >>
> groovy.lang.GroovyObject$setProperty.call(Unknown
> > > > > Source)
> >
> > >
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
> > > > > > >> 40)
> >
> > >
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
> > > > > > >> 117)
> >
> > >
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
> > > > > > >> 129)
> >
> > > > >
> org.telluriumsource.dsl.DdDslContext.compareResult(DdDslContext.groovy:
> > > > > > >> 227)
> >
> > > > > > >> Here the code for my Login Test :
> >
> > > > > > >> defineTest("Login") {
> > > > > > >> def login = bind("LoginFieldSet.login")
> > > > > > >> def password = bind("LoginFieldSet.password")
> > > > > > >> def displayname = bind("LoginFieldSet.displayname")
> > > > > > >> boolean result = tryLogin(login, password,
> displayname);
> > > > > > >> compareResult(true, result)
> > > > > > >> pause 500
> > > > > > >> }
> >
> > > > > > >> Do you have an idea why ?
> >
> > > > > > >> Regards.
> >
> > > > > > >> On 21 avr, 00:46, Jian Fang <[email protected]> wrote:
> > > > > > >> > I think I fixed the session issue. Could you try with the
> new
> > > > > artifact?
> >
> > > > >
> http://maven.kungfuters.org/content/repositories/snapshots/org/tellur.
> > > > > > >> ..
> >
> > > > > > >> > On Wed, Apr 20, 2011 at 5:40 PM, Jian Fang <
> > > > > [email protected]>
> > > > > > >> wrote:
> > > > > > >> > > Seems to be the session initalization issue. I will take a
> > > look
> > > > > > >> tonight.
> >
> > > > > > >> > > Thanks,
> >
> > > > > > >> > > Jian
> >
> > > > > > >> > > On Wed, Apr 20, 2011 at 9:03 AM, ADJ <
> [email protected]>
> > > > > wrote:
> >
> > > > > > >> > >> Hi,
> >
> > > > > > >> > >> I've updated my project with the latest snapshot.
> > > > > > >> > >> If the output property of the TelluriumConfig.groovy is
> set
> > > to
> > > > > > >> "File",
> > > > > > >> > >> I've got a java error.
> >
> > > > > > >> > >> java.lang.ExceptionInInitializerError
> > > > > > >> > >> at java.lang.Class.forName0(Native Method)
> > > > > > >> > >> at java.lang.Class.forName(Unknown Source)
> > > > > > >> > >> at
> org.telluriumsource.test.report.FileOutput.class$
> > > > > > >> > >> (FileOutput.groovy)
> > > > > > >> > >> at
> > > > > org.telluriumsource.test.report.FileOutput.$get$$class$org
> >
> > > $telluriumsource$framework$TelluriumInjector(FileOutput.groovy)
> > > > > > >> > >> at
> >
> > > > >
> org.telluriumsource.test.report.FileOutput.<init>(FileOutput.groovy)
> >
> > > > > > >> > >> If the output property of the TelluriumConfig.groovy is
> set
> > > to
> > > > > > >> > >> "Console", I can read and set the value of the filename
> > > property
> > > > > of
> > > > > > >> > >> the TelluriumConfig.groovy
> > > > > > >> > >> And now after each test, I've got this error
> >
> > > > > > >> > >> No such property: expected for class:
> > > > > > >> > >> org.telluriumsource.test.report.AssertionResult
> >
> > >
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:
> > > > > > >> > >> 49)
> >
> > > groovy.lang.GroovyObject$setProperty.call(Unknown
> > > > > > >> Source)
> >
> > > > > > >> > >> Thanks for your help.
> > > > > > >> > >> Regards.
> >
> > > > > > >> > >> On 20 avr, 00:18, Jian Fang <[email protected]>
> > > wrote:
> > > > > > >> > >> > Sorry for the delay.
> >
> > > > > > >> > >> > The internal code for the filename was
> > > > > > >> > >> "tellurium.test.result.fileName". I
> > > > > > >> > >> > changed it back to "tellurium.test.result.filename"
> >
> > > > > > >> > >> > I created the following test case and it works now.
> >
> > > > > > >> > >> > @Test
> > > > > > >> > >> > public void testEnvironment(){
> > > > > > >> > >> > String fileName = (String)
> > > > > > >> > >> > getEnvironment("tellurium.test.result.filename");
> > > > > > >> > >> > assertNotNull(fileName);
> > > > > > >> > >> > System.out.println("Default test result file
> name "
> > > +
> > > > > > >> fileName);
> >
> > > > > > >> > >> >
> setEnvironment("tellurium.test.result.filename",
> > > > > > >> > >> > "/tmp/TestResult.output");
> > > > > > >> > >> > fileName = (String)
> > > > > > >> > >> > getEnvironment("tellurium.test.result.filename");
> > > > > > >> > >> > assertEquals("/tmp/TestResult.output",
> fileName);
> > > > > > >> > >> > System.out.println("New file name " +
> fileName);
> > > > > > >> > >> > }
> >
> > > > > > >> > >> > Please update your project to use the latest 0.8.0
> snapshot
> > > and
> > > > > let
> > > > > > >> us
> > > > > > >> > >> know
> > > > > > >> > >> > if it works for you.
> >
> > >http://maven.kungfuters.org/content/repositories/snapshots/org/tellur.
> > > > > > >> > >> ..
> >
> > > > > > >> > >> > Thanks,
> >
> > > > > > >> > >> > Jian
> >
> > > > > > >> > >> > On Thu, Apr 14, 2011 at 3:16 AM, ADJ <
> > > [email protected]>
> > > > > > >> wrote:
> > > > > > >> > >> > > Hi,
> >
> > > > > > >> > >> > > I've tried your solution but it doesn't work.
> >
> > > > > > >> > >> > > String output = ""
> > > > > > >> > >> > > output =
> getEnvironment("tellurium.test.result.filename")
> > > =>
> > > > > > >> output =
> > > > > > >> > >> > > null
> > > > > > >> > >> > > setEnvironment ("tellurium.test.result.filename",
> > > > > > >> "D:\\Dev\\output\
> > > > > > >> > >> > > \TestResult2.xml")
> > > > > > >> > >> > > output =
> getEnvironment("tellurium.test.result.filename")
> > > =>
> > > > > > >> output =
> > > > > > >> > >> > > D:\\Dev\\output\\TestResult2.xml
> > > > > > >> > >> > > output =
> getEnvironment("tellurium.connector.serverHost")
> > > =>
> > > > > > >> output =
> > > > > > >> > >> > > null
> >
> > > > > > >> > >> > > The tests results are still written in the file
> defined
> > > in
> > > > > the
> > > > > > >> > >> > > TelluriumConfig.groovy
> >
> > > > > > >> > >> > > Thanks for your help.
> >
> > > > > > >> > >> > > On Apr 13, 6:08 pm, Jian Fang <
> [email protected]>
> > > > > wrote:
> > > > > > >> > >> > > > What timestamp?
> >
> > > > > > >> > >> > > > On Wed, Apr 13, 2011 at 12:00 PM, Hari <
> > > [email protected]
> >
> > > > > > >> wrote:
> > > > > > >> > >> > > > > We have to add timestamp to the program
> >
> > > > > > >> > >> > > > > On 13 April 2011 18:53, ADJ <
> [email protected]>
> > > > > wrote:
> >
> > > > > > >> > >> > > > >> Hi.
> >
> > > > > > >> > >> > > > >> How can I change the value of some fields
> located in
> > > the
> > > > > > >> > >> > > > >> TelluriumConfig at runtime ?
> > > > > > >> > >> > > > >> Example :
> > > > > > >> > >> > > > >> Add the date and time to the the filename used
> for
> > > the
> > > > > > >> output.
> >
> > > > > > >> > >> > > > >> Thanks for your help.
> >
> > > > > > >> > >> > > > >> --
> > > > > > >> > >> > > > >> You received this message because you are
> subscribed
> > > to
> > > > > the
> > > > > > >> > >> Google
> > > > > > >> > >> > > Groups
> > > > > > >> > >> > > > >> "tellurium-users" group.
> > > > > > >> > >> > > > >> To post to this group, send email to
> > > > > > >> > >> [email protected]
> > > > > > >> > >> > > .
> > > > > > >> > >> > > > >> To unsubscribe from this group, send email to
> > > > > > >> > >> > > > >> [email protected].
> > > > > > >> > >> > > > >> For more options, visit this group at
> > > > > > >> > >> > > > >>
> http://groups.google.com/group/tellurium-users?hl=en
> > > .
> >
> > > > > > >> > >> > > > > --
> > > > > > >> > >> > > > > You received this message because you are
> subscribed
> > > to
> > > > > the
> > > > > > >> Google
> > > > > > >> > >> > > Groups
> >
> > ...
> >
> > plus de détails »- Masquer le texte des messages précédents -
> >
> > - Afficher le texte des messages précédents -
>
> --
> You received this message because you are subscribed to the Google Groups
> "tellurium-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/tellurium-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"tellurium-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tellurium-users?hl=en.