package org.verapdf.model.impl;

import org.junit.Assert;
import org.junit.Test;
import org.verapdf.model.ModelHelper;

import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;

/**
 * @author Evgeniy Muravitskiy
 */

public abstract class BaseTest {

    protected static org.verapdf.model.baselayer.Object actual;

    protected static String TYPE;
    protected static String ID;

    @Test
    public void testTypeAndID() {
        Assert.assertEquals(TYPE, actual.getType());
        Assert.assertEquals(ID, actual.getID());
    }

	@Test
	public void testLinksMethod() {
		List<String> expectedLinks = ModelHelper.getListOfLinks(actual.getType());
		for (String link : expectedLinks) {
			Assert.assertNotNull(actual.getLinkedObjects(link));
		}
		expectedLinks.clear();
	}

	protected static String getSystemIndependentPath(String path) throws URISyntaxException {
		URL resourceUrl = ClassLoader.class.getResource(path);
		Path resourcePath = Paths.get(resourceUrl.toURI());
		return resourcePath.toString();
	}
}

@@ -416,20 +416,28 @@
  String 
-TYPE
+expectedType
 ;%0A    pr
@@ -458,16 +458,24 @@
  String 
+expected
 ID;%0A%0A   
@@ -547,12 +547,20 @@
 als(
-TYPE
+expectedType
 , ac
@@ -604,16 +604,24 @@
 tEquals(
+expected
 ID, actu
@@ -884,16 +884,149 @@
 ();%0A%09%7D%0A%0A
+%09@Test(expected = IllegalAccessError.class)%0A%09public void testNonexistentParentLink() %7B%0A%09%09actual.getLinkedObjects(%22Wrong link.%22);%0A%09%7D%0A%0A
 %09protect

Add new test for all classes