# Class org.springframework.scripting.groovy.GroovyScriptFactoryTests

38 tests | 0 failures | 0 ignored | 5.838s duration

100%

successful

- Tests
- Standard output

## Tests

Test | Duration | Result
--- | --- | ---
testAnonymousScriptDetected | 0.272s | passed
testCanPassInMoreThanOneProperty | 0.167s | passed
testCtorWithEmptyScriptSourceLocator | 0s | passed
testCtorWithNullScriptSourceLocator | 0s | passed
testCtorWithWhitespacedScriptSourceLocator | 0.003s | passed
testFactoryBean | 0.304s | passed
testGetScriptedObjectDoesChokeOnNullScriptSourceBeingPassedIn | 0s | passed
testGetScriptedObjectDoesNotChokeOnNullInterfacesBeingPassedIn | 0.007s | passed
testInlineJsr223FromTag | 0.156s | passed
testInlineJsr223FromTagWithInterface | 0.172s | passed
testInlineScriptFromTag | 0.220s | passed
testJsr223FromTag | 0.165s | passed
testJsr223FromTagWithInterface | 0.173s | passed
testMetaClassWithBeans | 0.061s | passed
testMetaClassWithXsd | 0.069s | passed
testNonStaticPrototypeScript | 0.066s | passed
testNonStaticScript | 0.057s | passed
testPrototypeScriptFromTag | 0.298s | passed
testProxyTargetClassNotAllowedIfNotGroovy | 0.046s | passed
testRefreshableFactoryBean | 0.233s | passed
testRefreshableFromTag | 0.493s | passed
testRefreshableFromTagProxyTargetClass | 0.048s | passed
testRefreshableJsr223FromTag | 0.167s | passed
testResourceScriptFromTag | 0.145s | passed
testScriptCompilationException | 0.025s | passed
testScriptedClassThatDoesNotHaveANoArgCtor | 0.003s | passed
testScriptedClassThatHasNoPublicNoArgCtor | 0.010s | passed
testStaticPrototypeScript | 0.212s | passed
testStaticPrototypeScriptUsingJsr223 | 0.211s | passed
testStaticScript | 0.324s | passed
testStaticScriptUsingJsr223 | 0.172s | passed
testStaticScriptWithInlineDefinedInstance | 0.351s | passed
testStaticScriptWithInlineDefinedInstanceUsingJsr223 | 0.548s | passed
testStaticScriptWithInstance | 0.343s | passed
testStaticScriptWithInstanceUsingJsr223 | 0.180s | passed
testWithInlineScriptWithLeadingWhitespace | 0.013s | passed
testWithTwoClassesDefinedInTheOneGroovyFile_CorrectClassFirst | 0.023s | passed
testWithTwoClassesDefinedInTheOneGroovyFile_WrongClassFirst | 0.101s | passed

## Standard output

    customizing org.springframework.scripting.groovy.GroovyCalculator@768bb5bb...
    GroovyMessenger
    GroovyMessenger
    16:46:18.149 [Test worker] WARN  org.springframework.context.support.ClassPathXmlApplicationContext - Exception  encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messenger' defined in class path resource [org/springframework/scripting/groovy/lwspBadGroovyContext.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messenger': Could not determine scripted object type for GroovyScriptFactory: script source locator [
        inline:

    	class Bingo {

    		@Property String message;
    	}
    			]; nested exception is java.io.FileNotFoundException: class path resource [
        inline:

    	class Bingo {

    		@Property String message;
    	}
    			] cannot be opened because it does not exist
    GroovyMessenger
    customizing org.springframework.scripting.groovy.GroovyCalculator@35765560...
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    customizing org.springframework.scripting.groovy.GroovyCalculator@580e3a54...
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    customizing org.springframework.scripting.groovy.GroovyCalculator@3a6223f4...
    GroovyMessenger
    GroovyMessenger
    GroovyMessenger
    customizing org.springframework.scripting.groovy.GroovyCalculator@55e84707...
    GroovyMessenger
    16:46:22.049 [Test worker] WARN  org.springframework.context.support.ClassPathXmlApplicationContext - Exception  encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'broken' defined in class path resource [org/springframework/scripting/groovy/groovyBrokenContext.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'broken': Could not determine scripted object type for GroovyScriptFactory: script source locator [classpath:org/springframework/scripting/groovy/Broken.groovyb]; nested exception is org.springframework.scripting.ScriptCompilationException: Could not compile class path resource [org/springframework/scripting/groovy/Broken.groovyb]; nested exception is org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    Broken: 9: expecting '(', found 'breakfast' @ line 9, column 5.
       for breakfast
           ^

    1 error

    16:46:22.149 [Test worker] WARN  org.springframework.context.support.ClassPathXmlApplicationContext - Exception  encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messenger' defined in class path resource [org/springframework/scripting/groovy/twoClassesWrongOneFirst.xml]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messenger': Could not determine scripted object type for GroovyScriptFactory: script source locator [inline:
    	package org.springframework.scripting.groovy;

    	import org.springframework.scripting.Messenger;

    	class Bingo {

    		@Property String message;
    	}

    	class GroovyMessenger implements Messenger {

    		@Property String message;
    	}
    			]; nested exception is org.springframework.scripting.ScriptCompilationException: Could not compile static script [scriptFactory.messenger]; nested exception is org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
    scriptFactory.messenger: 8: unable to resolve class Property ,  unable to find class for annotation
     @ line 8, column 3.
       		@Property String message;
         ^

    scriptFactory.messenger: 13: unable to resolve class Property ,  unable to find class for annotation
     @ line 13, column 3.
       		@Property String message;
         ^

    2 errors