|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 13-36
Link Here
|
| 13 |
import java.io.ByteArrayInputStream; |
13 |
import java.io.ByteArrayInputStream; |
| 14 |
import java.io.IOException; |
14 |
import java.io.IOException; |
| 15 |
import java.lang.reflect.InvocationTargetException; |
15 |
import java.lang.reflect.InvocationTargetException; |
| 16 |
import java.util.*; |
16 |
import java.util.Arrays; |
|
|
17 |
import java.util.HashSet; |
| 18 |
import java.util.Set; |
| 17 |
|
19 |
|
| 18 |
import junit.framework.Test; |
20 |
import junit.framework.Test; |
| 19 |
import junit.framework.TestSuite; |
21 |
import junit.framework.TestSuite; |
| 20 |
|
22 |
|
| 21 |
import org.eclipse.core.resources.*; |
23 |
import org.eclipse.core.resources.IContainer; |
|
|
24 |
import org.eclipse.core.resources.IFile; |
| 25 |
import org.eclipse.core.resources.IFolder; |
| 26 |
import org.eclipse.core.resources.IProject; |
| 27 |
import org.eclipse.core.resources.IProjectDescription; |
| 28 |
import org.eclipse.core.resources.IResource; |
| 29 |
import org.eclipse.core.resources.IResourceVisitor; |
| 30 |
import org.eclipse.core.resources.ResourcesPlugin; |
| 22 |
import org.eclipse.core.runtime.CoreException; |
31 |
import org.eclipse.core.runtime.CoreException; |
|
|
32 |
import org.eclipse.core.runtime.NullProgressMonitor; |
| 23 |
import org.eclipse.core.runtime.Path; |
33 |
import org.eclipse.core.runtime.Path; |
| 24 |
import org.eclipse.team.core.RepositoryProvider; |
34 |
import org.eclipse.team.core.RepositoryProvider; |
| 25 |
import org.eclipse.team.core.TeamException; |
35 |
import org.eclipse.team.core.TeamException; |
| 26 |
import org.eclipse.team.core.subscribers.ISubscriberChangeEvent; |
36 |
import org.eclipse.team.core.subscribers.ISubscriberChangeEvent; |
| 27 |
import org.eclipse.team.core.synchronize.SyncInfo; |
37 |
import org.eclipse.team.core.synchronize.SyncInfo; |
| 28 |
import org.eclipse.team.internal.ccvs.core.*; |
38 |
import org.eclipse.team.internal.ccvs.core.CVSException; |
|
|
39 |
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin; |
| 40 |
import org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber; |
| 41 |
import org.eclipse.team.internal.ccvs.core.CVSTag; |
| 42 |
import org.eclipse.team.internal.ccvs.core.CVSTeamProvider; |
| 43 |
import org.eclipse.team.internal.ccvs.core.ICVSFile; |
| 44 |
import org.eclipse.team.internal.ccvs.core.ICVSFolder; |
| 45 |
import org.eclipse.team.internal.ccvs.core.ICVSResource; |
| 29 |
import org.eclipse.team.internal.ccvs.core.client.Command; |
46 |
import org.eclipse.team.internal.ccvs.core.client.Command; |
| 30 |
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; |
47 |
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption; |
| 31 |
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; |
48 |
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; |
| 32 |
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; |
49 |
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; |
|
|
50 |
import org.eclipse.team.internal.ccvs.ui.operations.RepositoryProviderOperation; |
| 33 |
import org.eclipse.team.tests.ccvs.core.CVSTestSetup; |
51 |
import org.eclipse.team.tests.ccvs.core.CVSTestSetup; |
|
|
52 |
import org.eclipse.team.tests.ccvs.core.mappings.model.ModelProject; |
| 53 |
import org.eclipse.team.tests.ccvs.core.mappings.model.mapping.ModelResourceMapping; |
| 54 |
import org.eclipse.team.tests.ccvs.ui.ModelParticipantSyncInfoSource; |
| 34 |
|
55 |
|
| 35 |
/** |
56 |
/** |
| 36 |
* This class tests the CVSWorkspaceSubscriber |
57 |
* This class tests the CVSWorkspaceSubscriber |
|
Lines 277-282
Link Here
|
| 277 |
* Tests |
298 |
* Tests |
| 278 |
******************************************************************/ |
299 |
******************************************************************/ |
| 279 |
|
300 |
|
|
|
301 |
public void testBug302163WithoutModel() throws CoreException { |
| 302 |
// Create a test project |
| 303 |
IProject modelProject = getUniqueTestProject("test1"); |
| 304 |
buildResources(modelProject, new String[] { "file.mod", "f1.moe" }, true); |
| 305 |
modelProject.getFile("file.mod").setContents(new ByteArrayInputStream(("\nf1.moe").getBytes()), false, true, null); |
| 306 |
shareProject(modelProject); |
| 307 |
assertValidCheckout(modelProject); |
| 308 |
|
| 309 |
// Checkout and modify a copy |
| 310 |
IProject copyModelProject = checkoutCopy(modelProject, "-copy"); |
| 311 |
copyModelProject.getFile("file.mod").setContents(new ByteArrayInputStream(("\nf1.moe\nf2.moe").getBytes()), false, true, null); |
| 312 |
commitProject(copyModelProject); |
| 313 |
|
| 314 |
refresh(getSubscriber(), modelProject); |
| 315 |
|
| 316 |
RepositoryProviderOperation.consultModelsWhenBuildingScope = true; |
| 317 |
setSyncSource(new SyncInfoSource()); |
| 318 |
// Update |
| 319 |
try { |
| 320 |
update(modelProject, new String[] { "file.mod" }); |
| 321 |
} catch (CVSException e) { |
| 322 |
fail("Update without models failed", e); |
| 323 |
} |
| 324 |
// Reset settings |
| 325 |
RepositoryProviderOperation.consultModelsWhenBuildingScope = false; |
| 326 |
setSyncSource(new ModelParticipantSyncInfoSource()); |
| 327 |
} |
| 328 |
|
| 329 |
public void testBug302163WithModel() throws CoreException { |
| 330 |
// Create a test project |
| 331 |
IProject project = createProject("test", new String[] { "file1.txt" }); |
| 332 |
ModelResourceMapping.projectName = project.getName(); |
| 333 |
|
| 334 |
// Create a test model project |
| 335 |
IProject modelProject = getUniqueTestProject("test1"); |
| 336 |
buildResources(modelProject, new String[] { "file.mod", "f1.moe" }, true); |
| 337 |
modelProject.getFile("file.mod").setContents(new ByteArrayInputStream(("\nf1.moe").getBytes()), false, true, null); |
| 338 |
ModelProject.makeModProject(modelProject, new NullProgressMonitor()); |
| 339 |
shareProject(modelProject); |
| 340 |
assertValidCheckout(modelProject); |
| 341 |
|
| 342 |
// Checkout and modify a copy of the model project |
| 343 |
IProject copyModelProject = checkoutCopy(modelProject, "-copy"); |
| 344 |
copyModelProject.getFile("file.mod").setContents(new ByteArrayInputStream(("\nf1.moe\nf2.moe").getBytes()), false, true, null); |
| 345 |
commitProject(copyModelProject); |
| 346 |
|
| 347 |
refresh(getSubscriber(), modelProject); |
| 348 |
|
| 349 |
RepositoryProviderOperation.consultModelsWhenBuildingScope = true; |
| 350 |
setSyncSource(new SyncInfoSource()); |
| 351 |
// Update |
| 352 |
try { |
| 353 |
update(modelProject, new String[] { "file.mod" }); |
| 354 |
} catch (CVSException e) { |
| 355 |
fail("Update without models failed", e); |
| 356 |
} |
| 357 |
// Reset settings |
| 358 |
RepositoryProviderOperation.consultModelsWhenBuildingScope = false; |
| 359 |
setSyncSource(new ModelParticipantSyncInfoSource()); |
| 360 |
} |
| 361 |
|
| 280 |
/* |
362 |
/* |
| 281 |
* Perform a simple test that checks for the different types of incoming changes |
363 |
* Perform a simple test that checks for the different types of incoming changes |
| 282 |
*/ |
364 |
*/ |