Skip to content
Snippets Groups Projects
Commit d753f0aa authored by Goik Martin's avatar Goik Martin
Browse files

Checking for inheritance Reifen extends Ersatzteil

parent 1850b728
No related branches found
No related tags found
No related merge requests found
.classpath
.project
.settings
......@@ -3,8 +3,6 @@ package de.hdm_stuttgart.mi.sd1.test.aufgabe2;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import javax.management.relation.RelationNotFoundException;
import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.Test;
......@@ -190,6 +188,7 @@ public class Test_Ersatzteil extends ExaminationTestDefaults {
Assert.fail("Konnte 'new Reifen(1132, 160)' nicht aufrufen.");
return;
}
Assert.assertTrue("Objekt ist kein Ersatzteil", reifen instanceof Ersatzteil);
try {
Assert.assertEquals("Reifen, Teilenummer:1132, Maximalgeschwindigkeit:160 Kmh", rHelper.reifen_toString.method.invoke(reifen, new Object[] {}));
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
......
......@@ -3,8 +3,6 @@ package de.hdm_stuttgart.mi.sd1.test.aufgabe2;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
import javax.management.relation.RelationNotFoundException;
import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.Test;
......@@ -190,6 +188,7 @@ public class Test_Ersatzteil extends ExaminationTestDefaults {
Assert.fail("Konnte 'new Reifen(1132, 160)' nicht aufrufen.");
return;
}
Assert.assertTrue("Objekt ist kein Ersatzteil", reifen instanceof Ersatzteil);
try {
Assert.assertEquals("Reifen, Teilenummer:1132, Maximalgeschwindigkeit:160 Kmh", rHelper.reifen_toString.method.invoke(reifen, new Object[] {}));
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment