Bug 248056 - [mirror] Test to ensure we are not always removing repositories
Summary: [mirror] Test to ensure we are not always removing repositories
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Andrew Cattle CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on: 248269
Blocks:
  Show dependency tree
 
Reported: 2008-09-20 14:57 EDT by Pascal Rapicault CLA
Modified: 2008-11-05 16:10 EST (History)
1 user (show)

See Also:


Attachments
Tests to ensure repositories are loaded/removed correctly by the mirror applications (22.99 KB, text/plain)
2008-10-01 10:05 EDT, Andrew Cattle CLA
no flags Details
Updated tests (31.87 KB, text/plain)
2008-10-01 15:30 EDT, Andrew Cattle CLA
dj.houghton: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2008-09-20 14:57:09 EDT
We need to have a test ensuring that if the repository that we are mirroring from or to is in the repo managers before the mirroring app is run, those repos are not inadvertently removed.
Comment 1 Andrew Cattle CLA 2008-09-22 15:38:04 EDT
How does this bug reflect upon Bug 247664? My understanding is that the loaded repos before the mirror application should be the only loaded repos after the mirror application.
Comment 2 Pascal Rapicault CLA 2008-09-22 20:52:30 EDT
It relates with bug 247664 by adding a test that verify that we are not gratuitously removing repos that the user would have added as part of fixing bug #247664.
Comment 3 Andrew Cattle CLA 2008-09-24 10:17:04 EDT
I have a some test cases written for testing Bug 2447664 that also apply to this bug but I'm not submitting a patch because it relies on my temporary solution to Bug 248269, which won't be in the released code.
Comment 4 Andrew Cattle CLA 2008-10-01 10:05:07 EDT
Created attachment 113993 [details]
Tests to ensure repositories are loaded/removed correctly by the mirror applications

These test verify my patch for Bug 248056. They also rely on a temporary solution to Bug 248269 and must be modified when the API becomes available.
Comment 5 DJ Houghton CLA 2008-10-01 11:17:00 EDT
Andrew, good start. Some changes to be made:

AllTests.java
- copyright should be only 2008, not 2007

test files:
- company contributions in copyright are incorrect
- none of the test methods have comments at the beginning saying what the test does
- in the #runMirrorApplication method we should be using constants where applicable (e.g. IApplicationContext.APPLICATION_ARGS)
- the test* methods should not throw an exception. specific exceptions should be caught in the test methods and fail if appropriate (e.g. fail("message", ex) )
- should replace:
      if (trueBooleanExpression) then fail(message)
  with
      assertFalse(message, expression)
- same for false expressions, but use assertTrue

Thanks.
Comment 6 Andrew Cattle CLA 2008-10-01 15:30:47 EDT
Created attachment 114034 [details]
Updated tests

I've made the changes DJ asked for.
Comment 7 DJ Houghton CLA 2008-10-01 16:35:10 EDT
Released to HEAD.