This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test ":karma-test-runner:0.2.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import de.is24.util.karmatestrunner.junit.KarmaTestSuiteRunner | |
import org.junit.runner.RunWith | |
@RunWith(KarmaTestSuiteRunner.class) | |
@KarmaTestSuiteRunner.KarmaConfigPath("./path/to/karma.conf.js") | |
public class JavaScriptUnitTestKarmaSuite { | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
karma init config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent { | |
Long id | |
static hasMany =[ children: Child ] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CriteriaIntegrationSpec extends IntegrationSpec { | |
void "Nested criteria property ordering should ignoreCase properly"() { | |
given: 'A parent class and its child classes' | |
Parent parent = new Parent().save() | |
Child child1 = new Child(age: 100, name: 'Apollo', parent: parent).save() | |
Child child2 = new Child(age: 200, name: 'Zeus', parent: parent).save() | |
Child child3 = new Child(age: 300, name: 'athena', parent: parent).save() | |
when: 'a criteria call is ordered by a String property' | |
List names = Parent.createCriteria().list() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
order('name', 'asc').ignoreCase() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
order(Order.asc('name').ignoreCase()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CriteriaIntegrationSpec extends IntegrationSpec { | |
void "Nested criteria property ordering should ignoreCase properly"() { | |
given: 'A parent class and its child classes' | |
Parent parent = new Parent().save() | |
Child child1 = new Child(age: 10, name: 'Apollo', parent: parent).save()//1 | |
Child child3 = new Child(age: 20, name: 'Zeus', parent: parent).save()//3 | |
Child child2 = new Child(age: 30, name: 'athena', parent: parent).save()//2 | |
when: 'a criteria call is ordered by a String property' | |
List names = Parent.createCriteria().list() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List names = Child.createCriteria().list() { // Instead of Parent.createCriteria() | |
eq('parent', parent) | |
gt('age', 5) | |
projections { | |
property('name') | |
} | |
order(Order.asc('name').ignoreCase()) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.igor | |
import grails.validation.Validateable | |
@Validateable | |
class GormTagLibUser { | |
String username | |
String firstName | |
String middleName | |
String lastName |