-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ConDec-132: Minor refactoring in order to release version 2.0.9
- Loading branch information
Showing
11 changed files
with
241 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 53 additions & 56 deletions
109
src/test/java/de/uhd/ifi/se/decision/documentation/jira/model/TestKnowledgeType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,61 @@ | ||
package de.uhd.ifi.se.decision.documentation.jira.model; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNull; | ||
|
||
import java.util.ArrayList; | ||
|
||
import static org.junit.Assert.*; | ||
import org.junit.Test; | ||
|
||
public class TestKnowledgeType { | ||
private KnowledgeType knowledgeType; | ||
|
||
@Test | ||
public void testGetKnowledgeTypeNull(){ | ||
assertEquals(KnowledgeType.OTHER,KnowledgeType.getKnowledgeType(null)); | ||
} | ||
|
||
@Test | ||
public void testGetKnowledgeTypeNotExistend(){ | ||
assertEquals(KnowledgeType.OTHER,KnowledgeType.getKnowledgeType("Test")); | ||
} | ||
|
||
@Test | ||
public void testGetKnowledgeTypeExistend(){ | ||
for(KnowledgeType type :KnowledgeType.values()){ | ||
assertEquals(type, KnowledgeType.getKnowledgeType(type.toString())); | ||
} | ||
|
||
} | ||
|
||
@Test | ||
public void testGetSuperTypeNull(){ | ||
assertNull(KnowledgeType.getSuperType(null)); | ||
} | ||
|
||
@Test | ||
public void testGetSuperTypeNotCovered(){ | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.CONTEXT)); | ||
} | ||
|
||
@Test | ||
public void testGetSuperTypeCovered(){ | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.getSuperType(KnowledgeType.ISSUE)); | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.getSuperType(KnowledgeType.GOAL)); | ||
assertEquals(KnowledgeType.SOLUTION, KnowledgeType.getSuperType(KnowledgeType.ALTERNATIVE)); | ||
assertEquals(KnowledgeType.SOLUTION, KnowledgeType.getSuperType(KnowledgeType.CLAIM)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.CONSTRAINT)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.ASSUMPTION)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.IMPLICATION)); | ||
assertEquals(KnowledgeType.RATIONALE, KnowledgeType.getSuperType(KnowledgeType.ARGUMENT)); | ||
assertEquals(KnowledgeType.RATIONALE, KnowledgeType.getSuperType(KnowledgeType.ASSESSMENT)); | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.ISSUE.getSuperType()); | ||
} | ||
|
||
@Test | ||
public void testToString(){ | ||
assertEquals("Issue", KnowledgeType.ISSUE.toString()); | ||
} | ||
|
||
@Test | ||
public void testToList(){ | ||
assertEquals(ArrayList.class, KnowledgeType.toList().getClass()); | ||
} | ||
@Test | ||
public void testGetKnowledgeTypeNull() { | ||
assertEquals(KnowledgeType.OTHER, KnowledgeType.getKnowledgeType(null)); | ||
} | ||
|
||
@Test | ||
public void testGetKnowledgeTypeNotExistend() { | ||
assertEquals(KnowledgeType.OTHER, KnowledgeType.getKnowledgeType("Test")); | ||
} | ||
|
||
@Test | ||
public void testGetKnowledgeTypeExistend() { | ||
for (KnowledgeType type : KnowledgeType.values()) { | ||
assertEquals(type, KnowledgeType.getKnowledgeType(type.toString())); | ||
} | ||
} | ||
|
||
@Test | ||
public void testGetSuperTypeNull() { | ||
assertNull(KnowledgeType.getSuperType(null)); | ||
} | ||
|
||
@Test | ||
public void testGetSuperTypeNotCovered() { | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.CONTEXT)); | ||
} | ||
|
||
@Test | ||
public void testGetSuperTypeCovered() { | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.getSuperType(KnowledgeType.ISSUE)); | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.getSuperType(KnowledgeType.GOAL)); | ||
assertEquals(KnowledgeType.SOLUTION, KnowledgeType.getSuperType(KnowledgeType.ALTERNATIVE)); | ||
assertEquals(KnowledgeType.SOLUTION, KnowledgeType.getSuperType(KnowledgeType.CLAIM)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.CONSTRAINT)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.ASSUMPTION)); | ||
assertEquals(KnowledgeType.CONTEXT, KnowledgeType.getSuperType(KnowledgeType.IMPLICATION)); | ||
assertEquals(KnowledgeType.RATIONALE, KnowledgeType.getSuperType(KnowledgeType.ARGUMENT)); | ||
assertEquals(KnowledgeType.RATIONALE, KnowledgeType.getSuperType(KnowledgeType.ASSESSMENT)); | ||
assertEquals(KnowledgeType.PROBLEM, KnowledgeType.ISSUE.getSuperType()); | ||
} | ||
|
||
@Test | ||
public void testToString() { | ||
assertEquals("Issue", KnowledgeType.ISSUE.toString()); | ||
} | ||
|
||
@Test | ||
public void testToList() { | ||
assertEquals(ArrayList.class, KnowledgeType.toList().getClass()); | ||
} | ||
} |
Oops, something went wrong.