Search in sources :

Example 1 with DefaultGrailsPlugin

use of org.grails.plugins.DefaultGrailsPlugin in project grails-core by grails.

the class DefaultGrailsPluginTests method testDisabledPlugin.

public void testDisabledPlugin() {
    GrailsPlugin disabledPlugin = new DefaultGrailsPlugin(disabled, ga);
    GrailsPlugin enabledPlugin = new DefaultGrailsPlugin(versioned, ga);
    assertFalse(disabledPlugin.isEnabled());
    assertTrue(enabledPlugin.isEnabled());
}
Also used : GrailsPlugin(grails.plugins.GrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin)

Example 2 with DefaultGrailsPlugin

use of org.grails.plugins.DefaultGrailsPlugin in project grails-core by grails.

the class DefaultGrailsPluginTests method testGetVersion.

public void testGetVersion() {
    GrailsPlugin versionPlugin = new DefaultGrailsPlugin(versioned, ga);
    assertEquals("1.1", versionPlugin.getVersion());
}
Also used : GrailsPlugin(grails.plugins.GrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin)

Example 3 with DefaultGrailsPlugin

use of org.grails.plugins.DefaultGrailsPlugin in project grails-core by grails.

the class DefaultGrailsPluginTests method testWatchedResources.

public void testWatchedResources() {
    GrailsPlugin versionPlugin = new DefaultGrailsPlugin(versioned, ga);
    assertEquals(versionPlugin.getWatchedResourcePatterns().get(0).getDirectory().getPath(), "./grails-app/taglib".replace("/", File.separator));
    assertEquals(versionPlugin.getWatchedResourcePatterns().get(1).getDirectory().getPath(), "./grails-app/controller".replace("/", File.separator));
    assertEquals(versionPlugin.getWatchedResourcePatterns().get(2).getDirectory().getPath(), "/absolutePath".replace("/", File.separator));
}
Also used : GrailsPlugin(grails.plugins.GrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin)

Example 4 with DefaultGrailsPlugin

use of org.grails.plugins.DefaultGrailsPlugin in project grails-core by grails.

the class DefaultGrailsPluginTests method testDefaultGrailsPlugin.

public void testDefaultGrailsPlugin() {
    @SuppressWarnings("unused") GrailsPlugin versionPlugin = new DefaultGrailsPlugin(versioned, ga);
    try {
        @SuppressWarnings("unused") GrailsPlugin notVersionPlugin = new DefaultGrailsPlugin(notVersion, ga);
        fail("Should have thrown IllegalArgumentException for unversioned plugin");
    } catch (PluginException e) {
    // expected
    }
    try {
        @SuppressWarnings("unused") GrailsPlugin notPlugin = new DefaultGrailsPlugin(notPluginClass, ga);
        fail("Should have thrown an exception for invalid plugin");
    } catch (IllegalArgumentException e) {
    // expected
    }
}
Also used : GrailsPlugin(grails.plugins.GrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin) PluginException(grails.plugins.exceptions.PluginException) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin)

Example 5 with DefaultGrailsPlugin

use of org.grails.plugins.DefaultGrailsPlugin in project grails-core by grails.

the class DefaultGrailsPluginTests method testGetPluginPath.

public void testGetPluginPath() {
    GrailsPlugin versionPlugin = new DefaultGrailsPlugin(versioned, ga);
    assertEquals("/plugins/my-1.1", versionPlugin.getPluginPath());
    GrailsPlugin camelCasedPlugin = new DefaultGrailsPlugin(camelCased, ga);
    assertEquals("/plugins/camel-cased-2.1", camelCasedPlugin.getPluginPath());
}
Also used : GrailsPlugin(grails.plugins.GrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin) DefaultGrailsPlugin(org.grails.plugins.DefaultGrailsPlugin)

Aggregations

GrailsPlugin (grails.plugins.GrailsPlugin)9 DefaultGrailsPlugin (org.grails.plugins.DefaultGrailsPlugin)9 DefaultRuntimeSpringConfiguration (org.grails.spring.DefaultRuntimeSpringConfiguration)2 RuntimeSpringConfiguration (org.grails.spring.RuntimeSpringConfiguration)2 ApplicationContext (org.springframework.context.ApplicationContext)2 PluginException (grails.plugins.exceptions.PluginException)1