correction impl des Parts (engine, Exterio ,...)
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
package src.fr.impl.Parts;
|
package src.fr.impl.Parts;
|
||||||
|
|
||||||
import src.fr.api.PartType;
|
import src.fr.api.PartType;
|
||||||
|
import src.fr.impl.CategoryImpl;
|
||||||
import src.fr.impl.PartImpl;
|
import src.fr.impl.PartImpl;
|
||||||
|
import src.fr.impl.PartTypeImpl;
|
||||||
|
|
||||||
public class Engine extends PartImpl {
|
public class Engine extends PartImpl {
|
||||||
public Engine(PartType partType){
|
public Engine(String name, CategoryImpl category){
|
||||||
super(partType);
|
super(new PartTypeImpl(name,Engine.class, category));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package src.fr.impl.Parts;
|
package src.fr.impl.Parts;
|
||||||
|
|
||||||
import src.fr.api.PartType;
|
import src.fr.impl.CategoryImpl;
|
||||||
import src.fr.impl.PartImpl;
|
import src.fr.impl.PartImpl;
|
||||||
|
import src.fr.impl.PartTypeImpl;
|
||||||
|
|
||||||
public class Exterior extends PartImpl {
|
public class Exterior extends PartImpl {
|
||||||
public Exterior(PartType partType){
|
public Exterior(String name, CategoryImpl category){
|
||||||
super(partType);
|
super(new PartTypeImpl(name,Engine.class, category));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package src.fr.impl.Parts;
|
package src.fr.impl.Parts;
|
||||||
|
|
||||||
import src.fr.api.PartType;
|
import src.fr.impl.CategoryImpl;
|
||||||
import src.fr.impl.PartImpl;
|
import src.fr.impl.PartImpl;
|
||||||
|
import src.fr.impl.PartTypeImpl;
|
||||||
|
|
||||||
public class Interior extends PartImpl {
|
public class Interior extends PartImpl {
|
||||||
public Interior(PartType partType){
|
public Interior(String name, CategoryImpl category){
|
||||||
super(partType);
|
super(new PartTypeImpl(name,Engine.class, category));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package src.fr.impl.Parts;
|
package src.fr.impl.Parts;
|
||||||
|
|
||||||
import src.fr.api.PartType;
|
import src.fr.impl.CategoryImpl;
|
||||||
import src.fr.impl.PartImpl;
|
import src.fr.impl.PartImpl;
|
||||||
|
import src.fr.impl.PartTypeImpl;
|
||||||
|
|
||||||
public class Transmission extends PartImpl {
|
public class Transmission extends PartImpl {
|
||||||
public Transmission(PartType partType){
|
public Transmission(String name, CategoryImpl category){
|
||||||
super(partType);
|
super(new PartTypeImpl(name,Engine.class, category));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,30 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import src.fr.impl.*;
|
import src.fr.impl.*;
|
||||||
|
import src.fr.impl.Parts.*;
|
||||||
import src.fr.api.*;
|
import src.fr.api.*;
|
||||||
|
|
||||||
|
|
||||||
public class test {
|
public class test {
|
||||||
/*
|
CategoryImpl engine = new CategoryImpl("Engine");
|
||||||
=======
|
CategoryImpl transmission = new CategoryImpl("Transmission");
|
||||||
|
|
||||||
|
|
||||||
|
Engine EG100 = new Engine("EG100",engine);
|
||||||
|
Engine EG133 = new Engine("EG133",engine);
|
||||||
|
Engine EG210= new Engine("EG210", engine);
|
||||||
|
Engine ED110= new Engine("ED110", engine);
|
||||||
|
Engine ED180= new Engine("ED180", engine);
|
||||||
|
Engine EH120= new Engine("EH120", engine);
|
||||||
|
|
||||||
|
Transmission TM5= new Transmission("TM5", transmission);
|
||||||
|
Transmission TM6= new Transmission("TM6", transmission);
|
||||||
|
Transmission TA5= new Transmission("TA5", transmission);
|
||||||
|
Transmission TS6= new Transmission("TS6", transmission);
|
||||||
|
Transmission TSF7= new Transmission("TSF7", transmission);
|
||||||
|
Transmission TC120= new Transmission("TC120", transmission);
|
||||||
|
|
||||||
|
/*
|
||||||
Category Engine = new CategoryImpl("Engine");
|
Category Engine = new CategoryImpl("Engine");
|
||||||
Category Transmission = new CategoryImpl("Transmission");
|
Category Transmission = new CategoryImpl("Transmission");
|
||||||
Category Exterior= new CategoryImpl("Exterior");
|
Category Exterior= new CategoryImpl("Exterior");
|
||||||
@@ -44,7 +61,6 @@ public class test {
|
|||||||
PartType IH= new PartTypeImpl("IH", Interior);
|
PartType IH= new PartTypeImpl("IH", Interior);
|
||||||
PartType IS= new PartTypeImpl("IS", Interior);
|
PartType IS= new PartTypeImpl("IS", Interior);
|
||||||
|
|
||||||
|
|
||||||
CompatibilityManager cm = new CompatibilityManagerImpl();
|
CompatibilityManager cm = new CompatibilityManagerImpl();
|
||||||
*/
|
*/
|
||||||
@Before
|
@Before
|
||||||
@@ -93,8 +109,7 @@ public class test {
|
|||||||
cm.addIncompatibilities(IS, ISIncompatibilities);
|
cm.addIncompatibilities(IS, ISIncompatibilities);
|
||||||
cm.addRequirements(IS, ISRequirement);
|
cm.addRequirements(IS, ISRequirement);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -103,46 +118,4 @@ public class test {
|
|||||||
public void test_1_Incompatibilities_1(){
|
public void test_1_Incompatibilities_1(){
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test_multiple_Incompatibilities_2(){
|
|
||||||
assertTrue(
|
|
||||||
cm.getIncompatibilities(TSF7).contains(EG100)&&
|
|
||||||
cm.getIncompatibilities(TSF7).contains(EG133)&&
|
|
||||||
cm.getIncompatibilities(TSF7).contains(ED110)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test_1_Requirements_3(){
|
|
||||||
assertTrue(cm.getRequirements(EH120).contains(TC120));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test_Empty_Incompatibilities_4(){
|
|
||||||
assertTrue(cm.getIncompatibilities(EH120).isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test_Empty_Requirements_5(){
|
|
||||||
assertTrue(cm.getRequirements(ED180).isEmpty());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test_Remove(){
|
|
||||||
assertTrue(cm.getIncompatibilities(XM).contains(EG100));
|
|
||||||
cm.removeIncompatibility(XM, EG100);
|
|
||||||
assertFalse(cm.getIncompatibilities(XM).contains(EG100));
|
|
||||||
Set<PartType> setEG100 = new HashSet<PartType>();
|
|
||||||
setEG100.add(EG100);
|
|
||||||
cm.addIncompatibilities(EG100, setEG100);
|
|
||||||
System.out.println(cm.getIncompatibilities(XM) + "//////////");
|
|
||||||
//assertTrue(cm.getIncompatibilities(XM).contains(EG100));
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user