Skip to content

Commit

Permalink
Release XLT 6.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jowerner committed May 23, 2022
2 parents f839773 + 180e2e3 commit 11a94d4
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 37 deletions.
2 changes: 1 addition & 1 deletion bin/agent.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set CP_PATCHES=%AGENT_HOME%\patches\classes;%AGENT_HOME%\patches\lib\*
set CP_XLT=%XLT_HOME%\target\classes;%XLT_HOME%\lib\*
set CP_STD=%AGENT_HOME%\classes;%AGENT_HOME%\lib\*
set CP_MVN=%AGENT_HOME%\target\classes;%AGENT_HOME%\target\test-classes;%AGENT_HOME%\target\dependency\*
set CP_GRD=%AGENT_HOME%\build\classes\java\main;%AGENT_HOME%\build\classes\java\test
set CP_GRD=%AGENT_HOME%\build\classes\java\main;%AGENT_HOME%\build\resources\main;%AGENT_HOME%\build\classes\java\test;%AGENT_HOME%\build\resources\test;%AGENT_HOME%\build\dependency\*
set CP_ECL=%AGENT_HOME%\bin
set CLASSPATH=%CP_PATCHES%;%CP_XLT%;%CP_STD%;%CP_MVN%;%CP_GRD%;%CP_ECL%

Expand Down
2 changes: 1 addition & 1 deletion bin/agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CP_PATCHES="$AGENT_HOME"/patches/classes:"$AGENT_HOME"/patches/lib/*
CP_XLT="$XLT_HOME"/target/classes:"$XLT_HOME"/lib/*
CP_STD="$AGENT_HOME"/classes:"$AGENT_HOME"/lib/*
CP_MVN="$AGENT_HOME"/target/classes:"$AGENT_HOME"/target/test-classes:"$AGENT_HOME"/target/dependency/*
CP_GRD="$AGENT_HOME"/build/classes/java/main:"$AGENT_HOME"/build/classes/java/test
CP_GRD="$AGENT_HOME"/build/classes/java/main:"$AGENT_HOME"/build/resources/main:"$AGENT_HOME"/build/classes/java/test:"$AGENT_HOME"/build/resources/test:"$AGENT_HOME"/build/dependency/*
CP_ECL="$AGENT_HOME"/bin
CLASSPATH="$CP_PATCHES":"$CP_XLT":"$CP_STD":"$CP_MVN":"$CP_GRD":"$CP_ECL"

Expand Down
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ poster-store.version = 1.1.2
poster-store.url = ${nexus.url}/${poster-store.name}/${poster-store.version}/${poster-store.name}-${poster-store.version}.war

jenkins-plugin.name = xlt-jenkins-plugin
jenkins-plugin.version = 2.0.0
jenkins-plugin.version = 2.0.1
jenkins-plugin.url = ${maven.url}/${jenkins-plugin.name}/${jenkins-plugin.version}/${jenkins-plugin.name}-${jenkins-plugin.version}.hpi
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xceptance</groupId>
<artifactId>xlt</artifactId>
<version>6.2.0</version>
<version>6.2.1</version>
<packaging>jar</packaging>

<name>XLT</name>
Expand Down
41 changes: 24 additions & 17 deletions src/main/java/com/xceptance/xlt/engine/XltWebClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public LightWeightPage getLightWeightPage(final WebRequest webRequestSettings) t
}

// load static content if configured to do so
loadStaticContent(response.getContentAsString(), response.getWebRequest().getUrl(), response.getContentCharset());
loadStaticContent(response);

page = new LightWeightPageImpl(response, getTimerName(), this);

Expand Down Expand Up @@ -680,8 +680,8 @@ public void loadNewStaticContent(final HtmlPage htmlPage)
final String mediaAttribute = e.getAttribute("media");
final String hrefAttribute = e.getAttribute("href");

if (StringUtils.isNotEmpty(hrefAttribute) && RegExUtils.isMatching(relAttribute, LINKTYPE_WHITELIST_PATTERN)
&& (StringUtils.isBlank(mediaAttribute) || RegExUtils.isMatching(mediaAttribute, LINK_MEDIA_WHITELIST_PATTERN)))
if (StringUtils.isNotEmpty(hrefAttribute) && RegExUtils.isMatching(relAttribute, LINKTYPE_WHITELIST_PATTERN) &&
(StringUtils.isBlank(mediaAttribute) || RegExUtils.isMatching(mediaAttribute, LINK_MEDIA_WHITELIST_PATTERN)))
{
urlStrings.add(hrefAttribute);
}
Expand Down Expand Up @@ -732,26 +732,32 @@ public void loadNewStaticContent(final HtmlPage htmlPage)
}

/**
* Loads static content referenced from the given page represented as string. Currently, this includes:
* Loads static content referenced from the page represented by the given web response. Currently, this includes:
* <ul>
* <li>images</li>
* <li>style sheets</li>
* <li>scripts</li>
* </ul>
*
* @param page
* the unparsed source of the page
* @param baseURL
* the URL that produced the page
* @param response
* the response representing the page
*/
private void loadStaticContent(String page, final URL baseURL, final Charset charset)
private void loadStaticContent(final WebResponse response)
{
final boolean haveJS = getOptions().isJavaScriptEnabled();
final boolean haveCss = getOptions().isCssEnabled();

// Exit early
if (page == null || (!loadStaticContent && !haveJS && !haveCss))
if (response == null || (!loadStaticContent && !haveJS && !haveCss))
{
return;
}

// we need the string of the web response
String page = response.getContentAsString();
if (page == null)
{
// not sure why that could happen
return;
}

Expand Down Expand Up @@ -814,8 +820,8 @@ private void loadStaticContent(String page, final URL baseURL, final Charset cha
// check type and media attributes if present
final String typeAtt = LWPageUtilities.getAttributeValue(styleAtts, "type");
final String mediaAtt = LWPageUtilities.getAttributeValue(styleAtts, "media");
if ("text/css".equalsIgnoreCase(typeAtt)
&& (StringUtils.isBlank(mediaAtt) || RegExUtils.isMatching(mediaAtt, LINK_MEDIA_WHITELIST_PATTERN)))
if ("text/css".equalsIgnoreCase(typeAtt) &&
(StringUtils.isBlank(mediaAtt) || RegExUtils.isMatching(mediaAtt, LINK_MEDIA_WHITELIST_PATTERN)))
{
sb.append(m.group(2));
}
Expand Down Expand Up @@ -852,7 +858,8 @@ private void loadStaticContent(String page, final URL baseURL, final Charset cha
}

// check for base tag and correct base URL if necessary
URL baseUrl = baseURL;
final URL referrerUrl = response.getWebRequest().getUrl();
URL baseUrl = referrerUrl;
final List<String> baseUrls = LWPageUtilities.getAllBaseLinks(page);
if (!baseUrls.isEmpty())
{
Expand All @@ -865,7 +872,7 @@ private void loadStaticContent(String page, final URL baseURL, final Charset cha
}

// finally load all collected resources
loadStaticContent(resolveUrls(urlStrings, baseUrl), baseURL, charset);
loadStaticContent(resolveUrls(urlStrings, baseUrl), referrerUrl, response.getContentCharset());
}

/**
Expand Down Expand Up @@ -993,7 +1000,7 @@ public WebResponse loadWebResponse(final WebRequest request) throws IOException
public Page loadWebResponseInto(final WebResponse webResponse, final WebWindow webWindow)
throws IOException, FailingHttpStatusCodeException
{
loadStaticContent(webResponse.getContentAsString(), webResponse.getWebRequest().getUrl(), webResponse.getContentCharset());
loadStaticContent(webResponse);

final Page p = super.loadWebResponseInto(webResponse, webWindow);
if (webWindow.getTopWindow() == webWindow)
Expand Down Expand Up @@ -1593,8 +1600,8 @@ private void addCssStyleRulesWithUrls(final CSSStyleSheet sheet, final List<CSSS
{
if (XltLogger.runTimeLogger.isDebugEnabled())
{
XltLogger.runTimeLogger.debug("Failed to process CSS style sheet: " + sheet.getUri() + ". Cause: "
+ t.getMessage());
XltLogger.runTimeLogger.debug("Failed to process CSS style sheet: " + sheet.getUri() + ". Cause: " +
t.getMessage());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.text.ParseException;
import java.util.LinkedList;
import java.util.List;
import java.util.function.Supplier;

import org.apache.commons.codec.digest.DigestUtils;

Expand Down Expand Up @@ -277,8 +278,7 @@ else if (dumpMode == DumpMode.ALWAYS)
*/
public void add(final LightWeightPage lwPage)
{
final Page page = new Page(lwPage.getTimerName(), lwPage);
add(page);
add(() -> new Page(lwPage.getTimerName(), lwPage));
}

/**
Expand All @@ -295,8 +295,7 @@ public void add(final String name, final HtmlPage htmlPage)
{
ParameterCheckUtils.isNotNull(name, "name");

final Page page = new Page(name, htmlPage);
add(page);
add(() -> new Page(name, htmlPage));
}

/**
Expand All @@ -313,8 +312,7 @@ public void add(final ActionInfo actionInfo, final byte[] image)
{
ParameterCheckUtils.isNotNull(actionInfo.name, "name");

final Page page = new Page(actionInfo, image);
add(page);
add(() -> new Page(actionInfo, image));
}

/**
Expand All @@ -328,26 +326,29 @@ public void add(final String name)
{
ParameterCheckUtils.isNotNull(name, "name");

final Page page = new Page(name);
add(page);
add(() -> new Page(name));
}

/**
* Adds the given page to the internal in-memory page list if the current dump mode is {@link DumpMode#ON_ERROR}.
* Otherwise the page is either ignored ({@link DumpMode#NEVER}) or dumped immediately ({@link DumpMode#ALWAYS}).
* Adds the page provided by the given page supplier to the internal in-memory page list if the current dump mode is
* {@link DumpMode#ON_ERROR}. Otherwise the page is either ignored ({@link DumpMode#NEVER}) or dumped immediately
* ({@link DumpMode#ALWAYS}).
*
* @param name
* the page's name
* @param image
* the screenshot page
* @param pageSupplier
* the supplier that provides the page on demand
*/
private synchronized void add(final Page page)
private synchronized void add(final Supplier<Page> pageSupplier)
{
if (dumpMode == DumpMode.NEVER)
{
// do nothing
return;
}
else if (dumpMode == DumpMode.ON_ERROR)

// now we need it
final Page page = pageSupplier.get();

if (dumpMode == DumpMode.ON_ERROR)
{
// add a new page and attach all pending requests to it
pages.add(page);
Expand Down

0 comments on commit 11a94d4

Please sign in to comment.