/**
 * Copyright (c) Anton Johansson <antoon.johansson@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.antonjohansson.svncommit.core.view;

import java.io.IOException;
import java.net.URL;

import org.testfx.api.FxAssert;
import org.testfx.framework.junit.ApplicationTest;
import org.testfx.service.query.NodeQuery;

import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 * Abstract skeleton for testing {@link View} implementations.
 *
 * @author Anton Johansson
 */
public abstract class AbstractViewTest<V extends View> extends ApplicationTest
{
	private final Class<V> viewClass;

	protected V view;

	/**
	 * Constructs a new {@link AbstractViewTest}.
	 */
	protected AbstractViewTest()
	{
		this.viewClass = Utils.getParameterClass(getClass());
	}

	/** {@inheritDoc} */
	@Override
	public final void start(Stage stage) throws Exception
	{
		String name = viewClass.getSimpleName() + ".fxml";
		URL location = viewClass.getResource(name);
		try
		{
			FXMLLoader loader = new FXMLLoader(location);
			Parent parent = loader.load();
			view = loader.getController();
			view.setParent(parent);

			stage.setScene(new Scene(parent));
			stage.show();
		}
		catch (IOException e)
		{
			throw new RuntimeException(e);
		}
		
		initNodes();
	}

	/**
	 * Initializes the nodes that should be verified.
	 */
	protected abstract void initNodes();

	/**
	 * Gets a node by its unique identifier.
	 * 
	 * @param identifier The identifier of the node.
	 * @return Returns the node.
	 */
	protected <N extends Node> N getNode(String identifier)
	{
		NodeQuery query = FxAssert.assertContext().getNodeFinder().lookup("#" + identifier);
		return query.queryFirst();
	}
}

@@ -1466,16 +1466,159 @@
 tion%0A%09%7B%0A
+%09%09URL resource = AbstractViewTest.class.getResource(%22/%22 + viewClass.getName().replace(%22.%22, %22/%22) + %22.fxml%22);%0A%09%09System.out.println(resource);%0A%09%09%0A
 %09%09String
@@ -1708,16 +1708,19 @@
 (name);%0A
+%09%09%0A
 %09%09try%0A%09%09

Debug Travis