You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2019/03/27 23:44:13 UTC

[portals-pluto] 04/05: PLUTO-762 Use regular expression replacement instead of hard-coded string indexes in the TCKLiferayTestDriver

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git

commit 5a7991b4fe4ea778768754d316d06a1ddfa46116
Author: Kyle Stiemann <st...@gmail.com>
AuthorDate: Thu Nov 29 17:57:59 2018 -0500

    PLUTO-762 Use regular expression replacement instead of hard-coded string indexes in the TCKLiferayTestDriver
---
 .../main/java/javax/portlet/tck/driver/TCKLiferayTestDriver.java    | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKLiferayTestDriver.java b/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKLiferayTestDriver.java
index 7c24d8d..dfc7266 100644
--- a/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKLiferayTestDriver.java
+++ b/portlet-tck_3.0/driver/src/main/java/javax/portlet/tck/driver/TCKLiferayTestDriver.java
@@ -75,10 +75,8 @@ public class TCKLiferayTestDriver extends TCKTestDriver {
 
       String[] tokens = tcName.split("_");
       String liferayWar = "_WAR_tck" + tokens[0];
-
-      String noV = tcName.substring(2);
-      StringBuilder b = new StringBuilder(noV);
-      String portletName = b.substring(0, noV.lastIndexOf("_"));
+      String noV = tcName.replaceFirst("^V[0-9]+", "");
+      String portletName = noV.substring(0, noV.lastIndexOf("_"));
       String portletId =  portletName + liferayWar;
 
       String url = baseUrl +