-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
136 additions
and
12 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
42 changes: 42 additions & 0 deletions
42
Goobi/test/src/de/sub/goobi/helper/enums/PropertyTypeTest.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package de.sub.goobi.helper.enums; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
public class PropertyTypeTest { | ||
|
||
@Test | ||
public void testGetPropertyTypeByName() { | ||
assertEquals(PropertyType.unknown, PropertyType.getByName("unknown")); | ||
assertEquals(PropertyType.String, PropertyType.getByName("something")); | ||
|
||
} | ||
|
||
@Test | ||
public void testGetPropertyTypeShowInDisplay() { | ||
assertTrue(PropertyType.String.getShowInDisplay()); | ||
assertFalse(PropertyType.unknown.getShowInDisplay()); | ||
} | ||
|
||
@Test | ||
public void testGetPropertyTypeGetId() { | ||
assertEquals(0, PropertyType.unknown.getId()); | ||
assertEquals(1, PropertyType.general.getId()); | ||
} | ||
|
||
|
||
@Test | ||
public void testGetPropertyTypeById() { | ||
assertEquals(PropertyType.unknown, PropertyType.getById(0)); | ||
assertEquals(PropertyType.general, PropertyType.getById(1)); | ||
|
||
assertEquals(PropertyType.String, PropertyType.getById(666)); | ||
} | ||
|
||
@Test | ||
public void testGetPropertyTypeToString() { | ||
assertEquals(PropertyType.unknown.getName(), PropertyType.unknown.toString()); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
Goobi/test/src/de/sub/goobi/helper/enums/StepEditTypeTest.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.sub.goobi.helper.enums; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
import de.sub.goobi.helper.Helper; | ||
|
||
public class StepEditTypeTest { | ||
|
||
@Test | ||
public void testStepEditTypeGetValue() { | ||
assertTrue(StepEditType.UNNOWKN.getValue() == 0); | ||
} | ||
|
||
@Test | ||
public void testStepEditTypeGetTitle() { | ||
assertEquals(Helper.getTranslation("unbekannt"), StepEditType.UNNOWKN.getTitle()); | ||
} | ||
|
||
|
||
@Test | ||
public void testStepEditTypeGetTypeFromValue() { | ||
assertEquals(StepEditType.MANUAL_SINGLE, StepEditType.getTypeFromValue(1)); | ||
assertEquals(StepEditType.UNNOWKN, StepEditType.getTypeFromValue(666)); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
Goobi/test/src/de/sub/goobi/helper/enums/StepStatusTest.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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package de.sub.goobi.helper.enums; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
import de.sub.goobi.helper.Helper; | ||
|
||
public class StepStatusTest { | ||
|
||
@Test | ||
public void testStepStatusGetValue() { | ||
assertTrue(StepStatus.LOCKED.getValue() == 0); | ||
} | ||
|
||
@Test | ||
public void testStepStatusGetTitle() { | ||
assertEquals(Helper.getTranslation("statusGesperrt"), StepStatus.LOCKED.getTitle()); | ||
assertEquals(Helper.getTranslation("statusOffen"), StepStatus.OPEN.getTitle()); | ||
assertEquals(Helper.getTranslation("statusInBearbeitung"), StepStatus.INWORK.getTitle()); | ||
assertEquals(Helper.getTranslation("statusAbgeschlossen"), StepStatus.DONE.getTitle()); | ||
} | ||
|
||
|
||
@Test | ||
public void testStepStatusGetSmallImagePath() { | ||
assertEquals("images/status/red_10.gif", StepStatus.LOCKED.getSmallImagePath()); | ||
assertEquals("images/status/orange_10.gif", StepStatus.OPEN.getSmallImagePath()); | ||
assertEquals("images/status/yellow_10.gif", StepStatus.INWORK.getSmallImagePath()); | ||
assertEquals("images/status/green_10.gif", StepStatus.DONE.getSmallImagePath()); | ||
} | ||
|
||
@Test | ||
public void testStepStatusGetBigImagePath() { | ||
assertEquals("images/status/red_15a.gif", StepStatus.LOCKED.getBigImagePath()); | ||
assertEquals("images/status/orange_15a.gif", StepStatus.OPEN.getBigImagePath()); | ||
assertEquals("images/status/yellow_15a.gif", StepStatus.INWORK.getBigImagePath()); | ||
assertEquals("images/status/green_15a.gif", StepStatus.DONE.getBigImagePath()); | ||
} | ||
|
||
|
||
@Test | ||
public void testStepStatusGetStatusFromValue() { | ||
assertEquals(StepStatus.LOCKED, StepStatus.getStatusFromValue(0)); | ||
assertEquals(StepStatus.OPEN, StepStatus.getStatusFromValue(1)); | ||
assertEquals(StepStatus.INWORK, StepStatus.getStatusFromValue(2)); | ||
assertEquals(StepStatus.DONE, StepStatus.getStatusFromValue(3)); | ||
assertEquals(StepStatus.LOCKED, StepStatus.getStatusFromValue(666)); | ||
} | ||
|
||
@Test | ||
public void testStepStatusGetSearchString() { | ||
assertEquals("steplocked", StepStatus.LOCKED.getSearchString()); | ||
assertEquals("stepopen", StepStatus.OPEN.getSearchString()); | ||
assertEquals("stepinwork", StepStatus.INWORK.getSearchString()); | ||
assertEquals("stepdone", StepStatus.DONE.getSearchString()); | ||
|
||
} | ||
} |
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