Letractively / aost

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

More meaningful error messages in 0.7.0 #304

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Just a short experience report from after the change (as I'm running
the 0.7.0-SNAPSHOT version.

The first thing I noticed as a problem was that I got the following
error when trying to run my tests

java.lang.ExceptionInInitializerError
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at
org.tellurium.bootstrap.TelluriumSupport.class$(TelluriumSupport.groovy)
       at
org.tellurium.bootstrap.TelluriumSupport.$get$$class$org$tellurium$framework$Tel
luriumFrameworkMetaClass(TelluriumSupport.groovy)
...
Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException:
Cannot cast object '{}' with class
'groovy.util.ConfigObject' to class
'java.lang.Number'
       at
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToNumber(
DefaultTypeTransformation.java:130)
       at
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.intUnbox(Defa
ultTypeTransformation.java:56)
       at
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(De
faultTypeTransformation.java:300)
       at
org.codehaus.groovy.reflection.CachedField.setProperty(CachedField.java:61)
       at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2339)
       at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3279)
       at org.tellurium.framework.Environment.setProperty(Environment.groovy)
       at groovy.lang.GroovyObject$setProperty.call(Unknown Source)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.jav
a:43)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java
:116)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java
:128)
       at
org.tellurium.config.TelluriumConfigurator.configEnvironment(TelluriumConfigurat
or.groovy:230)

The first thing I did was to go back to my maven module containing my
tellurium modules where I started getting messages about
TelluriumJavaTestCase DslContext not being found, at which point I
remembered this thread and updated my maven dependencies and imports
allowing my modules to build.

However this did not fix the problem above, it seems that this is the
error message you get when there is something missing from
TelluriumConfig.groovy. After overwriting my TelluriumConfig with the
one found in trunk my tests started running again.

It would be nice if;
a) If a property is missing from the config then a sane default is used or;
b) when a property is found to be missing from the config a better
error message should be rendered, telling which property caused the
problem and telling the user where they can find a sample config file.

Original issue reported on code.google.com by John.Jian.Fang@gmail.com on 11 Dec 2009 at 3:23

GoogleCodeExporter commented 8 years ago

Original comment by John.Jian.Fang@gmail.com on 11 Dec 2009 at 5:34

GoogleCodeExporter commented 8 years ago
ellurium Core 0.7.0 added support for Configuration file check as suggested by 
our
user. That can be easily demonstrated by the following example, if we comment 
out the
following section in TelluriumConfig.groovy

      //the bundling tier
//    bundle{
//        maxMacroCmd = 5
//        useMacroCommand = false
//    }

What will happen? Tellurium will throw the following exception

java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at org.telluriumsource.bootstrap.TelluriumSupport.class$(TelluriumSupport.groovy)
        at
org.telluriumsource.bootstrap.TelluriumSupport.$get$$class$org$telluriumsource$f
ramework$TelluriumFrameworkMetaClass(TelluriumSupport.groovy)
        at
org.telluriumsource.bootstrap.TelluriumSupport.addSupport(TelluriumSupport.groov
y:17)
        at
org.telluriumsource.test.java.TelluriumTestNGTestCase.setUpForTest(TelluriumTest
NGTestCase.java:22)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:607)
        at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:417)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:154)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:88)
        at org.testng.TestRunner.beforeRun(TestRunner.java:510)
        at org.testng.TestRunner.run(TestRunner.java:478)
        at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
        at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
        at org.testng.SuiteRunner.run(SuiteRunner.java:204)
        at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:867)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:832)
        at org.testng.TestNG.run(TestNG.java:748)
        at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
        at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
Caused by: org.telluriumsource.exception.ConfigNotFoundException: Cannot find
Tellurium Configuration tellurium.bundle.maxMacroCmd, please check
http://code.google.com/p/aost/wiki/TelluriumConfig070 for updated
TelluriumConfig.groovy, or report to Tellurium user group at
http://groups.google.com/group/tellurium-users
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI
mpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA
ccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:7
7)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCo
erce.callConstructor(ConstructorSite.java:107)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSi
teArray.java:52)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCa
llSite.java:192)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCa
llSite.java:200)
        at
org.telluriumsource.config.TelluriumConfigurator.checkConfig(TelluriumConfigurat
or.groovy:41)

Original comment by John.Jian.Fang@gmail.com on 11 Dec 2009 at 8:37