Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Gallego authored and Ivan Gallego committed Feb 14, 2013
2 parents 4d56898 + 2e8eeb9 commit 1003f41
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
Expand Up @@ -162,7 +162,7 @@ public Object remove(Object o) {
public void putAll(Map map) {
for (Iterator i = map.keySet().iterator(); i.hasNext();) {
Object key = i.next();
put(key, map.get(i));
put(key, map.get(key));
}
}

Expand Down Expand Up @@ -227,8 +227,8 @@ public Set<MapEntry> entrySet() {
private boolean isExcluded(MetaProperty mp) {
return
Modifier.isStatic(mp.getModifiers()) ||
EXCLUDES.contains(mp.getName()) ||
GrailsDomainConfigurationUtil.isConfigurational(mp.getName()) ||
(mp instanceof MetaBeanProperty) && (((MetaBeanProperty) mp).getGetter()) == null;
EXCLUDES.contains(mp.getName()) ||
GrailsDomainConfigurationUtil.isConfigurational(mp.getName()) ||
(mp instanceof MetaBeanProperty) && (((MetaBeanProperty) mp).getGetter()) == null;
}
}
@@ -0,0 +1,30 @@
package org.codehaus.groovy.grails.commons.metaclass

import grails.test.mixin.TestMixin
import grails.test.mixin.support.GrailsUnitTestMixin
import spock.lang.Specification

/**
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
*/
@TestMixin(GrailsUnitTestMixin)
class LazyMetaPropertyMapSpec extends Specification {

def setup() {
}

def cleanup() {
}

void "test putAll adds all key and value pairs provided to this map"() {
given:
def targetMap = new LazyMetaPropertyMap(new A())
when:
targetMap.putAll([someProperty:"a value"])
then:
targetMap == [someProperty:"a value"]
}
}
class A {
def someProperty = "value"
}
Expand Up @@ -29,6 +29,7 @@ import org.junit.runner.notification.RunListener
* Listens in on the execution of an entire test suite (or test "type" in Grails) and creates
* new TestRunListeners for each actual test class.
*/
@groovy.transform.CompileStatic
class SuiteRunListener extends RunListener {

private final GrailsTestEventPublisher eventPublisher
Expand Down Expand Up @@ -58,7 +59,7 @@ class SuiteRunListener extends RunListener {
void testAssumptionFailure(Failure failure) {
// assumptions (and AssumptionViolatedException) are specific to JUnit,
// and are treated as ordinary failures
getPerTestRunListener(description).testFailure(failure)
getPerTestRunListener(failure.description).testFailure(failure)
}

void testFinished(Description description) {
Expand All @@ -73,7 +74,7 @@ class SuiteRunListener extends RunListener {
// nothing to do
}

private getPerTestRunListener(description = null) {
private PerTestRunListener getPerTestRunListener(Description description = null) {
if (description && perTestListener?.name != description.className) {
perTestListener?.finish()

Expand Down

0 comments on commit 1003f41

Please sign in to comment.