JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-6170

HttpResponseBuilderTestCase.validateHeader() is incorrect which masks broken tests

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.3 RC4
  • Fix Version/s: 3.3.0, 3.4.0
  • Component/s: Transport: HTTP(S) / Jetty
  • Labels:
    None
  • User impact:
    Very Low
  • Similar Issues:
    None

Description

validateHeader returns happily if the expected header is not present, which allows otherwise broken tests to pass.

I suggest to add a fail() statement at the end to solve this:

private void validateHeader(final Header[] headers, final String headerName, final String expectedValue)
    {
        for (final Header header : headers)
        {
            if (headerName.equals(header.getName()))
            {
                assertEquals(expectedValue, header.getValue());
                return;
            }
        }

        fail(String.format("Didn't find header: %s=%s in headers: %s", headerName, expectedValue, headers));
    }

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
David Dossot added a comment - 17/Apr/12 04:34 PM

headers.toString() doesn't render well so adding it in the fail statement message doesn't help much.

Show
David Dossot added a comment - 17/Apr/12 04:34 PM headers.toString() doesn't render well so adding it in the fail statement message doesn't help much.
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Field Original Value New Value
Assignee Evangelina Martinez Ruiz Moreno [ evangelinamrm ]
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Priority To be reviewed [ 6 ] Critical [ 2 ]
Evangelina Martinez Ruiz Moreno made changes - 17/Apr/12 04:48 PM
Status Open [ 1 ] In Progress [ 3 ]
Hide
Permalink
Evangelina Martinez Ruiz Moreno added a comment - 17/Apr/12 04:59 PM

Thanks for catching this David, I'll commit the fix

Show
Evangelina Martinez Ruiz Moreno added a comment - 17/Apr/12 04:59 PM Thanks for catching this David, I'll commit the fix
Evangelina Martinez Ruiz Moreno
17/Apr/12 05:03 PM
View full commit
MULE-6170: HttpResponseBuilderTestCase.validateHeader() is incorrect which masks broken tests Fixing incorrect validation on test case git-svn-id: https://svn.codehaus.org/mule/branches/mule-3.3.x@24294 bf997673-6b11-0410-b953-e057580c5b09
mule-3.3.3
+9
-1
transports/http/src/test/java/org/mule/transport/http/components/HttpResponseBuilderTestCase.java
Hide
Permalink
Evangelina Martinez Ruiz Moreno added a comment - 17/Apr/12 05:11 PM

Committed on:

3.3.x - r 24294
3.x - r 24295

Show
Evangelina Martinez Ruiz Moreno added a comment - 17/Apr/12 05:11 PM Committed on: 3.3.x - r 24294 3.x - r 24295
Hide
Permalink
Alejandro Sequeira added a comment - 12/Jun/12 09:52 AM

Evangelina Martinez Ruiz Moreno, is there still any merge pending?

Show
Alejandro Sequeira added a comment - 12/Jun/12 09:52 AM Evangelina Martinez Ruiz Moreno, is there still any merge pending?
Alejandro Sequeira made changes - 13/Jun/12 02:31 PM
Affects Version/s 3.3.0 [ 11110 ]
Affects Version/s 3.3 RC4 [ 11276 ]
Evangelina Martinez Ruiz Moreno made changes - 13/Jun/12 02:39 PM
Resolution Fixed [ 1 ]
Fix Version/s 3.4.0 [ 11142 ]
Fix Version/s 3.3.0 [ 11110 ]
Status In Progress [ 3 ] Closed [ 6 ]
Transition Time In Source Status Execution Times Last Executer Last Execution Date
Open Open In Progress In Progress
17m 35s 1 Evangelina Martinez Ruiz Moreno 17/Apr/12 04:48 PM
In Progress In Progress Closed Closed
56d 21h 51m 1 Evangelina Martinez Ruiz Moreno 13/Jun/12 02:39 PM
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
  • Repository mule on http://foo.bar/ failed: Error in remote call to 'FishEye 0 (http://foo.bar/)' (http://foo.bar) [AbstractRestCommand{path='/rest-service-fe/changeset-v1/listChangesets/', params={expand=changesets[-21:-1].revisions[0:29], comment=MULE-6170, p4JobFixed=MULE-6170, rep=mule}, methodType=GET}] : java.net.UnknownHostException: foo.bar

People

  • Assignee:
    Evangelina Martinez Ruiz Moreno
    Reporter:
    David Dossot
Vote (0)
Watch (0)

Dates

  • Created:
    17/Apr/12 04:30 PM
    Updated:
    13/Jun/12 02:39 PM
    Resolved:
    13/Jun/12 02:39 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.