package de.tudresden.inf.lat.born.owlapi.example;

import java.util.ArrayList;
import java.util.List;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
 * This is a unit test for {@link ExampleLoader}.
 * 
 * @author Julian Mendez
 *
 */
public class ExampleLoaderTest {

	private final List<ExampleConfiguration> list = new ArrayList<>();

	/**
	 * Tests the example loader and loads all the example configurations.
	 */
	@BeforeEach
	public void testGetExampleConfigurations() {
		ExampleLoader loader = new ExampleLoader();
		this.list.clear();
		this.list.addAll(loader.getExampleConfigurations());
		Assertions.assertEquals(6, this.list.size());
	}

	/**
	 * Tests example 0.
	 */
	@Test
	public void testExample0() {
		ExampleConfiguration conf = this.list.get(0);
		Assertions.assertEquals("example-0", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-0.owl"));
		Assertions.assertEquals("query(sub('ont:a', 'ont:e')).\n\n", conf.getQuery());
	}

	/**
	 * Tests example 1.
	 */
	@Test
	public void testExample1() {
		ExampleConfiguration conf = this.list.get(1);
		Assertions.assertEquals("example-1", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-1.owl"));
		Assertions.assertEquals("query(sub('ont:a', 'ont:e')).\n\n", conf.getQuery());
	}

	/**
	 * Tests example 2.
	 */
	@Test
	public void testExample2() {
		ExampleConfiguration conf = this.list.get(2);
		Assertions.assertEquals("example-2", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-2.owl"));
		Assertions.assertEquals("query(inst('ont:i0', 'ont:e')).\n\n", conf.getQuery());
	}

	/**
	 * Tests example 3.
	 */
	@Test
	public void testExample3() {
		ExampleConfiguration conf = this.list.get(3);
		Assertions.assertEquals("example-3", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-3.owl"));
		Assertions.assertEquals("query(inst('ont:r', 'ont:i0', 'ont:i1')).\n\n", conf.getQuery());
	}

	/**
	 * Tests example 4.
	 */
	@Test
	public void testExample4() {
		ExampleConfiguration conf = this.list.get(4);
		Assertions.assertEquals("example-4", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-4.owl"));
		Assertions.assertEquals("query(inst('ont:r', 'ont:i0', 'ont:i1')).\n\n", conf.getQuery());
	}

	/**
	 * Tests example 5.
	 */
	@Test
	public void testExample5() {
		ExampleConfiguration conf = this.list.get(5);
		Assertions.assertEquals("example-5", conf.getOntologyName());
		Assertions.assertTrue(conf.getOntologyFileName().endsWith("/examples/example-5.owl"));
		Assertions.assertEquals("query(sub('ont:a', 'ont:d')).\n\n", conf.getQuery());
	}

}

@@ -141,49 +141,8 @@
 ns;%0A
-import org.junit.jupiter.api.BeforeEach;%0A
 impo
@@ -350,23 +350,32 @@
 t = 
-new ArrayList%3C%3E
+getExampleConfigurations
 ();%0A
@@ -461,38 +461,44 @@
 */%0A%09
-@BeforeEach%0A%09public void testG
+public List%3CExampleConfiguration%3E  g
 etEx
@@ -573,45 +573,57 @@
 ;%0A%09%09
-this.list.clear();%0A%09%09this.list.addAll
+List%3CExampleConfiguration%3E list = new ArrayList%3C%3E
 (loa
@@ -684,21 +684,16 @@
 uals(6, 
-this.
 list.siz
@@ -694,24 +694,39 @@
 st.size());%0A
+%09%09return list;%0A
 %09%7D%0A%0A%09/**%0A%09 *

Make small change in unit test