generated from cuioss/cui-java-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing Unit-tests, Adding tld parsing
- Loading branch information
Showing
13 changed files
with
81 additions
and
21 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
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
32 changes: 32 additions & 0 deletions
32
modules/cui-jsf-dev/src/main/java/de/cuioss/jsf/dev/metadata/LibraryTagLib.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,32 @@ | ||
package de.cuioss.jsf.dev.metadata; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import static de.cuioss.jsf.dev.metadata.TagLib.JSF_2_2_FACELET_TAGLIB_NAMESPACE; | ||
import static de.cuioss.jsf.dev.metadata.TagLib.JSF_4_0_FACELET_TAGLIB_NAMESPACE; | ||
|
||
/** | ||
* Isolates concrete {@link TagLib}s to be loaded. | ||
*/ | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public enum LibraryTagLib { | ||
|
||
CUI_CORE("/META-INF/cui-core.taglib.xml", JSF_4_0_FACELET_TAGLIB_NAMESPACE), | ||
CUI_BOOTSTRAP("/META-INF/cui-core.taglib.xml", JSF_4_0_FACELET_TAGLIB_NAMESPACE), | ||
PRIME_FACES("/META-INF/primefaces-p.taglib.xml", JSF_2_2_FACELET_TAGLIB_NAMESPACE), | ||
OMNI_FACES("/META-INF/omnifaces-ui.taglib.xml", JSF_4_0_FACELET_TAGLIB_NAMESPACE), | ||
MY_FACES("/META-INF/standard-faces-config.xml", JSF_4_0_FACELET_TAGLIB_NAMESPACE); | ||
|
||
@Getter | ||
private final String path; | ||
|
||
@Getter | ||
private final String namespace; | ||
|
||
public TagLib load() { | ||
return new TagLib(this.path, this.namespace); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
modules/cui-jsf-dev/src/test/java/de/cuioss/jsf/dev/metadata/LibraryTagLibTest.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,24 @@ | ||
package de.cuioss.jsf.dev.metadata; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
class LibraryTagLibTest { | ||
|
||
@Test | ||
void shouldLoadTaglibs() { | ||
for (var lib : LibraryTagLib.values()) { | ||
var loaded = assertDoesNotThrow(lib::load, lib.name()); | ||
assertNotNull(loaded); | ||
} | ||
} | ||
|
||
@Test | ||
void shouldHandleMyFaces() { | ||
var loaded = LibraryTagLib.MY_FACES.load(); | ||
assertNotNull(loaded); | ||
System.out.println(loaded); | ||
} | ||
} |
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