Bug 465594 - [TestCase] To add a testcase for Bug 389564
Summary: [TestCase] To add a testcase for Bug 389564
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 4.5   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.6 RC3   Edit
Assignee: Julian Enoch CLA
QA Contact:
URL:
Whiteboard:
Keywords: test
Depends on:
Blocks:
 
Reported: 2015-04-27 10:25 EDT by Sarika Sinha CLA
Modified: 2018-04-22 11:58 EDT (History)
1 user (show)

See Also:
sarika.sinha: review+


Attachments
Google search (60.70 KB, image/jpeg)
2018-04-22 11:51 EDT, Julian Enoch CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sarika Sinha CLA 2015-04-27 10:25:52 EDT
Taken out of Bug 389564
Comment 1 Sarika Sinha CLA 2015-04-27 10:27:26 EDT
Assigning it to 4.6 right now as 4.5 SR1 is not available as the Target Milestone.
Comment 2 Julian Enoch CLA 2015-05-14 14:10:34 EDT
I would like to have your input about this. The change that triggered this ticket is actually not an additional functionality or methods but it is a fix. And when I use jacoco, I see that the changed lines are already covered by the current tests.

Do you think an additional test case is needed?
Comment 3 Sarika Sinha CLA 2015-05-15 07:14:40 EDT
Look at it this way, if the functionality was not there, what test case would have failed ?
The lines might be already covered with different input/environment parameters which were running fine before also. Same tests we can add with input/environment parameters which would have failed without this fix but do not fail now.
Comment 4 Julian Enoch CLA 2015-05-15 14:04:48 EDT
Sarika,

I see your point, but I will need your help to figure this out.

The difficulty is that the initial bug was associated with a specific setup consisting of a multi-user eclipse installation where the user home is located on a Windows shared folder. I was able to verify the fix because I have that configuration in place. But is it possible to simulate this configuration using on the current testing framework?

Do you think there are tests that we can change the inputs in order to simulate this scenario?
Comment 5 Sarika Sinha CLA 2015-05-18 07:23:00 EDT
May be You can try adding an Ant Home entry invoking Ant Preference Manager code with url and then check if it comes up as expected.
Comment 6 Eclipse Genie CLA 2015-05-19 18:18:54 EDT
New Gerrit change created: https://git.eclipse.org/r/48227
Comment 7 Sarika Sinha CLA 2015-05-19 23:56:09 EDT
(In reply to Eclipse Genie from comment #6)
> New Gerrit change created: https://git.eclipse.org/r/48227

Looks good, will have to wait to put this till we get 4.6 Stream.
Comment 8 Sarika Sinha CLA 2016-03-21 02:00:35 EDT
Julian,
I am not to merge and rebase the changes.
 	
Julian Enoch <xxxxxxxxx@ericsson.com>, is it registered to gerrit and CLA ?
Comment 9 Julian Enoch CLA 2016-03-21 09:53:16 EDT
(In reply to Sarika Sinha from comment #8)
> Julian Enoch <xxxxxxxxx@ericsson.com>, is it registered to gerrit and CLA
> ?

Sarika,

I have submitted the change as xxxxxxxxx@ericsson.com. My email in the CLA has changed now to xxxxxxxxx@gmail.com.
Comment 10 Sarika Sinha CLA 2016-03-21 10:10:34 EDT
Can you submit the gerrit patch with gmail id then ?
Comment 11 Sarika Sinha CLA 2016-04-25 03:21:55 EDT
Do you plan to provide the patch with new ID ?
Comment 12 Julian Enoch CLA 2016-04-25 12:11:58 EDT
(In reply to Sarika Sinha from comment #11)
> Do you plan to provide the patch with new ID ?

I will look into it. sorry I have been busy lately.
Comment 13 Sarika Sinha CLA 2016-05-09 07:54:02 EDT
We at the closure of 4.6, so will appreciate if you can take it on priority.
Comment 14 Eclipse Genie CLA 2016-05-10 11:18:21 EDT
New Gerrit change created: https://git.eclipse.org/r/72423
Comment 15 Sarika Sinha CLA 2016-05-11 01:12:31 EDT
Thanks for the email id update.

Test work fine on Linux but with other OS we will see path problems.

May be we can use
assertFalse("Incorrect classpath entry. This would have been the value before the fix", resultedEntries[entries.length].getLabel().equals(new Path("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
		assertTrue("Incorrect classpath entry", resultedEntries[entries.length].getLabel().equals(new Path("//hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$

Let me know if you have better solution.
Comment 16 Julian Enoch CLA 2016-05-11 09:17:03 EDT
(In reply to Sarika Sinha from comment #15)
> Thanks for the email id update.
> 
> Test work fine on Linux but with other OS we will see path problems.
> 
> May be we can use
> assertFalse("Incorrect classpath entry. This would have been the value
> before the fix", resultedEntries[entries.length].getLabel().equals(new
> Path("/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/2/.cp/
> lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
> 		assertTrue("Incorrect classpath entry",
> resultedEntries[entries.length].getLabel().equals(new
> Path("//hub/home/tom/.eclipse/3.8/configuration/org.eclipse.osgi/bundles/21/
> 2/.cp/lib/remote.jar").toOSString())); //$NON-NLS-1$ //$NON-NLS-2$
> 
> Let me know if you have better solution.

Looks very good to me. Please go ahead with this change.
Comment 17 Sarika Sinha CLA 2016-05-19 04:36:49 EDT
Gerrit patch has been corrected accordingly.
Test case passes on Windows and Linux.
Comment 19 Sarika Sinha CLA 2016-05-19 06:17:51 EDT
Thanks Julian!!
Comment 20 Sarika Sinha CLA 2016-05-20 00:54:32 EDT
http://download.eclipse.org/eclipse/downloads/drops4/I20160519-1100/testresults/html/org.eclipse.ant.tests.core_ep46I-unit-cen64_linux.gtk.x86_64_8.0.html

Linux test case fails for path comparison. 
Will have to test on Linux/Mac to see the difference in string.
Comment 21 Eclipse Genie CLA 2016-05-23 23:43:49 EDT
New Gerrit change created: https://git.eclipse.org/r/73436
Comment 22 Sarika Sinha CLA 2016-05-23 23:48:04 EDT
Reason was simple - For Windows , remote path starts with "//hub" but in linux and Mac it starts with "/hub". Unfortunately toOSString just handles the forward and backward slash problem of OS path. Our main aim of this test case is that it should not start with "/home" and it should have the machine details "hub".
So changed the test case a bit to confirm for the machine details and compare the string after stripping the initial slashes.
Comment 23 Sarika Sinha CLA 2016-05-24 00:18:14 EDT
Ran the tests independently on Windows/Linux and Mac to verify.
Comment 26 Julian Enoch CLA 2018-04-22 09:49:55 EDT
This thread cites my personal email in comments #c8 and #c9, and can be fetched from search engines, which causes me to receive a lot of spam.
Comment 27 Dani Megert CLA 2018-04-22 11:40:49 EDT
(In reply to Julian Enoch from comment #26)
> This thread cites my personal email in comments #c8 and #c9, and can be
> fetched from search engines, which causes me to receive a lot of spam.

How do you know it comes from those comments?
Comment 28 Dani Megert CLA 2018-04-22 11:47:22 EDT
Reopening to reset VERIFIED state.
Comment 29 Julian Enoch CLA 2018-04-22 11:51:49 EDT
Created attachment 273723 [details]
Google search
Comment 30 Julian Enoch CLA 2018-04-22 11:53:40 EDT
(In reply to Dani Megert from comment #27)
> How do you know it comes from those comments?

Dani, I cannot tell for sure but I when I google it the only locations that I get are Bugzilla and Gerrit (see attachment in previous comment).

It makes me think that may be these platforms should not be accessible to search engines which makes them vulnerable to malicious web crawlers.

For now, I would like if I was able to delete the comments in question!
Comment 31 Dani Megert CLA 2018-04-22 11:58:15 EDT
(In reply to Julian Enoch from comment #30)
> (In reply to Dani Megert from comment #27)
> > How do you know it comes from those comments?
> 
> Dani, I cannot tell for sure but I when I google it the only locations that
> I get are Bugzilla and Gerrit (see attachment in previous comment).
> 
> It makes me think that may be these platforms should not be accessible to
> search engines which makes them vulnerable to malicious web crawlers.
> 
> For now, I would like if I was able to delete the comments in question!

Hi Julian. I suggest to file two bug reports against https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Bugzilla
1) To shadow your e-mail address in the comments of this bug.
2) For a general solution to hide them from search engines.

Please cc me on those. Thanks.