/*
 * #%L
 * ImageJ software for multidimensional image processing and analysis.
 * %%
 * Copyright (C) 2014 - 2015 Board of Regents of the University of
 * Wisconsin-Madison, University of Konstanz and Brian Northan.
 * %%
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 * #L%
 */

package net.imagej.ops;

import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Test;
import org.scijava.InstantiableException;
import org.scijava.plugin.PluginInfo;

/**
 * Test for marker interface of each Op.
 * 
 * @author Leon Yang
 */
public class OpInterfaceTest extends AbstractOpTest {

	/**
	 * Tests if each Op implements the marker interface that the it uses as its
	 * plug-in type.
	 */
	@Test
	public void testOpInterface() {
		List<PluginInfo<Op>> infos = ops.getPlugins();
		for (PluginInfo<Op> info : infos) {
			final Class<Op> type = info.getPluginType();
			try {
				info.loadClass();
			}
			catch (InstantiableException e) {
				// do something?
				e.printStackTrace();
				continue;
			}
			final Class<? extends Op> clazz = info.getPluginClass();
			final String msg = type + " is not assignable from " + clazz;
			assertTrue(msg, type.isAssignableFrom(clazz));
		}
	}
}

@@ -1607,32 +1607,8 @@
 e;%0A%0A
-import java.util.List;%0A%0A
 impo
@@ -1722,45 +1722,55 @@
 Test
- for marker interface of each Op
+s the consistency of declared op interfaces
 .%0A *
- 
 %0A * 
@@ -1865,17 +1865,19 @@
 sts 
-if
+that
  each 
-O
+o
 p im
@@ -1911,20 +1911,16 @@
 ce that 
-the 
 it uses 
@@ -1934,17 +1934,16 @@
 %09 * plug
--
 in type.
@@ -1990,17 +1990,52 @@
 e() 
-%7B%0A%09%09List%3C
+throws InstantiableException %7B%0A%09%09for (final 
 Plug
@@ -2048,17 +2048,15 @@
 %3COp%3E
-%3E
  info
-s =
+ :
  ops
@@ -2072,44 +2072,8 @@
 ns()
-;%0A%09%09for (PluginInfo%3COp%3E info : infos
 ) %7B%0A
@@ -2124,146 +2124,8 @@
 ();%0A
-%09%09%09try %7B%0A%09%09%09%09info.loadClass();%0A%09%09%09%7D%0A%09%09%09catch (InstantiableException e) %7B%0A%09%09%09%09// do something?%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%09continue;%0A%09%09%09%7D%0A
 %09%09%09f
@@ -2154,20 +2154,16 @@
 p%3E c
-lazz
  = info.
 getP
@@ -2158,25 +2158,20 @@
  = info.
-getPlugin
+load
 Class();
@@ -2192,21 +2192,35 @@
 ng msg =
- type
+%0A%09%09%09%09type.getName()
  + %22 is 
@@ -2244,20 +2244,26 @@
 om %22 + c
-lazz
+.getName()
 ;%0A%09%09%09ass
@@ -2302,12 +2302,8 @@
 om(c
-lazz
 ));%0A
@@ -2309,10 +2309,11 @@
 %0A%09%09%7D%0A%09%7D%0A
+%0A
 %7D%0A

make various tweaks