[
https://jira.jboss.org/jira/browse/JBREFLECT-99?page=com.atlassian.jira.p...
]
Flavia Rainone updated JBREFLECT-99:
------------------------------------
Summary: AbstractIsLocalResourcePlugin.isSameInParent requires filtereing for
running tests (was: AbstractIsLocalResourcePlugin.isSameInParent relies on
ClassLoader.getResource instead of ClassPool.find)
Issue Type: Task (was: Bug)
Description:
The issue involves the method below:
protected boolean isSameInParent(String classResourceName, URL foundURL)
{
ClassPool parent = pool.getParent();
if (parent != null)
{
ClassLoader parentLoader = parent.getClassLoader();
URL parentURL = parentLoader.getResource(classResourceName);
if (parentURL == null)
{
return false;
}
URI parentURI = URI.create(parentURL.toString());
URI foundURI = URI.create(foundURL.toString());
if (parentURI.equals(foundURI))
{
return true;
}
}
return false;
}
The tests are failing with the new VFS whenever parentURL is not null.
With the old VFS, the lines that try to create a URI from the URL would always fail,
since the URL would return a vfs:// file.
With VFS 3, the URL contains file:// instead, thus affecting the result of the method and
allowing that all parent SystemClassPools find the classes in the excluded package during
test execution.
To fix that, we need to write a IsLocalResourcePlugin tailored for tests only. This plugin
should include filtering in the isSameInParent method above, thus avoiding that classes in
the excluded package be found by the system classpool during test execution.
was:
This bug has been covered by the old vfs (version 2):
rotected boolean isSameInParent(String classResourceName, URL foundURL)
{
ClassPool parent = pool.getParent();
if (parent != null)
{
ClassLoader parentLoader = parent.getClassLoader();
URL parentURL = parentLoader.getResource(classResourceName);
if (parentURL == null)
{
return false;
}
URI parentURI = URI.create(parentURL.toString());
URI foundURI = URI.create(foundURL.toString());
if (parentURI.equals(foundURI))
{
return true;
}
}
return false;
}
The lines that try to create a URI from the URL fail, since the URL would return a vfs://
file. With VFS 3, the URL contains file:// instead, thus affecting the result of the
method and uncovering the error.
AbstractIsLocalResourcePlugin.isSameInParent requires filtereing for
running tests
----------------------------------------------------------------------------------
Key: JBREFLECT-99
URL:
https://jira.jboss.org/jira/browse/JBREFLECT-99
Project: JBoss Reflection
Issue Type: Task
Components: Class Pool
Affects Versions: JBossReflection.2.2.0-Alpha3
Reporter: Flavia Rainone
Assignee: Flavia Rainone
Fix For: JBossReflection.2.2.0-Alpha4
The issue involves the method below:
protected boolean isSameInParent(String classResourceName, URL foundURL)
{
ClassPool parent = pool.getParent();
if (parent != null)
{
ClassLoader parentLoader = parent.getClassLoader();
URL parentURL = parentLoader.getResource(classResourceName);
if (parentURL == null)
{
return false;
}
URI parentURI = URI.create(parentURL.toString());
URI foundURI = URI.create(foundURL.toString());
if (parentURI.equals(foundURI))
{
return true;
}
}
return false;
}
The tests are failing with the new VFS whenever parentURL is not null.
With the old VFS, the lines that try to create a URI from the URL would always fail,
since the URL would return a vfs:// file.
With VFS 3, the URL contains file:// instead, thus affecting the result of the method and
allowing that all parent SystemClassPools find the classes in the excluded package during
test execution.
To fix that, we need to write a IsLocalResourcePlugin tailored for tests only. This
plugin should include filtering in the isSameInParent method above, thus avoiding that
classes in the excluded package be found by the system classpool during test execution.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira