
org.specrunner.objects.AbstractPluginObjectSelect Maven / Gradle / Ivy
The newest version!
/*
SpecRunner - Acceptance Test Driven Development Tool
Copyright (C) 2011-2013 Thiago Santos
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
*/
package org.specrunner.objects;
import java.util.List;
import org.specrunner.context.IContext;
import org.specrunner.plugins.ActionType;
import org.specrunner.plugins.type.Assertion;
import org.specrunner.result.IResultSet;
import org.specrunner.util.UtilLog;
import org.specrunner.util.xom.RowAdapter;
/**
* Performs something on a selected object.
*
* @author Thiago Santos
* @param
* The source type.
*/
public abstract class AbstractPluginObjectSelect extends AbstractPluginObject {
/**
* The default object selector.
*/
protected IObjectSelector selector;
/**
* The source.
*/
protected T source;
/**
* Create a select plugin, provided an object selector.
*
* @param selector
* The selector.
*/
public AbstractPluginObjectSelect(IObjectSelector selector) {
this.selector = selector;
}
@Override
public ActionType getActionType() {
return Assertion.INSTANCE;
}
@Override
public boolean isMapped() {
return false;
}
@Override
protected void action(IContext context, Object instance, RowAdapter row, IResultSet result) throws Exception {
if (UtilLog.LOG.isDebugEnabled()) {
UtilLog.LOG.debug("KEYS>" + reference);
}
source = selector.getSource(this, context);
try {
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy