myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject [myfaces-tobago] 04/13: TOBAGO-1633: Use TypeScript instead of JavaScript. Simplify Renderers
Date Fri, 23 Oct 2020 18:39:30 GMT
This is an automated email from the ASF dual-hosted git repository.

lofwyr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git

commit a327ee3ba87e3324a27f91ceb7b645dc9840da4d
Author: Udo Schnurpfeil <udo.schnurpfeil@irian.eu>
AuthorDate: Thu Oct 22 12:45:43 2020 +0200

    TOBAGO-1633: Use TypeScript instead of JavaScript.
    Simplify Renderers
---
 .../renderkit/renderer/LinkRendererUnitTest.java   | 35 ----------------------
 ...rerUnitTest.java => LinksRendererUnitTest.java} | 17 ++---------
 .../{link => links}/link-inside-links-sub.html     |  0
 .../{link => links}/link-inside-links.html         |  0
 4 files changed, 3 insertions(+), 49 deletions(-)

diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
index d4df468..7178b01 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
@@ -22,7 +22,6 @@ package org.apache.myfaces.tobago.internal.renderkit.renderer;
 import org.apache.myfaces.tobago.component.RendererTypes;
 import org.apache.myfaces.tobago.component.Tags;
 import org.apache.myfaces.tobago.component.UILink;
-import org.apache.myfaces.tobago.component.UILinks;
 import org.apache.myfaces.tobago.util.ComponentUtils;
 import org.junit.Assert;
 import org.junit.jupiter.api.Test;
@@ -42,38 +41,4 @@ public class LinkRendererUnitTest extends RendererTestBase {
     Assert.assertEquals(loadHtml("renderer/link/link.html"), formattedResult());
   }
 
-  @Test
-  public void linkInsideLinks() throws IOException {
-    final UILinks l = (UILinks) ComponentUtils.createComponent(
-        facesContext, Tags.links.componentType(), RendererTypes.Links, "list");
-    final UILink c = (UILink) ComponentUtils.createComponent(
-        facesContext, Tags.link.componentType(), RendererTypes.Link, "id");
-    c.setLabel("apache");
-    c.setLink("https://www.apache.org/");
-    l.getChildren().add(c);
-    l.encodeAll(facesContext);
-
-    Assert.assertEquals(loadHtml("renderer/link/link-inside-links.html"), formattedResult());
-  }
-
-  @Test
-  public void linkInsideLinksSub() throws IOException {
-    final UILinks l = (UILinks) ComponentUtils.createComponent(
-        facesContext, Tags.links.componentType(), RendererTypes.Links, "list");
-    final UILink c = (UILink) ComponentUtils.createComponent(
-        facesContext, Tags.link.componentType(), RendererTypes.Link, "id");
-    c.setLabel("apache");
-
-    final UILink s = (UILink) ComponentUtils.createComponent(
-        facesContext, Tags.link.componentType(), RendererTypes.Link, "sub");
-    s.setLabel("sub");
-    s.setLink("https://www.apache.org/");
-    c.getChildren().add(s);
-
-    l.getChildren().add(c);
-    l.encodeAll(facesContext);
-
-    Assert.assertEquals(loadHtml("renderer/link/link-inside-links-sub.html"), formattedResult());
-  }
-
 }
diff --git a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinksRendererUnitTest.java
similarity index 79%
copy from tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
copy to tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinksRendererUnitTest.java
index d4df468..7ebcef0 100644
--- a/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinkRendererUnitTest.java
+++ b/tobago-core/src/test/java/org/apache/myfaces/tobago/internal/renderkit/renderer/LinksRendererUnitTest.java
@@ -29,18 +29,7 @@ import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
 
-public class LinkRendererUnitTest extends RendererTestBase {
-
-  @Test
-  public void link() throws IOException {
-    final UILink c = (UILink) ComponentUtils.createComponent(
-        facesContext, Tags.link.componentType(), RendererTypes.Link, "id");
-    c.setLabel("label");
-    c.setLink("https://www.apache.org/");
-    c.encodeAll(facesContext);
-
-    Assert.assertEquals(loadHtml("renderer/link/link.html"), formattedResult());
-  }
+public class LinksRendererUnitTest extends RendererTestBase {
 
   @Test
   public void linkInsideLinks() throws IOException {
@@ -53,7 +42,7 @@ public class LinkRendererUnitTest extends RendererTestBase {
     l.getChildren().add(c);
     l.encodeAll(facesContext);
 
-    Assert.assertEquals(loadHtml("renderer/link/link-inside-links.html"), formattedResult());
+    Assert.assertEquals(loadHtml("renderer/links/link-inside-links.html"), formattedResult());
   }
 
   @Test
@@ -73,7 +62,7 @@ public class LinkRendererUnitTest extends RendererTestBase {
     l.getChildren().add(c);
     l.encodeAll(facesContext);
 
-    Assert.assertEquals(loadHtml("renderer/link/link-inside-links-sub.html"), formattedResult());
+    Assert.assertEquals(loadHtml("renderer/links/link-inside-links-sub.html"), formattedResult());
   }
 
 }
diff --git a/tobago-core/src/test/resources/renderer/link/link-inside-links-sub.html b/tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html
similarity index 100%
rename from tobago-core/src/test/resources/renderer/link/link-inside-links-sub.html
rename to tobago-core/src/test/resources/renderer/links/link-inside-links-sub.html
diff --git a/tobago-core/src/test/resources/renderer/link/link-inside-links.html b/tobago-core/src/test/resources/renderer/links/link-inside-links.html
similarity index 100%
rename from tobago-core/src/test/resources/renderer/link/link-inside-links.html
rename to tobago-core/src/test/resources/renderer/links/link-inside-links.html


Mime
View raw message