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());
}
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());
}
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));
}
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
}
}
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());
}
Aggregations