You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Maarten Coene (JIRA)" <ji...@apache.org> on 2007/09/18 20:14:44 UTC
[jira] Created: (IVY-606) Call Project.init() in junit tests
Call Project.init() in junit tests
----------------------------------
Key: IVY-606
URL: https://issues.apache.org/jira/browse/IVY-606
Project: Ivy
Issue Type: Bug
Reporter: Maarten Coene
Most of the junit tests don't call Project.init() after creating a new Ant Project.
We should fix this:
{code:java}
Project project = new Project();
project.init();
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-606) Call Project.init() in junit tests
Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528766 ]
Steve Loughran commented on IVY-606:
------------------------------------
ant-testutils is the stuff before antunit. It is helper code to run junit tests with an ant project set up in every build; the log gets captured for postmortem analysis too.
Look in the ant codebase for it under testing; its very handy, as you can write tests like
public void testBadHost() {
expectBuildExceptionContaining("testBadHost", "unknown host",
StartApplication.ERROR_COULD_NOT_DEPLOY);
assertInLog("Unable to locate IP address of the host: no-such-hostname");
}
> Call Project.init() in junit tests
> ----------------------------------
>
> Key: IVY-606
> URL: https://issues.apache.org/jira/browse/IVY-606
> Project: Ivy
> Issue Type: Bug
> Reporter: Maarten Coene
>
> Most of the junit tests don't call Project.init() after creating a new Ant Project.
> We should fix this:
> {code:java}
> Project project = new Project();
> project.init();
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-606) Call Project.init() in junit tests
Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528709 ]
Steve Loughran commented on IVY-606:
------------------------------------
silly question: are you using ant-testutils for your ant testing? It should do a lot of this stuff for you, and yes, its in the repository, though we make less guarantees of stability than the rest of the Java API
> Call Project.init() in junit tests
> ----------------------------------
>
> Key: IVY-606
> URL: https://issues.apache.org/jira/browse/IVY-606
> Project: Ivy
> Issue Type: Bug
> Reporter: Maarten Coene
>
> Most of the junit tests don't call Project.init() after creating a new Ant Project.
> We should fix this:
> {code:java}
> Project project = new Project();
> project.init();
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-606) Call Project.init() in junit tests
Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528668 ]
Xavier Hanin commented on IVY-606:
----------------------------------
If we have to do this everywhere, maybe a good idea would be to add a AntTestHelper class with:
{noformat}
public static Project newProject() {
Project project = new Project();
project.init();
return project;
}
{noformat}
This would make test code cleaner and would help if we later figure out that we need something else for initialization.
> Call Project.init() in junit tests
> ----------------------------------
>
> Key: IVY-606
> URL: https://issues.apache.org/jira/browse/IVY-606
> Project: Ivy
> Issue Type: Bug
> Reporter: Maarten Coene
>
> Most of the junit tests don't call Project.init() after creating a new Ant Project.
> We should fix this:
> {code:java}
> Project project = new Project();
> project.init();
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-606) Call Project.init() in junit tests
Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12528742 ]
Xavier Hanin commented on IVY-606:
----------------------------------
No, we don't use ant-testutils. The Ivy unit tests haven't changed in architecture since the initial release early 2005. When was ant-testutils released? Is it related to the ant unit testing features introduced in Ant 1.7?
> Call Project.init() in junit tests
> ----------------------------------
>
> Key: IVY-606
> URL: https://issues.apache.org/jira/browse/IVY-606
> Project: Ivy
> Issue Type: Bug
> Reporter: Maarten Coene
>
> Most of the junit tests don't call Project.init() after creating a new Ant Project.
> We should fix this:
> {code:java}
> Project project = new Project();
> project.init();
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.