Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 247185454cbd918b2cd53598bcaba74048840339 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************************
 * Copyright (c) 2012 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tests.tcf.filesystem.adapters;

import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IConfirmCallback;
import org.eclipse.tcf.te.tcf.filesystem.ui.internal.handlers.DeleteHandler;
import org.eclipse.tcf.te.tests.tcf.filesystem.FSPeerTestCase;

@SuppressWarnings("restriction")
public class DeleteHandlerDelegateTest extends FSPeerTestCase {
	private DeleteHandler delegate;

    @Override
	protected void setUp() throws Exception {
		super.setUp();
		delegate = new DeleteHandler();
		assertNotNull(delegate);
		IConfirmCallback confirmCallback = new IConfirmCallback() {
			@Override
			public boolean requires(Object object) {
				// Do not require confirmation, just delete it.
				return false;
			}

			@Override
			public int confirms(Object object) {
				return 0;
			}
		};
		delegate.setConfirmCallback(confirmCallback);
	}

	public void testCanDelete() {
		assertTrue(delegate.canDelete(test11File));
	}

	/*
	public void testDelete() throws Exception {
		final AtomicReference<IStatus> ref = new AtomicReference<IStatus>();
		PropertiesContainer props = new PropertiesContainer();
		props.setProperty("selection", new StructuredSelection(test11File)); //$NON-NLS-1$
		delegate.delete(test11File, props, new Callback() {
			@Override
			protected void internalDone(Object caller, IStatus status) {
				ref.set(status);
			}
		});
		IStatus status = ref.get();
		assertTrue(status.isOK());
		assertNull(status.getException());
		String location = test11File.getLocation();
		test11File = getFSNode(location);
		assertNull(test11File);
	}
	*/
}

Back to the top