Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 202528 Details for
Bug 339990
[Repo view] Module disappears in CVS Repositories view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Test that fails
patch_339990_test.txt (text/plain), 4.93 KB, created by
Malgorzata Janczarska
on 2011-08-31 10:08:20 EDT
(
hide
)
Description:
Test that fails
Filename:
MIME Type:
Creator:
Malgorzata Janczarska
Created:
2011-08-31 10:08:20 EDT
Size:
4.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.tests.cvs.core >Index: src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java,v >retrieving revision 1.21 >diff -u -r1.21 EclipseSynchronizerTest.java >--- src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java 17 Nov 2009 08:42:56 -0000 1.21 >+++ src/org/eclipse/team/tests/ccvs/core/cvsresources/EclipseSynchronizerTest.java 31 Aug 2011 14:06:14 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.team.tests.ccvs.core.cvsresources; > > >+import java.util.ArrayList; > import java.util.Arrays; > import java.util.HashSet; > import java.util.Iterator; >@@ -41,10 +42,16 @@ > import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; > import org.eclipse.team.internal.ccvs.core.ICVSRunnable; > import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer; >+import org.eclipse.team.internal.ccvs.core.resources.RemoteResource; > import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; > import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo; > import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; > import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter; >+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; >+import org.eclipse.team.internal.ccvs.ui.model.AllRootsElement; >+import org.eclipse.team.internal.ccvs.ui.model.BranchCategory; >+import org.eclipse.team.internal.ccvs.ui.model.CVSTagElement; >+import org.eclipse.team.internal.ccvs.ui.model.RemoteContentProvider; > import org.eclipse.team.tests.ccvs.core.CVSTestSetup; > import org.eclipse.team.tests.ccvs.core.EclipseTest; > >@@ -917,4 +924,95 @@ > assertTrue(!sync.getResourceSync(file21).getRevision().equals(revision)); > > } >+ >+ private String moduleName; >+ private String branchName; >+ >+ public void testBug339990() throws TeamException, CoreException { >+ >+ // create project >+ IProject project = getUniqueTestProject("Bug339990Project"); >+ buildResources(project, new String[] { "file1.txt" }, true); >+ // share project under module >+ shareProject(getRepository(), project, >+ moduleName + "/" + project.getName(), DEFAULT_MONITOR); >+ assertValidCheckout(project); >+ >+ // make some changes >+ addResources(project, new String[] { "folder1/c.txt" }, false); >+ deleteResources(project, new String[] { "folder1/b.txt" }, false); >+ changeResources(project, new String[] { "file1.txt" }, false); >+ >+ // make branch >+ CVSTag version = new CVSTag("Root_" + branchName, CVSTag.VERSION); >+ CVSTag branch = new CVSTag(branchName, CVSTag.BRANCH); >+ >+ makeBranch(new IResource[] { project }, version, branch, true); >+ commitProject(project); >+ >+ // refresh branches >+ CVSUIPlugin >+ .getPlugin() >+ .getRepositoryManager() >+ .refreshDefinedTags( >+ getRepository().getRemoteFolder(moduleName, null), >+ true, true, DEFAULT_MONITOR); >+ >+ // check if module is the only branch child >+ RemoteContentProvider rcp = new RemoteContentProvider(); >+ AllRootsElement are = new AllRootsElement(); >+ Object[] elements = rcp.getElements(are); >+ for (int i = 0; i < elements.length; i++) { >+ Object o = elements[i]; >+ List branchChildren = collectBranchChildren(branchName, rcp, o, 0); >+ assertEquals(1, branchChildren.size()); >+ Iterator branchIterator = branchChildren.iterator(); >+ while (branchIterator.hasNext()) { >+ Object module = branchIterator.next(); >+ assertTrue(module instanceof RemoteResource); >+ assertEquals(moduleName, ((RemoteResource) module).getName()); >+ } >+ >+ } >+ } >+ >+ private List collectBranchChildren(String branchName, >+ RemoteContentProvider rcp, Object o, int depth) { >+ List ret = new ArrayList(); >+ boolean branchCategory = (o instanceof BranchCategory); >+ if (depth == 1 && !branchCategory) { >+ return ret; >+ } >+ if (branchCategory) { >+ BranchCategory b = (BranchCategory) o; >+ Object[] branches = rcp.getChildren(b); >+ for (int j = 0; j < branches.length; j++) { >+ if (branches[j] instanceof CVSTagElement) { >+ CVSTagElement el = (CVSTagElement) branches[j]; >+ if (el.getTag().getName().equals(branchName)) { >+ Object[] modules = rcp.getChildren(el); >+ return Arrays.asList(modules); >+ } >+ >+ } >+ } >+ return ret; >+ } >+ ++depth; >+ if (rcp.hasChildren(o)) { >+ Object[] children = rcp.getChildren(o); >+ for (int j = 0; j < children.length; j++) { >+ ret.addAll(collectBranchChildren(branchName, rcp, children[j], >+ depth)); >+ } >+ } >+ return ret; >+ } >+ >+ protected void setUp() throws Exception { >+ String time = Long.toString(System.currentTimeMillis()); >+ moduleName = "Bug339990TestModule" + time; >+ branchName = "Bug339990branch" + time; >+ super.setUp(); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 339990
:
195490
|
201405
|
202528
|
202665
|
203490
|
204535
|
204949
|
204950
|
205121
|
205178
|
205420