Sync with master

remotes/1731411607042984726/tmp_refs/heads/master^2
Lasantha Dharmakeerthi 3 months ago
commit 130bd68340

@ -1,6 +1,6 @@
<?org.wso2.uesxml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -21,7 +21,7 @@
<parent>
<groupId>io.entgra.community.iots</groupId>
<artifactId>distribution</artifactId>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,6 +1,6 @@
<?org.wso2.uesxml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -22,7 +22,7 @@
<parent>
<groupId>io.entgra.community.iots</groupId>
<artifactId>io.entgra.community.iots.parent</artifactId>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -22,7 +22,7 @@
<parent>
<groupId>io.entgra.community.iots</groupId>
<artifactId>io.entgra.community.iots.parent</artifactId>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,8 +22,11 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.DirectoryFileFilter;
import org.apache.commons.io.filefilter.RegexFileFilter;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.wso2.carbon.automation.engine.context.AutomationContext;
import org.wso2.carbon.automation.engine.context.beans.User;
import org.wso2.carbon.automation.engine.exceptions.AutomationFrameworkException;
@ -40,6 +43,7 @@ import javax.xml.xpath.XPathExpressionException;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
@ -53,6 +57,7 @@ public class CarbonServerManagerExtension {
private ServerLogReader inputStreamHandler;
private ServerLogReader errorStreamHandler;
private boolean isCoverageEnable = false;
private Set<String> coverageClassesDirectories = new HashSet();
private String coverageDumpFilePath;
private int portOffset = 0;
private static final String SERVER_SHUTDOWN_MESSAGE = "Halting JVM";
@ -183,6 +188,7 @@ public class CarbonServerManagerExtension {
try {
this.isCoverageEnable = Boolean.parseBoolean(this.automationContext.getConfigurationValue("//coverage"));
this.coverageClassesDirectories = this.getCoverageClassesDirectories(this.automationContext);
} catch (XPathExpressionException var8) {
throw new AutomationFrameworkException("Coverage configuration not found in automation.xml", var8);
}
@ -196,6 +202,28 @@ public class CarbonServerManagerExtension {
}
}
private Set<String> getCoverageClassesDirectories(AutomationContext automationContext) throws XPathExpressionException {
Set<String> coverageDirectories = new HashSet();
Node configurationNode = automationContext.getConfigurationNode("//coverageClassesRelativeDirectories");
if (configurationNode != null) {
NodeList childNodes = configurationNode.getChildNodes();
if (childNodes != null) {
for(int i = 0; i <= childNodes.getLength() - 1; ++i) {
Node node = childNodes.item(i);
if (node != null && "coverageClassesRelativeDirectory".equals(node.getNodeName())) {
coverageDirectories.add(node.getTextContent());
}
}
}
} else if (StringUtils.isNotEmpty(automationContext.getConfigurationValue("//coverageClassesRelativeDirectory"))) {
coverageDirectories.add(automationContext.getConfigurationValue("//coverageClassesRelativeDirectory"));
} else {
coverageDirectories.add("repository" + File.separator + "components" + File.separator + "plugins" + File.separator);
}
return coverageDirectories;
}
public synchronized void serverShutdown(int portOffset) throws AutomationFrameworkException {
if(this.process != null) {
log.info("Shutting down server..");
@ -235,8 +263,7 @@ public class CarbonServerManagerExtension {
if(this.isCoverageEnable) {
try {
log.info("Generating Jacoco code coverage...");
this.generateCoverageReport(new File(this.carbonHome + File.separator + "repository"
+ File.separator + "components" + File.separator + "plugins" + File.separator));
this.generateCoverageReport(this.coverageClassesDirectories);
} catch (IOException var7) {
log.error("Failed to generate code coverage ", var7);
throw new AutomationFrameworkException("Failed to generate code coverage ", var7);
@ -250,7 +277,7 @@ public class CarbonServerManagerExtension {
}
private void generateCoverageReport(File classesDir) throws IOException, AutomationFrameworkException {
private void generateCoverageReport(Set<String> classesDir) throws IOException, AutomationFrameworkException {
checkJacocoDataFileSizes(FrameworkPathUtil.getJacocoCoverageHome());
CodeCoverageUtils.executeMerge(FrameworkPathUtil.getJacocoCoverageHome(), FrameworkPathUtil.getCoverageMergeFilePath());
ReportGenerator reportGenerator = new ReportGenerator(new File(FrameworkPathUtil.getCoverageMergeFilePath()), classesDir, new File(CodeCoverageUtils.getJacocoReportDirectory()), (File)null);

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -21,7 +21,7 @@
<parent>
<groupId>io.entgra.community.iots</groupId>
<artifactId>io.entgra.community.iots.parent</artifactId>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -1,5 +1,5 @@
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except

@ -1,7 +1,7 @@
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,7 +1,7 @@
<%--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,7 +1,7 @@
<%--
~ Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,8 +1,8 @@
<%--
~ Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,7 +1,7 @@
<%--
~ Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,7 +1,7 @@
<%--
~ Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,8 +1,8 @@
<%--
~ Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,7 +1,7 @@
#
# Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
# Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at

@ -1,7 +1,7 @@
#
# Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
# Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at

@ -1,7 +1,7 @@
<!--
~ Copyright (c) 2023, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -22,7 +22,7 @@
<parent>
<groupId>io.entgra.community.iots</groupId>
<artifactId>io.entgra.community.iots.parent</artifactId>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2018-2023, Entgra (Pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
~
~ Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
@ -23,7 +23,7 @@
<groupId>io.entgra.community.iots</groupId>
<artifactId>io.entgra.community.iots.parent</artifactId>
<packaging>pom</packaging>
<version>5.2.2-SNAPSHOT</version>
<version>5.3.1-SNAPSHOT</version>
<name>Entgra Community Product - Parent</name>
<url>http://entgra.io</url>
<description>Entgra Community Product</description>
@ -267,14 +267,14 @@
<entgra-iot-community>entgra-iots-community-${project.version}</entgra-iot-community>
<!-- Carbon Device Management-->
<io.entgra.device.mgt.core.version>5.0.26-SNAPSHOT</io.entgra.device.mgt.core.version>
<io.entgra.device.mgt.core.version>5.2.4-SNAPSHOT</io.entgra.device.mgt.core.version>
<carbon.p2.plugin.version>5.1.2</carbon.p2.plugin.version>
<!--Orbit versions-->
<orbit.h2.engine.version>2.1.210.wso2v1</orbit.h2.engine.version>
<io.entgra.device.mgt.plugins.version>6.0.17-SNAPSHOT</io.entgra.device.mgt.plugins.version>
<io.entgra.device.mgt.plugins.version>6.1.1-SNAPSHOT</io.entgra.device.mgt.plugins.version>
<!--Testing-->
<google.gson.version>2.9.1</google.gson.version>

Loading…
Cancel
Save