Source

grails-propertyset / test / integration / com / opensymphony / module / propertyset / PropertyEntryTests.groovy

package com.opensymphony.module.propertyset

import org.junit.After
import org.junit.Before
import org.junit.Test
import org.codehaus.groovy.grails.compiler.injection.GrailsAwareClassLoader
import com.opensymphony.module.propertyset.gorm.GroovyPropertySet

class PropertyEntryTests extends GroovyTestCase {

    static transactional = false

    @Before
    void setUp() {

    }

    @After
    void tearDown() {
        // Tear down logic here
    }

    @Test
    void testSomething() {
        def args = [entityId:1, entityName:"propertyset.test"]
        PropertySet ps = PropertySetManager.getInstance("gorm", args, new GrailsAwareClassLoader(getClass().getClassLoader()))
        ps.setInt( "proxy", 8080 )
    }

    @Test
    void testMe() {
        def args = [entityId:2, entityName:"propertyset.test"]
        PropertySet grailsPropertySet = new GroovyPropertySet();
        grailsPropertySet.init(new HashMap(), args);
        grailsPropertySet.setDate("test", new Date())
    }
}