<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Grails Geek &#187; Alexander Naumenko</title>
	<atom:link href="http://grailsgeek.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://grailsgeek.com</link>
	<description>Grails tips I wanna share with you ;)</description>
	<lastBuildDate>Sun, 01 Nov 2009 13:29:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using standalone GORM for testing</title>
		<link>http://grailsgeek.com/2009/11/using-standalone-gorm-for-testing/</link>
		<comments>http://grailsgeek.com/2009/11/using-standalone-gorm-for-testing/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 13:29:51 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[the rest]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[mockDomain]]></category>
		<category><![CDATA[standalone gorm]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=67</guid>
		<description><![CDATA[Recently I was stuck with persistence testing. I like to write simple unit tests and run them from my favorite IDE (Intellij IDEA forever!), but there was no luck with GORM Criterias testing. My case is simple: I have Grails Service which using criteria to fetch some objects from the database. Testing with mockDomain() won&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Recently I was stuck with persistence testing. I like to write simple unit tests and run them from my favorite IDE (Intellij IDEA forever!), but there was no luck with GORM Criterias testing. My case is simple: I have Grails Service which using criteria to fetch some objects from the database. Testing with mockDomain() won&#8217;t work since you need Hibernate support. Of course you could still write integration tests as described in Grails tutorial, but I just didn&#8217;t want to.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">First off I looked through google&#8217;s top 10 about the subject, but after few hours of trials I was still where I started.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I decided to look on Grails sources and (voilà!) I found HibernateCriteriaBuilderTests. Which has tested exactly what I messed with.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">I&#8217;m not going to share all things I&#8217;ve done until I got finally working abstract test case (based on AbstractGrailsHibernateTests) . You should just derive your test from test case below and use Grails domain objects in your test as usual. Also I&#8217;ll provide two classes MockGrailsPluginManager and MockHibernateGrailsPlugin. Both of them were taken as is from Grails test sources.</div>
<p>Recently I was stuck with persistence testing. I like to write simple unit tests and run them from my favorite IDE (<span style="color: #333399;">Intellij IDEA</span> forever!), but there was no luck with<span style="color: #333399;"> GORM Criterias</span> testing. My case is simple: I have Grails Service which using criteria to fetch some objects from the database. Testing with <span style="color: #333399;">mockDomain()</span> won&#8217;t work since you need <span style="color: #333399;">Hibernate</span> support. Of course you could still write integration tests as described in Grails tutorial, but I just didn&#8217;t want to.</p>
<p><span style="background-color: #ffffff;">First off I looked through google&#8217;s top 10 about the subject, but after few hours of trials I was still where I started.</span></p>
<p><span style="background-color: #ffffff;">I decided to look on Grails sources and (voilà!) I found <span style="color: #333399;">HibernateCriteriaBuilderTests</span>. Which has tested exactly what I messed with.</span></p>
<p><span style="background-color: #ffffff;">I&#8217;m not going to share all things I&#8217;ve done until I got finally working abstract test case (based on <span style="color: #333399;">AbstractGrailsHibernateTests</span>) . You should just derive your test from test case below and use Grails domain objects in your test as usual. Also I&#8217;ll provide two classes <span style="color: #333399;">MockGrailsPluginManager</span> and <span style="color: #333399;">MockHibernateGrailsPlugin</span>. Both of them were taken as is from Grails test sources.</span></p>
<h4><span style="background-color: #ffffff;"> <strong>AbstractPersistenceTestCase</strong></span></h4>
<pre class="brush:groovy">package com.grailsgeek

import com.grailsgeek.MockHibernateGrailsPlugin
import grails.test.GrailsUnitTestCase
import groovy.lang.ExpandoMetaClass
import groovy.lang.ExpandoMetaClassCreationHandle
import groovy.lang.GroovyClassLoader
import groovy.lang.GroovySystem
import org.codehaus.groovy.grails.commons.ApplicationHolder
import org.codehaus.groovy.grails.commons.DefaultGrailsApplication
import org.codehaus.groovy.grails.commons.GrailsApplication
import org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration
import org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
import org.codehaus.groovy.grails.plugins.datasource.DataSourceGrailsPlugin
import org.codehaus.groovy.grails.plugins.i18n.I18nGrailsPlugin
import org.codehaus.groovy.grails.support.MockApplicationContext
import org.hibernate.Session
import org.hibernate.SessionFactory
import org.springframework.context.ApplicationContext
import org.springframework.context.support.StaticMessageSource
import org.springframework.orm.hibernate3.SessionFactoryUtils
import org.springframework.orm.hibernate3.SessionHolder
import org.springframework.transaction.support.TransactionSynchronizationManager
import org.codehaus.groovy.grails.plugins.*

abstract class AbstractPersistenceTestCase extends GrailsUnitTestCase {
    GroovyClassLoader gcl = new GroovyClassLoader(this.getClass().classLoader)
    MockApplicationContext ctx;
    ApplicationContext appCtx
    SessionFactory sessionFactory
    Session session

    protected void setUp() {
        super.setUp();

        ExpandoMetaClass.enableGlobally()

        GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle();

        gcl.parseClass('''
dataSource {
	pooled = true
	driverClassName = "org.hsqldb.jdbcDriver"
	username = "sa"
	password = ""
    dbCreate = "create-drop" // one of 'create', 'create-drop','update'
    url = "jdbc:hsqldb:mem:testDB"
}
hibernate {
    cache.use_second_level_cache=true
    cache.use_query_cache=true
    cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}
''', "DataSource")

        ctx = new MockApplicationContext();

        def classes = getDomainClasses()

        gcl.getLoadedClasses().each {
            classes &lt;&lt; it
        }

        def ga = new DefaultGrailsApplication(classes as Class[], gcl)
        def mockManager = new MockGrailsPluginManager(ga)
        ctx.registerMockBean("manager", mockManager)
        PluginManagerHolder.setPluginManager(mockManager)

        def dependentPlugins = [
                DataSourceGrailsPlugin,
                DomainClassGrailsPlugin,
                I18nGrailsPlugin,
                MockHibernateGrailsPlugin
        ].collect { new DefaultGrailsPlugin(it, ga)}

        dependentPlugins.each { mockManager.registerMockPlugin(it); it.manager = mockManager }
        mockManager.doArtefactConfiguration();
        ctx.registerMockBean(PluginMetaManager.BEAN_ID, new DefaultPluginMetaManager());

        ga.initialise()
        ga.setApplicationContext(ctx);
        ApplicationHolder.setApplication(ga)
        ctx.registerMockBean(GrailsApplication.APPLICATION_ID, ga);
        ctx.registerMockBean("messageSource", new StaticMessageSource())

        def springConfig = new DefaultRuntimeSpringConfiguration(ctx, gcl)
        dependentPlugins*.doWithRuntimeConfiguration(springConfig)

        appCtx = springConfig.getApplicationContext()
        dependentPlugins*.doWithApplicationContext(appCtx)

        mockManager.applicationContext = appCtx
        mockManager.doDynamicMethods()

        sessionFactory = appCtx.getBean(GrailsRuntimeConfigurator.SESSION_FACTORY_BEAN);

        if (!TransactionSynchronizationManager.hasResource(sessionFactory)) {
            session = sessionFactory.openSession();
            TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
        }
    }

    abstract List getDomainClasses()

    protected void tearDown() {
        if (TransactionSynchronizationManager.hasResource(this.sessionFactory)) {
            SessionHolder holder = (SessionHolder) TransactionSynchronizationManager.getResource(this.sessionFactory);
            org.hibernate.Session s = holder.getSession();
            //s.flush();
            TransactionSynchronizationManager.unbindResource(this.sessionFactory);
            SessionFactoryUtils.releaseSession(s, this.sessionFactory);
        }

        ApplicationHolder.setApplication(null)
        ExpandoMetaClass.disableGlobally()
        PluginManagerHolder.setPluginManager(null)

        super.tearDown();
    }
}</pre>
<h4>MockGrailsPluginManager</h4>
<pre class="brush:groovy">package com.grailsgeek;

import groovy.lang.GroovyClassLoader;
import junit.framework.Assert;
import org.codehaus.groovy.grails.commons.DefaultGrailsApplication;
import org.codehaus.groovy.grails.commons.GrailsApplication;
import org.codehaus.groovy.grails.plugins.exceptions.PluginException;
import org.springframework.core.io.Resource;

import javax.servlet.ServletContext;
import java.io.File;
import java.io.Writer;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Map
import org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager
import org.codehaus.groovy.grails.plugins.GrailsPlugin;

/**
 * @author Graeme Rocher
 * @since 0.4
 *
 */

public class MockGrailsPluginManager extends AbstractGrailsPluginManager {
    private ServletContext servletContext;
    private boolean checkForChangesExpected = false;

    public ServletContext getServletContext() {
        return servletContext;
    }

    public MockGrailsPluginManager(GrailsApplication application) {
		super(application);
		loadPlugins();
	}

	public MockGrailsPluginManager() {
		this(new DefaultGrailsApplication(new Class[0], new GroovyClassLoader()));
	}

	public GrailsPlugin getGrailsPlugin(String name) {
		return this.plugins.get(name);
	}

	public GrailsPlugin getGrailsPlugin(String name, BigDecimal version) {
		return this.plugins.get(name);
	}

	public boolean hasGrailsPlugin(String name) {
		return this.plugins.containsKey(name);
	}

	public void registerMockPlugin(GrailsPlugin plugin) {
		this.plugins.put(plugin.getName(), plugin);
		this.pluginList.add(plugin);
	}

	public void loadPlugins() throws PluginException {
		this.initialised = true;
	}

	public void checkForChanges() {
        Assert.assertTrue(this.checkForChangesExpected);
        this.checkForChangesExpected = false;
    }

	public void doWebDescriptor(Resource descriptor, Writer target) {
		// do nothing
	}

	public void doWebDescriptor(File descriptor, Writer target) {
		// do nothing
	}

	public boolean isInitialised() {
		return true;
	}

    public void refreshPlugin(String name) {
        GrailsPlugin plugin = plugins.get(name);
        if(plugin != null) {
            plugin.refresh();
        }
    }

    public Collection getPluginObservers(GrailsPlugin plugin) {
        throw new UnsupportedOperationException("The class [MockGrailsPluginManager] doesn't support the method getPluginObservers");
    }

    public void informObservers(String pluginName, Map event) {
        // do nothing
    }

    public void setServletContext(ServletContext servletContext) {
        this.servletContext = servletContext;
    }

    public void expectCheckForChanges() {
        Assert.assertFalse(this.checkForChangesExpected);
        this.checkForChangesExpected = true;
    }

    public void verify() {
        Assert.assertFalse(this.checkForChangesExpected);
    }
}</pre>
<h4>MockHibernateGrailsPlugin</h4>
<pre class="brush:groovy">package com.grailsgeek

import org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport

class MockHibernateGrailsPlugin {
    def version = grails.util.GrailsUtil.getGrailsVersion()
    def dependsOn = [dataSource: version,
            i18n: version,
            core: version,
            domainClass: version]

    def loadAfter = ['controllers']
    def doWithSpring = HibernatePluginSupport.doWithSpring
    def doWithDynamicMethods = HibernatePluginSupport.doWithDynamicMethods
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/11/using-standalone-gorm-for-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assert image presence on page with Selenium</title>
		<link>http://grailsgeek.com/2009/07/assert-image-presence-on-page-with-selenium/</link>
		<comments>http://grailsgeek.com/2009/07/assert-image-presence-on-page-with-selenium/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 17:03:31 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[integration testing]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[image presence]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[integration-test]]></category>
		<category><![CDATA[selenium]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=61</guid>
		<description><![CDATA[Assume you have some images on your page under test, which has some images. You should be sure they are really displayed. Simple validation on image control presence doesn&#8217;t solves the problem, because &#60;img&#62; could have invalid source (src attribute). We will enhance our basic test with method which could be used like:
assertImagePresent("imgUnderTestId")
assertImagePresent() method could [...]]]></description>
			<content:encoded><![CDATA[<p>Assume you have some images on your page under test, which has some images. You should be sure they are really displayed. Simple validation on image control presence doesn&#8217;t solves the problem, because <span style="color: #333399;">&lt;img&gt;</span> could have invalid source (<span style="color: #333399;">src</span> attribute). We will enhance our basic test with method which could be used like:</p>
<pre class="brush:groovy">assertImagePresent("imgUnderTestId")</pre>
<p><span style="color: #333399;">assertImagePresent()</span> method could be used with <span style="color: #333399;">img</span> component <span style="color: #333399;">id</span> or with <span style="color: #333399;">XPath</span> locator to assert that image has nonzero width and height (such technique used because width and height under assertion are <em>real</em> dimensions of target image in already rendered page).</p>
<p>We will enhance our basic SeleniumTest (used as superclass for all integration test cases) again:</p>
<pre class="brush:groovy">public abstract class SeleniumTest extends SeleneseTestCase {
    static String context = "http://localhost:8080/app/"

    public void setUp() {
        setUp context, "*firefox"
    }
    ...
    def assertImagePresent(String imageIdOrXPathLocator) {
        assertTrue Integer.valueOf(getDomAttribute(imageIdOrXPathLocator, "naturalWidth")) &gt; 0
        assertTrue Integer.valueOf(getDomAttribute(imageIdOrXPathLocator, "naturalHeight")) &gt; 0
    }

    def getDomAttribute(String elementIdOrXPathLocator, String attribute) {
        if (elementIdOrXPathLocator.startsWith("//")) {
            def expression = "window.document.evaluate('${StringEscapeUtils.escapeJavaScript(elementIdOrXPathLocator)}', window.document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue['$attribute'];"
            return selenium.getEval(expression)
        } else {
            return selenium.getEval("window.document.getElementById('$elementIdOrXPathLocator')['$attribute'];")
        }
    }
    ...
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/assert-image-presence-on-page-with-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding WebFlow support to Maven driven Grails project</title>
		<link>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/</link>
		<comments>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 16:56:07 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[webflow]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=58</guid>
		<description><![CDATA[It&#8217;s just simple tip, but you could find it useful if you noob in Maven. WebFlow comes with Grails by default, but since we develop with Maven we should include this dependency manually. Just modify your Grails project pom.xml dependencies by including webflow reference:
&#60;?xml version="1.0" encoding="UTF-8"?&#62;
&#60;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&#62;
    ...
  [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s just simple tip, but you could find it useful if you noob in Maven. <span style="color: #333399;">WebFlow</span> comes with Grails by default, but since we develop with Maven we should include this dependency manually. Just modify your Grails project <span style="color: #333399;">pom.xml</span> dependencies by including webflow reference:</p>
<pre class="brush:xml">&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    ...
    &lt;dependencies&gt;
        ...
        &lt;dependency&gt;
            &lt;groupId&gt;org.grails&lt;/groupId&gt;
            &lt;artifactId&gt;grails-webflow&lt;/artifactId&gt;
            &lt;version&gt;1.1.1&lt;/version&gt;
        &lt;/dependency&gt;
        ...
    &lt;/dependencies&gt;
    ...
&lt;/project&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/adding-webflow-support-to-maven-driven-grails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attaching file to file upload control with Selenium (via JavaScript)</title>
		<link>http://grailsgeek.com/2009/07/attaching-file-to-file-upload-control-with-selenium-via-javascript/</link>
		<comments>http://grailsgeek.com/2009/07/attaching-file-to-file-upload-control-with-selenium-via-javascript/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 16:25:34 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[integration testing]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=48</guid>
		<description><![CDATA[I didn&#8217;t found useful way to set file inputs controls in our integration tests written with Selenium. I propose JavaScript way to execute with Selenium RC to achieve this. Finally this should be doable with following code in any Test Case:
setFile "fileInputId", getResourcePath("some photo.jpg")
getResourcePath() &#8211; returns path to resource (java/groovy resources meant). You could use [...]]]></description>
			<content:encoded><![CDATA[<p>I didn&#8217;t found useful way to set file inputs controls in our integration tests written with Selenium. I propose JavaScript way to execute with Selenium RC to achieve this. Finally this should be doable with following code in any Test Case:</p>
<pre class="brush:groovy">setFile "fileInputId", getResourcePath("some photo.jpg")</pre>
<p><span style="color: #333399;">getResourcePath()</span> &#8211; returns path to resource (java/groovy resources meant). You could use any path string instead, but inclusion of resources (test resources) is more convenient, because they become part of your test environment. If you have some problems with java/groovy resources, feel free to ask.</p>
<p>* We will extend our SeleniumTest (basic class for all integration tests  with this method:</p>
<pre class="brush:groovy">public abstract class SeleniumTest extends SeleneseTestCase {
    static String context = "http://localhost:8080/app/"

    public void setUp() {
        setUp context, "*firefox"
    }
    ...
    void setFile(String fileInputId, String fileName) {
        selenium.getEval(
            """var imageControl = window.document.getElementById('${fileInputId}');
               imageControl.value='$fileName';
               var event = window.document.createEvent('HTMLEvents');
               event.initEvent('change',true,true);
               imageControl.dispatchEvent(event);
            """)
    }

    String getResourcePath(String resourcePath) {
        getClass().getResource(resourcePath).getPath()
    }
    ...
}</pre>
<p>This method uses <span style="color: #333399;">document</span> model to inject file path into HTML <span style="color: #333399;">file input</span> control and also generates <span style="color: #333399;">onChange</span> event, which could be useful if onChange event handler defined for this component.</p>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/attaching-file-to-file-upload-control-with-selenium-via-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS convention for Grails</title>
		<link>http://grailsgeek.com/2009/07/css-convention-for-grails/</link>
		<comments>http://grailsgeek.com/2009/07/css-convention-for-grails/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 15:58:16 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[CSS convention]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/?p=43</guid>
		<description><![CDATA[As far as our CSS styles grow I found that there should intuitive way to manage CSS inclusions. I&#8217;ve decided to follow great Grails fundamental idea and place them by some convention and include automagically.
We found useful to have separate CSS for each view (or controller action if you wish). Convention is simple: place each [...]]]></description>
			<content:encoded><![CDATA[<p>As far as our CSS styles grow I found that there should intuitive way to manage CSS inclusions. I&#8217;ve decided to follow great Grails fundamental idea and place them by some convention and include automagically.</p>
<p>We found useful to have separate CSS for each view (or controller action if you wish). Convention is simple: place each CSS in the same path as you place your views under <span style="color: #333399;">/views</span> folder.</p>
<p>For example, we have view: <span style="color: #333399;">/views/picture/gallery.gsp</span> and want to have <span style="color: #333399;">gallery.css</span> which contains all styles for this view. We should place it in the same path as our view located, in our example it should be <span style="color: #333399;">/web-app/css/picture/gallery.css</span>. Now to automatically include such CSSs by convention we should modify our main layout (<span style="color: #333399;">/views/layouts/main.gsp</span>) next way:</p>
<pre class="brush:groovy">&lt;head&gt;
...
&lt;% if (webRequest.controllerName &amp;&amp; webRequest.actionName) { %&gt;
    &lt;link rel="stylesheet" href="${resource(dir: 'css/' + webRequest.getControllerName(), file: webRequest.getActionName() + '.css')}"/&gt;
&lt;% } %&gt;
...
&lt;/head&gt;</pre>
<p>All further CSSs placed by this convention will be automatically included for each action (which uses <span style="color: #333399;">main</span> layout) . If you have more layouts you could modify them same way. Anyway their count will be much less than your actions/views count.</p>
<p>Hope this helps. If you have some ideas to improve this approach or you use some other approach, please share :)</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/07/css-convention-for-grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails, Selenium, Maven and integration testing</title>
		<link>http://grailsgeek.com/2009/06/grails-selenium-maven-and-integration-testing/</link>
		<comments>http://grailsgeek.com/2009/06/grails-selenium-maven-and-integration-testing/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 17:32:00 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[integration testing]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[grails-maven-plugin]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[jetgroovy]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[selenium java-client-drivers]]></category>
		<category><![CDATA[selenium rc]]></category>
		<category><![CDATA[surefire plugin]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/2009/06/grails-selenium-maven-and-integration-testing/</guid>
		<description><![CDATA[Today I wanna share with you my experience of configuring Selenium RC (with Java client drivers), Maven, Surefire to develop and run integration tests on Grails applications. We will build Grails demo application in Intellij IDEA (with Maven project model behind) and run simple integration test written in Groovy using Selenium RC.
Creating project structure

Create &#8220;demo&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Today I wanna share with you my experience of configuring Selenium RC (with Java client drivers), Maven, Surefire to develop and run integration tests on Grails applications. We will build Grails demo application in Intellij IDEA (with Maven project model behind) and run simple integration test written in Groovy using Selenium RC.</p>
<h4>Creating project structure</h4>
<ul>
<li>Create &#8220;demo&#8221; directory in your projects dir an step inside it.</li>
</ul>
<ul>
<li>Create basic Grails application with Maven by running:</li>
</ul>
<pre class="brush:bash">mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.0 -DgroupId=com.grailsgeek -DartifactId=maven-grails-demo</pre>
<p>Fix Grails application pom.xml with tips I described in <a href="http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/" target="_blank">my previous post</a>.</p>
<ul>
<li>Create integration-test module by running:</li>
</ul>
<pre class="brush:bash">mvn archetype:create -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=com.grailsgeek -DartifactId=integration-test</pre>
<p>And don&#8217;t forget to remove App and AppTest from sources that were generated by Maven.</p>
<ul>
<li>You should stay in your main project dir &#8220;demo&#8221;. Create multi-module pom.xml in project root dir with following content:</li>
</ul>
<pre class="brush:xml">&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                      http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.grailsgeek&lt;/groupId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;artifactId&gt;demo&lt;/artifactId&gt;
    &lt;packaging&gt;pom&lt;/packaging&gt;
    &lt;modules&gt;
        &lt;module&gt;demo-app&lt;/module&gt;
        &lt;module&gt;integration-test&lt;/module&gt;
    &lt;/modules&gt;
&lt;/project&gt;</pre>
<ol>
<li>Now run <span style="color: #333399;">mvn install</span><span style="color: #99ff99;"> </span> from project root directory, and see <span style="color: #333399;">&#8220;BUILD SUCCESSFUL&#8221;</span> ;)</li>
</ol>
<h4>Adding necessary dependencies to maven poms</h4>
<p>We are going to modify only &lt;build&gt; sections of each pom. So If you extending your existing application with integration tests you&#8217;ll need to make just few adjustments.</p>
<ul>
<li>Grails application pom (our demo-app). Go to<span style="color: #333399;"> &lt;build&gt; -&gt; &lt;plugins&gt;</span> section and insert jetty plugin:</li>
</ul>
<pre class="brush:xml">            &lt;plugin&gt;
                &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
                &lt;artifactId&gt;maven-jetty-plugin&lt;/artifactId&gt;
                &lt;version&gt;6.1.10&lt;/version&gt;
                &lt;configuration&gt;
                    &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
                    &lt;stopKey&gt;foo&lt;/stopKey&gt;
                    &lt;stopPort&gt;9999&lt;/stopPort&gt;
                &lt;/configuration&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;id&gt;start-jetty&lt;/id&gt;
                        &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;run-war&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;scanIntervalSeconds&gt;0&lt;/scanIntervalSeconds&gt;
                            &lt;daemon&gt;true&lt;/daemon&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                    &lt;execution&gt;
                        &lt;id&gt;stop-jetty&lt;/id&gt;
                        &lt;phase&gt;post-integration-test&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;stop&lt;/goal&gt;
                        &lt;/goals&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;</pre>
<p>We&#8217;ll use it to launch our Grails application in the &#8220;integration-test&#8221; phase. And will click with Selenium on it, but a bit later about all that.</p>
<ol>
<li>Integration tests module. I&#8217;ll post here entire pom.xml because it&#8217;s not aware about project under test, only groupId could differ.</li>
</ol>
<pre class="brush:xml">&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.grailsgeek&lt;/groupId&gt;
  &lt;artifactId&gt;integration-test&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;integration-test&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
            &lt;artifactId&gt;groovy&lt;/artifactId&gt;
            &lt;version&gt;1.6.3&lt;/version&gt;
        &lt;/dependency&gt;

        &lt;dependency&gt;
            &lt;groupId&gt;org.seleniumhq.selenium.client-drivers&lt;/groupId&gt;
            &lt;artifactId&gt;selenium-java-client-driver&lt;/artifactId&gt;
            &lt;version&gt;1.0-beta-2&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
        &lt;plugins&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.groovy.maven&lt;/groupId&gt;
                &lt;artifactId&gt;gmaven-plugin&lt;/artifactId&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;id&gt;test-compile&lt;/id&gt;
                        &lt;phase&gt;test-compile&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;generateTestStubs&lt;/goal&gt;
                            &lt;goal&gt;testCompile&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;sources&gt;
                                &lt;fileset&gt;
                                    &lt;directory&gt;${pom.basedir}/src/test&lt;/directory&gt;
                                    &lt;includes&gt;
                                        &lt;include&gt;**/*.groovy&lt;/include&gt;
                                    &lt;/includes&gt;
                                &lt;/fileset&gt;
                            &lt;/sources&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                &lt;artifactId&gt;selenium-maven-plugin&lt;/artifactId&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;phase&gt;pre-integration-test&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;start-server&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;background&gt;true&lt;/background&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;skip&gt;true&lt;/skip&gt;
                &lt;/configuration&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;id&gt;surefire-it&lt;/id&gt;
                        &lt;phase&gt;integration-test&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;test&lt;/goal&gt;
                        &lt;/goals&gt;
                        &lt;configuration&gt;
                            &lt;skip&gt;false&lt;/skip&gt;
                        &lt;/configuration&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
            &lt;/plugin&gt;
            &lt;plugin&gt;
                &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;source&gt;1.5&lt;/source&gt;
                    &lt;target&gt;1.5&lt;/target&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
        &lt;/plugins&gt;
    &lt;/build&gt;

    &lt;repositories&gt;
        &lt;repository&gt;
            &lt;id&gt;seleniumhq&lt;/id&gt;
            &lt;name&gt;seleniumhq&lt;/name&gt;
            &lt;url&gt;http://nexus.openqa.org/content/repositories/releases/&lt;/url&gt;
        &lt;/repository&gt;
    &lt;/repositories&gt;
&lt;/project&gt;</pre>
<p>I propose to run <span style="color: #333399;">&#8220;mvn integration-test&#8221;</span> from project root, and see what will happen now. There are no tests yet, but Maven should resolve all dependencies and pass all execution phases.<span style="color: #333399;"> &#8220;BUILD SUCCESSFUL&#8221;</span> means that we could go on :)</p>
<h4>Preparing simple functionality for our tests</h4>
<p>Import our Maven project into Intellij IDEA as I described in <a href="http://me-on-grails.blogspot.com/2009/06/grails-111-and-maven2-in-intellij-idea.html">my previous post</a>.</p>
<p>Now I&#8217;m creating domain class Message:</p>
<pre class="brush:groovy">public class Message {
    String text
}</pre>
<p>And controller for it:</p>
<pre class="brush:groovy">class MessageController {
    def scaffold = true
}</pre>
<p>That&#8217;s it, our application is ready to be tested.</p>
<h4>Writing first Selenium test</h4>
<p>Switch to integration-test module, and create <span style="color: #333399;">&#8220;integration-test/test/java/com/grailsgeek/MessageTest.groovy&#8221;</span>:</p>
<pre class="brush:groovy">package com.grailsgeek

import com.thoughtworks.selenium.SeleneseTestCase

public class MessageTest extends SeleneseTestCase {

    public void setUp() {
        setUp "http://localhost:8080/demo-app/", "*firefox"
    }

    void testCreateMessage() {
        selenium.with {
            speed = "3000"

            open "message"
            waitPage()
            assertEquals "Message List", title

            click "//a[text()=\"New Message\"]"
            waitPage()
            assertEquals "Create Message", title

            type "text","Message Text ;)"
            click "//input[@value=\"Create\"]"
            waitPage()
            assertEquals "Show Message", title

            assertTrue isTextPresent ("Message Text ;)")
        }
    }

    private def waitPage() {
        selenium.waitForPageToLoad "30000"
    }
}</pre>
<h4>Running tests from Maven</h4>
<p>Run<span style="color: #333399;"> &#8220;mvn integration-test&#8221;</span> from project root directory and enjoy :). But since your project is going to grow fast (I hope so) or you already big enough, you could experience problems with out of memory error (<span style="color: #333399;">PermGen</span> space) due to Groovy dynamism. You could easy solve this by adding <span style="color: #333399;">&#8220;MAVEN_OPTS=-Xmx512m -XX:MaxPermSize=256m&#8221;</span> to your environment variables.</p>
<h4>Running tests from Intellij IDEA</h4>
<ol>
<li>Go to &#8220;Maven&#8221; context (at the right edge).</li>
<li>Run your application <span style="color: #333399;">&#8220;demo -&gt; Modules -&gt; demo-app -&gt; Plugins -&gt; grails -&gt; grails:run-app&#8221;</span> or just run IDEA grails configuration which should be already available.</li>
<li>Run Selenium with <span style="color: #333399;">&#8220;demo -&gt; Modules -&gt; integration-test -&gt; Plugins -&gt; selenium -&gt; selenium:start-server&#8221;</span></li>
<li>Execute your MessageTest.</li>
</ol>
<p>Intellij IDEA allows you to save run configuration for ease of further use (<span style="color: #333399;">selenium:start-server</span> and<span style="color: #333399;"> grails:run-app </span>could be saved as preconfigured). Also you there is no need to restart your application each time you made some changes. Grails will take care of it as usual.</p>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/06/grails-selenium-maven-and-integration-testing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Announce</title>
		<link>http://grailsgeek.com/2009/06/announce/</link>
		<comments>http://grailsgeek.com/2009/06/announce/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 12:23:00 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[the rest]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/2009/06/announce/</guid>
		<description><![CDATA[Next I&#8217;ll try to describe how to write integration tests with Selenium on Grails driven by Surefire Maven plugin
]]></description>
			<content:encoded><![CDATA[<p>Next I&#8217;ll try to describe how to write integration tests with Selenium on Grails driven by Surefire Maven plugin</p>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/06/announce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Settin&#8217; up Grails 1.1.1. with Grails Maven Plugin in Intellij IDEA + JetGroovy</title>
		<link>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/</link>
		<comments>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:02:00 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[grails-maven-plugin]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[jetgroovy]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[setup]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/2009/06/grails-1-1-1-and-maven2-in-intellij-idea/</guid>
		<description><![CDATA[Grails Maven Plugin is still non predictable and it&#8217;s 1.0 version supports only 1.1 version of Grails. 1.1-SNAPSHOT version supports grails 1.1.1 but there are still misunderstandings with Grails plugins are exist (Grails wants to store them in your user home, but  Grails Maven plugin wants them to be stored in your application dir).
As for [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Grails Maven Plugin is still non predictable and it&#8217;s <span style="color: #333399;">1.0</span> version supports only <span style="color: #333399;">1.1</span> version of Grails.<span style="color: #333399;"> 1.1-SNAPSHOT</span> version supports grails <span style="color: #333399;">1.1.1</span> but there are still misunderstandings with Grails plugins are exist (Grails wants to store them in your user home, but  Grails Maven plugin wants them to be stored in your application dir).</p>
<p style="text-align: justify;">As for now I&#8217;m trying to avoid using plugins from Grails, and include all libraries directly with Maven dependencies.</p>
<p style="text-align: justify;">1. Make your maven know where to get <span style="color: #333399;">grails-maven-plugin</span> by editing your<span style="color: #333399;"> /.m2/settings.xml </span>(create it if there is no one exist):</p>
<pre class="brush:xml">&lt;settings&gt;
    &lt;pluginGroups&gt;
        &lt;pluginGroup&gt;org.grails&lt;/pluginGroup&gt;
    &lt;/pluginGroups&gt;
&lt;/settings&gt;</pre>
<p>2. Go to secret place where you store you projects and run:</p>
<pre class="brush:bash">mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.grails -DarchetypeArtifactId=grails-maven-archetype -DarchetypeVersion=1.0 -DgroupId=example -DartifactId=maven-grails-demo</pre>
<p>3. Now open just generated pom.xml and make following changes:</p>
<ul>
<li>
<div class="western">change versions of <em>grails-crud </em>and  <em>grails-gorm </em><span style="font-style: normal;">from <span style="color: #333399;">“1.1”</span> to<span style="color: #333399;"> “1.1.1”</span></span></div>
</li>
<li>
<div class="western"><span style="font-style: normal;">change </span><em>grails-maven-plugin </em><span style="font-style: normal;">version  from <span style="color: #333399;">“1.0”</span> to <span style="color: #333399;">“1.1-SNAPSHOT”</span></span></div>
</li>
</ul>
<div class="western"><span style="font-style: normal;"> 4. Run <span style="color: #333399;">“mvn initialize”</span> from your project root.</span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> 5. One more trick, that should be applied for 1.1-SNAPSHOT version of  <span style="font-style: italic;">grails-maven-plugin </span>to make it work: add following dependency to your pom.xml (see <a href="http://jira.codehaus.org/browse/GRAILS-4574">http://jira.codehaus.org/browse/GRAILS-4574</a> for details):<br />
</span></div>
<pre class="brush:xml">&lt;dependency&gt;
    &lt;groupId&gt;org.tmatesoft.svnkit&lt;/groupId&gt;
    &lt;artifactId&gt;svnkit&lt;/artifactId&gt;
    &lt;version&gt;1.2.3.5521&lt;/version&gt;
    &lt;scope&gt;runtime&lt;/scope&gt;
&lt;/dependency&gt;</pre>
<p style="text-align: justify;"><span style="font-style: normal;"> 6. Now, it&#8217;s time to import your maven project into <span style="color: #333399;">Intellij IDEA </span>(I recommend to use latest EAP <a href="http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP">http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP</a>). You can do it by <span style="color: #333399;">“Create New Project → Import Project from External Model → Maven&#8230;”</span>. </span></p>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> Pay attention to Facets that Idea will detect on project import finished. Hint: look in right bottom corner for round icon with “i” on it, if Idea won&#8217;t show you dialog window with detected facets. Facets detection is important to let Idea know that it&#8217;s Grails application. </span></div>
<div class="western"><span style="font-style: normal;"> </span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"> Now close and reopen project again to let JetGroovy plugin use facets and treat application directories in a right way. You should see<span style="color: #333399;"> “Grails:maven-grails-demo”</span> preselected in IDEA&#8217;s run/debug configurations combo. If it&#8217;s so – you on the right way and JetGroovy knows that it&#8217;s Grails application. If not – try to fix it in<span style="color: #99ff99;"> <span style="color: #333399;">“module settings → facets”</span></span>. If you didn&#8217;t make it – contact me, I&#8217;ll try to help.</span></div>
<div class="western" style="text-align: justify;"><span style="font-style: normal;"><br />
</span></div>
<div class="western"><span style="font-style: normal;"> You probably already tried to run application but all you&#8217;ve got was:</span></div>
<pre><span style="font-style: normal;">Exception in thread "main" java.lang.ClassNotFoundException: org.codehaus.groovy.grails.cli.support.GrailsStarter</span><span style="font-style: normal;"> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)</span><span style="font-style: normal;"> at java.security.AccessController.doPrivileged(Native Method)</span><span style="font-style: normal;"> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClass(ClassLoader.java:307)</span><span style="font-style: normal;"> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClass(ClassLoader.java:252)</span><span style="font-style: normal;"> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)</span><span style="font-style: normal;"> at java.lang.Class.forName0(Native Method)</span><span style="font-style: normal;"> at java.lang.Class.forName(Class.java:169)</span><span style="font-style: normal;"> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:87)</span></pre>
<div style="text-align: justify;"><span style="font-style: normal;"> Don&#8217;t worry. It&#8217;s because grails-maven-plugin depends on grails-core which not contain GrailsStarter. It&#8217;s available in standalone Grails distribution. First of all you are still able to run grails application with <span style="color: #333399;">“Maven Projects → maven-grails-demo → Plugins → grails → grails:run-app” </span>or just by running <span style="color: #333399;">“mvn grails:run-app”</span> from project root. If you still want to run your application from run configuration in Idea you could or create run configuration from Maven goal, by clicking on with right button and selecting appropriate menu item or by installing standalone Grails and telling IDEA where it is. </span></div>
<h4 style="text-align: justify;"><span style="font-style: normal;">Setting up standalone Grails for your application<br />
</span></h4>
<ul>
<li><span style="font-style: normal;">Install  Grails as described <a href="http://grails.org/Installation">http://grails.org/Installation</a>. </span></li>
<li>
<div class="western" style="text-align: justify;"><span style="font-style: normal;">Go to<span style="color: #333399;"> module  settings → Groovy → click “Add&#8230;” → Create new Grails  SDK&#8230; → Tell Idea where your standalone Grails is → Click  “Replace” </span>(not “Add”, important) in dialog appeared</span></div>
</li>
</ul>
<div class="western"><span style="font-style: normal;"> Now you able to run your Grails application directly from Idea with JetGroovy plugin. Enjoy ;)</span></div>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/06/grails-and-maven2-in-intellij-idea/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Greetings!</title>
		<link>http://grailsgeek.com/2009/06/greetings/</link>
		<comments>http://grailsgeek.com/2009/06/greetings/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 09:43:00 +0000</pubDate>
		<dc:creator>Alexander Naumenko</dc:creator>
				<category><![CDATA[the rest]]></category>

		<guid isPermaLink="false">http://grailsgeek.com/2009/06/greetings/</guid>
		<description><![CDATA[Hi, dear Community! I&#8217;ve just get back into Grails experiments after few months time-out. I&#8217;m going to share with you all essential solutions that I found already or just going to.
]]></description>
			<content:encoded><![CDATA[<p>Hi, dear Community! I&#8217;ve just get back into Grails experiments after few months time-out. I&#8217;m going to share with you all essential solutions that I found already or just going to.</p>
]]></content:encoded>
			<wfw:commentRss>http://grailsgeek.com/2009/06/greetings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
