You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2014/12/24 00:45:36 UTC
[4/4] tapestry-5 git commit: Choose a different set of classes for
the test
Choose a different set of classes for the test
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/fe8ef854
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/fe8ef854
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/fe8ef854
Branch: refs/heads/master
Commit: fe8ef85454b93d5863e6c6ccd16d1c677e62ea4e
Parents: 15a3317
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Dec 23 15:45:22 2014 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Dec 23 15:45:22 2014 -0800
----------------------------------------------------------------------
.../groovy/ioc/specs/ClasspathScannerImplSpec.groovy | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/fe8ef854/tapestry-ioc/src/test/groovy/ioc/specs/ClasspathScannerImplSpec.groovy
----------------------------------------------------------------------
diff --git a/tapestry-ioc/src/test/groovy/ioc/specs/ClasspathScannerImplSpec.groovy b/tapestry-ioc/src/test/groovy/ioc/specs/ClasspathScannerImplSpec.groovy
index 4ddd6df..a0aa7f7 100644
--- a/tapestry-ioc/src/test/groovy/ioc/specs/ClasspathScannerImplSpec.groovy
+++ b/tapestry-ioc/src/test/groovy/ioc/specs/ClasspathScannerImplSpec.groovy
@@ -1,10 +1,10 @@
package ioc.specs
-import org.apache.tapestry5.ioc.Locatable
-import org.apache.tapestry5.ioc.internal.BasicTypeCoercions
+import org.apache.tapestry5.ioc.Registry
import org.apache.tapestry5.ioc.internal.services.ClasspathScannerImpl
import org.apache.tapestry5.ioc.internal.services.ClasspathURLConverterImpl
import org.apache.tapestry5.ioc.services.ClasspathMatcher
+import org.apache.tapestry5.ioc.util.IdAllocator
import spock.lang.Specification
class ClasspathScannerImplSpec extends Specification {
@@ -18,7 +18,7 @@ class ClasspathScannerImplSpec extends Specification {
def scannerJob = new ClasspathScannerImpl.Job(matchAll, Thread.currentThread().getContextClassLoader(), new ClasspathURLConverterImpl())
when:
- URL url = Locatable.class.getResource('Locatable.class');
+ URL url = Registry.class.getResource('Registry.class');
scannerJob.scanDir("org/apache/tapestry5/ioc/", new File(url.getPath()).parentFile)
while (!scannerJob.queue.isEmpty()) {
def queued = scannerJob.queue.pop();
@@ -29,7 +29,10 @@ class ClasspathScannerImplSpec extends Specification {
def classes = scannerJob.matches
then:
- classes.contains(BasicTypeCoercions.name.replaceAll(/\./, "/") + '.class')
+
+ // classes will contain many names, this choice is arbitrary. The point is, it is located on the file system
+ // (not in a JAR) and it is in a package somewhere beneath the scanDir.
+ classes.contains(IdAllocator.name.replaceAll(/\./, "/") + '.class')
}