[JBoss JIRA] (JBIDE-24375) Remove PowerMock usage in tests
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-24375?page=com.atlassian.jira.plugi... ]
Andre Dietisheim commented on JBIDE-24375:
------------------------------------------
[~aurelien.pupier] We had this very same discussion before merging this in. I agree in the fact that static accessors are a major problem when it comes to testability (and I personnally avoid static wherever possible because of this very reason and the drawbacks in inheritability). But then changing a class to be instantiatable for the sake of it's testability isn't nice either: no code should be changed to fulfil the needs of tests, tests should follow the code, not the other way round. But we all know how this is just a rule of thumb, not a rule set to stone. To me having those utils instantiatable isnt nice in terms of API either: at first state the class then looks as if it would hold state, which it isnt on purpose. I believe that using Powermock isnt the perfect solution but I dont see any other that's superior.
> Remove PowerMock usage in tests
> -------------------------------
>
> Key: JBIDE-24375
> URL: https://issues.jboss.org/browse/JBIDE-24375
> Project: Tools (JBoss Tools)
> Issue Type: Task
> Components: openshift
> Affects Versions: 4.4.4.AM3
> Reporter: Aurélien Pupier
> Labels: openshift_v3, tests
> Fix For: 4.4.4.Final
>
>
> I create this issue to gather ideas to get rid of it.
> see https://github.com/jbosstools/jbosstools-openshift/blob/cf544dbec4baa87c6...
> from why i understand, PowerMock is used only to mock a singleton access in a static method.
> The reasonable seems to avoid static method: OpenShiftServerUtils. If we are using an instanciation for this class, then, the call to create the Watcher can be extracted in a method and this method would be classically mockable with Mockito.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months
[JBoss JIRA] (JBIDE-23600) Integration tests global refactoring: org.jboss.tools.livereload.ui.bot.test
by Jeff MAURY (JIRA)
[ https://issues.jboss.org/browse/JBIDE-23600?page=com.atlassian.jira.plugi... ]
Jeff MAURY edited comment on JBIDE-23600 at 5/15/17 4:11 AM:
-------------------------------------------------------------
[~xcoulon] the goal is to move the integration tests from a global independant repo to the component repo. This is mainly done by GE ([~psrna]) so we may perhaps change the assignee but we should keep it in mind.
was (Author: jeffmaury):
[~xcoulon] the goal is to move the integration tests from a global independant repo to the component repo. This is mainly done by GE ([~psrna]) so we may perhaps change the assignee but we shoud keep it in mind.
> Integration tests global refactoring: org.jboss.tools.livereload.ui.bot.test
> ----------------------------------------------------------------------------
>
> Key: JBIDE-23600
> URL: https://issues.jboss.org/browse/JBIDE-23600
> Project: Tools (JBoss Tools)
> Issue Type: Sub-task
> Components: livereload
> Affects Versions: 4.4.2.Final
> Reporter: Jeff MAURY
> Assignee: Xavier Coulon
> Labels: integration, integration_tests, livereload
> Fix For: 4.5.0.AM1
>
>
> Maven command:
> {code}
> mvn clean verify -Dtest.module=org.jboss.tools.livereload.ui.bot.test -DskipTests=false
> {code}
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
8 years, 10 months