Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2011-02-14 11:59:59 +0000
committerTomasz Zarna2011-02-14 11:59:59 +0000
commitb2133f4df78dcdf62d2f6361123eac8a72deee69 (patch)
tree805e11b469760ca06c7284653ab835c8fb61d54c /tests/org.eclipse.team.tests.cvs.core
parentaa3ed4420a1563d433193195123646edd380c144 (diff)
downloadeclipse.platform.team-b2133f4df78dcdf62d2f6361123eac8a72deee69.tar.gz
eclipse.platform.team-b2133f4df78dcdf62d2f6361123eac8a72deee69.tar.xz
eclipse.platform.team-b2133f4df78dcdf62d2f6361123eac8a72deee69.zip
bug 76386: [History View] CVS Resource History shows revisions from all branches -- hide the column+filter and update tests
Diffstat (limited to 'tests/org.eclipse.team.tests.cvs.core')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java10
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ReflectionUtils.java38
2 files changed, 45 insertions, 3 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
index 4edfa7832..31df64553 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/provider/RemoteResourceTest.java
@@ -35,7 +35,7 @@ import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
-import org.eclipse.team.internal.ccvs.core.client.RTag;
+import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
@@ -45,6 +45,7 @@ import org.eclipse.team.internal.ccvs.ui.operations.CheckoutToRemoteFolderOperat
import org.eclipse.team.internal.ccvs.ui.operations.TagInRepositoryOperation;
import org.eclipse.team.tests.ccvs.core.CVSTestSetup;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
+import org.eclipse.team.tests.ccvs.ui.ReflectionUtils;
public class RemoteResourceTest extends EclipseTest {
@@ -425,7 +426,12 @@ public class RemoteResourceTest extends EclipseTest {
// remove the branch
ICVSRemoteFolder remote = (ICVSRemoteFolder)CVSWorkspaceRoot.getRemoteResourceFor(project);
TagInRepositoryOperation op = new TagInRepositoryOperation(null, new ICVSRemoteResource[] {remote});
- op.addLocalOption(RTag.DELETE);
+ LocalOption lo = (LocalOption) ReflectionUtils
+ .construct(
+ "org.eclipse.team.internal.ccvs.core.client.Command$LocalOption",
+ getClass().getClassLoader(),
+ new Class[] { String.class }, new Object[] { "-d" });
+ op.addLocalOption(lo);
runTag(op, branch, true);
ICVSRemoteFile remoteFile = (ICVSRemoteFile) CVSWorkspaceRoot.getRemoteResourceFor(project.getFile("file1.txt"));
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ReflectionUtils.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ReflectionUtils.java
index e6b5a51f2..2bccdc0e4 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ReflectionUtils.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/ReflectionUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 IBM Corporation and others.
+ * Copyright (c) 2009, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,14 +10,50 @@
*******************************************************************************/
package org.eclipse.team.tests.ccvs.ui;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.team.tests.ccvs.core.EclipseTest;
public class ReflectionUtils {
+ public static Object construct(String className, ClassLoader classLoader,
+ Class[] constructorTypes, Object[] constructorArgs) {
+ Class clazz = null;
+ try {
+ clazz = Class.forName(className, true, classLoader);
+ } catch (ClassNotFoundException e) {
+ EclipseTest.fail(e.getMessage());
+ } catch (ExceptionInInitializerError e) {
+ EclipseTest.fail(e.getMessage());
+ }
+ Constructor constructor = null;
+ try {
+ constructor = clazz.getDeclaredConstructor(constructorTypes);
+ } catch (SecurityException e) {
+ EclipseTest.fail(e.getMessage());
+ } catch (NoSuchMethodException e) {
+ EclipseTest.fail(e.getMessage());
+ }
+ Assert.isNotNull(constructor);
+ constructor.setAccessible(true);
+ try {
+ return constructor.newInstance(constructorArgs);
+ } catch (IllegalArgumentException e) {
+ EclipseTest.fail(e.getMessage());
+ } catch (InvocationTargetException e) {
+ EclipseTest.fail(e.getMessage());
+ } catch (InstantiationException e) {
+ EclipseTest.fail(e.getMessage());
+ } catch (IllegalAccessException e) {
+ EclipseTest.fail(e.getMessage());
+ }
+ return null;
+ }
+
public static Object callMethod(Object object, String name, Object args[]) {
try {
Class types[] = new Class[args.length];

Back to the top