From f12c939127d6d5f082a7e4a9ffa30d6ffb6590b3 Mon Sep 17 00:00:00 2001 From: Markus Tiede Date: Thu, 11 Dec 2014 16:51:55 +0100 Subject: Non-sprint task - major refactoring: cleanup of unnecessary and unused cap test message / command indirection. --- .../org/eclipse/jubula/rc/swt/SwtAUTServer.java | 14 ++++++- .../jubula/rc/swt/commands/CAPTestCommand.java | 47 ---------------------- 2 files changed, 12 insertions(+), 49 deletions(-) delete mode 100644 org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/CAPTestCommand.java (limited to 'org.eclipse.jubula.rc.swt') diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/SwtAUTServer.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/SwtAUTServer.java index 7f0244c1d..f6c3c4c8e 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/SwtAUTServer.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/SwtAUTServer.java @@ -14,6 +14,7 @@ import java.lang.reflect.InvocationTargetException; import org.eclipse.jubula.rc.common.AUTServer; import org.eclipse.jubula.rc.common.driver.IRobot; +import org.eclipse.jubula.rc.common.exception.ComponentNotFoundException; import org.eclipse.jubula.rc.common.listener.BaseAUTListener; import org.eclipse.jubula.rc.swt.driver.RobotFactoryConfig; import org.eclipse.jubula.rc.swt.driver.RobotFactorySwtImpl; @@ -26,6 +27,7 @@ import org.eclipse.jubula.rc.swt.listener.MappingListener; import org.eclipse.jubula.rc.swt.listener.RecordListener; import org.eclipse.jubula.rc.swt.listener.TableSelectionTracker; import org.eclipse.jubula.tools.internal.constants.AUTServerExitConstants; +import org.eclipse.jubula.tools.internal.objects.IComponentIdentifier; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Listener; import org.slf4j.Logger; @@ -169,7 +171,7 @@ public class SwtAUTServer extends AUTServer { } catch (NullPointerException se) { // no permission to remove an SWTEventListener, // should not occur, because addSWTEventListener() should be called - // first. But just in case, close the vm + // first. But just in case, close the VM LOG.error(se.getLocalizedMessage(), se); System.exit(AUTServerExitConstants .EXIT_SECURITY_VIOLATION_AWT_EVENT_LISTENER); @@ -242,5 +244,13 @@ public class SwtAUTServer extends AUTServer { public void setDisplay(Display display) { m_display = display; } - + + /** + * {@inheritDoc} + */ + public Object findComponent(final IComponentIdentifier ci, + final int timeout) throws ComponentNotFoundException, + IllegalArgumentException { + return ComponentHandler.findComponent(ci, true, timeout); + } } \ No newline at end of file diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/CAPTestCommand.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/CAPTestCommand.java deleted file mode 100644 index 797737496..000000000 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/CAPTestCommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 BREDEX GmbH. - * 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: - * BREDEX GmbH - initial API and implementation and/or initial documentation - *******************************************************************************/ -package org.eclipse.jubula.rc.swt.commands; - -import org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand; -import org.eclipse.jubula.rc.common.exception.ComponentNotFoundException; -import org.eclipse.jubula.rc.swt.listener.ComponentHandler; -import org.eclipse.jubula.tools.internal.objects.IComponentIdentifier; - - -/** - * This class gets an message with ICommand action parameter triples. It invokes - * the implementation class and executes the method. Then it creates a - * CAPTestResponseMessage and sends it back to the client. The - * CAPTestResponseMessage contains an error event only if the - * test step fails, due to a problem prior to or during the execution of the - * implementation class action method. - * - * @author BREDEX GmbH - * @created 02.09.2004 - * - */ -public class CAPTestCommand extends AbstractCapTestCommand { - - /** the found comp */ - private Object m_comp; - - /** - * {@inheritDoc} - */ - protected Object findComponent(final IComponentIdentifier ci, - final int timeout) throws ComponentNotFoundException, - IllegalArgumentException { - - m_comp = ComponentHandler.findComponent(ci, true, timeout); - return m_comp; - } - -} \ No newline at end of file -- cgit v1.2.3