-
Notifications
You must be signed in to change notification settings - Fork 822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improved tests for BaseUtilities.toFile & BaseUtitities.toURI #3902
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner now, thanks!
Maybe we want to drop some return
statements in the test?
toFile(new URI("http://example.com")); | ||
fail(); | ||
} catch (final IllegalArgumentException e) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to remove this "return" here, so tests proceeds with statements below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake - I realized it as well
toFile(new URI("mailto:person@example.com")); | ||
fail(); | ||
} catch (final IllegalArgumentException e) { | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe this one too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my mistake
platform/openide.util/test/unit/src/org/openide/util/BaseUtilitiesTest.java
Outdated
Show resolved
Hide resolved
platform/openide.util/test/unit/src/org/openide/util/BaseUtilitiesTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good now, but travis keeps on failing on this test:
=================== JUnit Report Summary / failed tests ===================
org.openide.util.BaseUtilitiesTest
failed: test_toFile_returnsFile_whenGivenCorrectURI
====================== JUnit failure details ===============================
Suite: org.openide.util.BaseUtilitiesTest
test_toFile_returnsFile_whenGivenCorrectURI FAILED : expected:<C:\some\path #1> but was:</C:/some/path #1>
junit.framework.AssertionFailedError: expected:<C:\some\path #1> but was:</C:/some/path #1>
at org.openide.util.BaseUtilitiesTest.test_toFile_returnsFile_whenGivenCorrectURI(BaseUtilitiesTest.java:173)
at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402)
at java.lang.Thread.run(Thread.java:748)
------------- End suite org.openide.util.BaseUtilitiesTest ------------
======================= End of JUnit report ===============================
Travis build reports failing tests:
|
- removed bogus "return" statements - separated "os-dependent" and "os-independent" tests - added cases to "toObjectArray" and "toPrimitiveArray" - fixed Travis issues (I hope)
Looks sane to me now, and all tests pass properly. @mbien would you please take a second look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't checked every single assert but it seems to contain everything what the other version had, plus additional cases for more coverage.
looks good to me.
Thank you @lbownik ! |
I'm leaving for a week. I'll fix it when I'm back.
…On Sat, Apr 2, 2022, 3:33 AM Antonio Vieiro ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Looks pretty good now, but travis keeps on failing on this test:
=================== JUnit Report Summary / failed tests ===================
org.openide.util.BaseUtilitiesTest
failed: test_toFile_returnsFile_whenGivenCorrectURI
====================== JUnit failure details ===============================
Suite: org.openide.util.BaseUtilitiesTest
test_toFile_returnsFile_whenGivenCorrectURI FAILED : expected:<C:\some\path #1> but was:</C:/some/path #1>
junit.framework.AssertionFailedError: expected:<C:\some\path #1> but was:</C:/some/path #1>
at org.openide.util.BaseUtilitiesTest.test_toFile_returnsFile_whenGivenCorrectURI(BaseUtilitiesTest.java:173)
at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402)
at java.lang.Thread.run(Thread.java:748)
------------- End suite org.openide.util.BaseUtilitiesTest ------------
======================= End of JUnit report ===============================
—
Reply to this email directly, view it on GitHub
<#3902 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHJMECF6DUNVBTNI2V72G3VDAO7DANCNFSM5SD3HEXA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hey. I don't see this error any more in Travis output
https://app.travis-ci.com/github/apache/netbeans/jobs/565646501
…On Sat, Apr 2, 2022 at 3:33 AM Antonio Vieiro ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Looks pretty good now, but travis keeps on failing on this test:
=================== JUnit Report Summary / failed tests ===================
org.openide.util.BaseUtilitiesTest
failed: test_toFile_returnsFile_whenGivenCorrectURI
====================== JUnit failure details ===============================
Suite: org.openide.util.BaseUtilitiesTest
test_toFile_returnsFile_whenGivenCorrectURI FAILED : expected:<C:\some\path #1> but was:</C:/some/path #1>
junit.framework.AssertionFailedError: expected:<C:\some\path #1> but was:</C:/some/path #1>
at org.openide.util.BaseUtilitiesTest.test_toFile_returnsFile_whenGivenCorrectURI(BaseUtilitiesTest.java:173)
at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:476)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:402)
at java.lang.Thread.run(Thread.java:748)
------------- End suite org.openide.util.BaseUtilitiesTest ------------
======================= End of JUnit report ===============================
—
Reply to this email directly, view it on GitHub
<#3902 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHJMECF6DUNVBTNI2V72G3VDAO7DANCNFSM5SD3HEXA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Łukasz Bownik
|
improved tests for BaseUtilities.toFile & BaseUtitities.toURI
split "testFileURI" method into multiple seperated methods
added tests checking whether exception are thrown properly
removed "testFieURI"