From 8726e63ad74b58859335bb72df5a0382c0c3930d Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 20 Jan 2020 19:21:27 +0100 Subject: [PATCH] ref 18291: Modify the Accounting Dashboard portlet to support the Core Services Category per gateway https://support.d4science.org/issues/18291 Added IS support --- .../accounting/PortalContextTreeProvider.java | 63 +++++++++- .../is/AccountingDashboardConfigJAXB.java | 49 ++++++++ .../server/is/BuildInfraNode.java | 103 ++++++++++++++++ .../server/is/InformationSystemUtils.java | 94 +++++++++++++++ .../server/is/InfraNodeJAXB.java | 72 +++++++++++ .../accountingdashboard/shared/Constants.java | 10 +- .../shared/is/InfraNode.java | 77 ++++++++++++ .../user/accountingdashboard/ISTest.java | 112 ++++++++++++++++++ 8 files changed, 571 insertions(+), 9 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/AccountingDashboardConfigJAXB.java create mode 100644 src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/BuildInfraNode.java create mode 100644 src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InformationSystemUtils.java create mode 100644 src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InfraNodeJAXB.java create mode 100644 src/main/java/org/gcube/portlets/user/accountingdashboard/shared/is/InfraNode.java create mode 100644 src/test/java/org/gcube/portlets/user/accountingdashboard/ISTest.java diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java index 1785b79..f892bb5 100644 --- a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/accounting/PortalContextTreeProvider.java @@ -13,6 +13,8 @@ import org.gcube.accounting.accounting.summary.access.impl.ContextTreeProvider; import org.gcube.accounting.accounting.summary.access.model.ScopeDescriptor; import org.gcube.common.portal.GCubePortalConstants; import org.gcube.common.portal.PortalContext; +import org.gcube.portlets.user.accountingdashboard.server.is.BuildInfraNode; +import org.gcube.portlets.user.accountingdashboard.shared.is.InfraNode; import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.model.GCubeGroup; @@ -94,7 +96,9 @@ public class PortalContextTreeProvider implements ContextTreeProvider { LinkedList infraChildren = new LinkedList<>(); PortalContext pContext = PortalContext.getConfiguration(); GCubeUser currUser = pContext.getCurrentUser(request); - + + InfraNode infraNode=BuildInfraNode.build(infrastructureScope); + List theGateways = new LiferayGroupManager().getGateways(); for (GCubeGroup gCubeGroup : theGateways) { logger.debug("Gateway: [id=" + gCubeGroup.getGroupId() + ", name=" + gCubeGroup.getGroupName() + "]"); @@ -104,15 +108,49 @@ public class PortalContextTreeProvider implements ContextTreeProvider { LinkedList gatewayChildren = retrieveGatewayChildren(request, gCubeGroup.getGroupId(), currUser); + + if(infraNode!=null){ + String currScope=portalContext.getCurrentScope(gCubeGroup.getGroupId()+""); + ScopeDescriptor infraNodeScopeDescriptor=createRelativeInfraNode(infraNode, currScope); + if(gatewayChildren!=null){ + gatewayChildren.addFirst(infraNodeScopeDescriptor); + } else { + gatewayChildren=new LinkedList<>(); + gatewayChildren.add(infraNodeScopeDescriptor); + } + } + ScopeDescriptor gatewayScopeDescriptor = new ScopeDescriptor(gCubeGroup.getGroupName(), gCubeGroup.getGroupId() + ""); gatewayScopeDescriptor.setChildren(gatewayChildren); infraChildren.add(gatewayScopeDescriptor); } + infra.setChildren(infraChildren); return infra; } + + private ScopeDescriptor createRelativeInfraNode(InfraNode infraNode, String scope){ + ScopeDescriptor scopeDescriptor=null; + if(infraNode!=null){ + StringBuilder absoluteScope=new StringBuilder(); + absoluteScope.append(scope); + absoluteScope.append("/"); + absoluteScope.append(infraNode.getScope()); + scopeDescriptor=new ScopeDescriptor(infraNode.getName(), absoluteScope.toString()); + if(infraNode.getChildren()!=null&&!infraNode.getChildren().isEmpty()){ + LinkedList childsDescriptor=new LinkedList<>(); + for(InfraNode child:infraNode.getChildren()){ + ScopeDescriptor childScopeDescriptor=createRelativeInfraNode(child, absoluteScope.toString()); + childsDescriptor.add(childScopeDescriptor); + } + scopeDescriptor.setChildren(childsDescriptor); + } + } + return scopeDescriptor; + } + private ScopeDescriptor recreateTreeForPortalContext(HttpServletRequest request) throws Exception, PortalException, SystemException { @@ -122,10 +160,23 @@ public class PortalContextTreeProvider implements ContextTreeProvider { PortalContext pContext = PortalContext.getConfiguration(); GCubeUser currUser = pContext.getCurrentUser(request); - + String currScope=pContext.getCurrentScope(currentSiteGroupId+""); + + InfraNode infraNode=BuildInfraNode.build(currScope); + LinkedList rootChildren = null; rootChildren = retrieveGatewayChildren(request, currentSiteGroupId, currUser); - + + if(infraNode!=null){ + ScopeDescriptor infraNodeScopeDescriptor=createRelativeInfraNode(infraNode, currScope); + if(rootChildren!=null){ + rootChildren.addFirst(infraNodeScopeDescriptor); + } else { + rootChildren=new LinkedList<>(); + rootChildren.add(infraNodeScopeDescriptor); + } + } + Group rootGroup = getSiteFromServletRequest(request); root = new ScopeDescriptor(rootGroup.getDescriptiveName(), rootGroup.getGroupId() + ""); root.setChildren(rootChildren); @@ -135,21 +186,23 @@ public class PortalContextTreeProvider implements ContextTreeProvider { private LinkedList retrieveGatewayChildren(HttpServletRequest request, long currentSiteGroupId, GCubeUser currUser) throws Exception, PortalException, SystemException { - + logger.info("Retrieve Gateway Children: currentSiteGroupId="+currentSiteGroupId); + // PARSE TREE LinkedHashMap> gatewayTree = getPortalSitesMappedToVRE(currUser, currentSiteGroupId); logger.debug("Parsing tree from gateway. Size {} ", gatewayTree.size()); + LinkedList rootChildren = new LinkedList<>(); + for (Entry> entry : gatewayTree.entrySet()) { ScopeDescriptor rootChild = new ScopeDescriptor(entry.getKey().name, entry.getKey().categoryID + ""); for (VRE vre : entry.getValue()) rootChild.getChildren().add(new ScopeDescriptor(vre.name, vre.scope)); rootChildren.add(rootChild); } - return rootChildren; } diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/AccountingDashboardConfigJAXB.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/AccountingDashboardConfigJAXB.java new file mode 100644 index 0000000..e0f5182 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/AccountingDashboardConfigJAXB.java @@ -0,0 +1,49 @@ +package org.gcube.portlets.user.accountingdashboard.server.is; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Giancarlo Panichi + * + * + */ + +@XmlRootElement(name = "config") +@XmlAccessorType(XmlAccessType.FIELD) +public class AccountingDashboardConfigJAXB { + + @XmlElement + private boolean enabledInfraNode; + + @XmlElement + private InfraNodeJAXB baseInfraNode; + + public boolean isEnabledInfraNode() { + return enabledInfraNode; + } + + public void setEnabledInfraNode(boolean enabledInfraNode) { + this.enabledInfraNode = enabledInfraNode; + } + + public InfraNodeJAXB getBaseInfraNode() { + return baseInfraNode; + } + + public void setBaseInfraNode(InfraNodeJAXB baseInfraNode) { + this.baseInfraNode = baseInfraNode; + } + + @Override + public String toString() { + return "AccountingDashboardConfigJAXB [enabledInfraNode=" + enabledInfraNode + ", baseInfraNode=" + + baseInfraNode + "]"; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/BuildInfraNode.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/BuildInfraNode.java new file mode 100644 index 0000000..64c02b9 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/BuildInfraNode.java @@ -0,0 +1,103 @@ +package org.gcube.portlets.user.accountingdashboard.server.is; + +import java.util.ArrayList; + +import org.gcube.portlets.user.accountingdashboard.shared.Constants; +import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException; +import org.gcube.portlets.user.accountingdashboard.shared.is.InfraNode; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Giancarlo Panichi + * + * + */ +public class BuildInfraNode { + + private static Logger logger = LoggerFactory.getLogger(BuildInfraNode.class); + + public static InfraNode build(String scope) throws ServiceException { + + InfraNode infraNode = null; + + if (Constants.DEBUG_MODE) { + logger.info("AccountDashboard: use debug configuration for infra nodes."); + infraNode = useDefaultConfiguration(); + } else { + AccountingDashboardConfigJAXB accountingDashboardConfigJAXB = null; + try { + accountingDashboardConfigJAXB = InformationSystemUtils.retrieveAccountingDashboardConfig(scope); + } catch (ServiceException e) { + logger.debug(e.getLocalizedMessage(), e); + } + + if (accountingDashboardConfigJAXB != null) { + logger.info("AccountingDashboard: use configuration in scope: " + scope); + if (accountingDashboardConfigJAXB.isEnabledInfraNode()) { + logger.info("Infra Nodes configuration enabled in scope: " + scope); + InfraNodeJAXB infraNodeJAXB = accountingDashboardConfigJAXB.getBaseInfraNode(); + logger.info("Infra Nodes configuration: " + infraNodeJAXB); + if (infraNodeJAXB != null) { + infraNode = new InfraNode(infraNodeJAXB.getScope(), infraNodeJAXB.getName(), + infraNodeJAXB.getDescription()); + ArrayList children = retrieveChildren(infraNodeJAXB); + infraNode.setChildren(children); + + } else { + logger.info("Infra Nodes use default configuration for scope: " + scope); + infraNode = useDefaultConfiguration(); + } + } else { + logger.info("Infra Nodes configuration disabled in scope: " + scope); + } + } else { + logger.info("AccountingDashboard: use infra nodes default configuration for scope: " + scope); + infraNode = useDefaultConfiguration(); + } + } + + logger.debug("AccountingDashboard: Infra Nodes configuration set: " + infraNode); + return infraNode; + } + + private static InfraNode useDefaultConfiguration() { + InfraNode infraNodeCoreServices = new InfraNode("CoreServices", "Core Services"); + InfraNode infraNodeCatalogue = new InfraNode("CoreServices/Catalogue", "Catalogue"); + InfraNode infraNodeWorkspace = new InfraNode("CoreServices/Workspace", "Workspace"); + InfraNode infraNodeMessages = new InfraNode("CoreServices/Messages", "Messages"); + + ArrayList children = new ArrayList(); + children.add(infraNodeCatalogue); + children.add(infraNodeWorkspace); + children.add(infraNodeMessages); + infraNodeCoreServices.setChildren(children); + + return infraNodeCoreServices; + } + + private static ArrayList retrieveChildren(InfraNodeJAXB infraNodeJAXB) throws ServiceException { + try { + if (infraNodeJAXB.getChildren() == null || infraNodeJAXB.getChildren().isEmpty()) { + return null; + } else { + ArrayList children = new ArrayList<>(); + for (InfraNodeJAXB childJAXB : infraNodeJAXB.getChildren()) { + InfraNode child = new InfraNode(childJAXB.getScope(), childJAXB.getName(), + childJAXB.getDescription()); + ArrayList childrenOfChild = retrieveChildren(infraNodeJAXB); + child.setChildren(childrenOfChild); + children.add(child); + } + return children; + + } + } catch (Throwable e) { + logger.error("Ivalid infra nodes configuration: " + e.getLocalizedMessage(), e); + throw new ServiceException("Ivalid infra nodes configuration: " + e.getLocalizedMessage(), e); + } + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InformationSystemUtils.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InformationSystemUtils.java new file mode 100644 index 0000000..3854677 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InformationSystemUtils.java @@ -0,0 +1,94 @@ +package org.gcube.portlets.user.accountingdashboard.server.is; + +import java.util.Iterator; +import java.util.List; + +import org.gcube.common.resources.gcore.GenericResource; +import org.gcube.common.resources.gcore.ScopeGroup; +import org.gcube.common.scope.api.ScopeProvider; +import org.gcube.portlets.user.accountingdashboard.shared.Constants; +import org.gcube.portlets.user.accountingdashboard.shared.exception.ServiceException; +import org.gcube.resources.discovery.client.api.DiscoveryClient; +import org.gcube.resources.discovery.client.impl.JAXBParser; +import org.gcube.resources.discovery.client.queries.api.SimpleQuery; +import org.gcube.resources.discovery.icclient.ICFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * @author Giancarlo Panichi + * + * + */ +public class InformationSystemUtils { + + private static Logger logger = LoggerFactory.getLogger(InformationSystemUtils.class); + + public static AccountingDashboardConfigJAXB retrieveAccountingDashboardConfig(String scope) throws ServiceException { + try { + + if (scope == null || scope.length() == 0) + return null; + + ScopeProvider.instance.set(scope); + logger.debug("Retrieve Infra Node configuration in scope: " + scope); + + SimpleQuery query = ICFactory.queryFor(GenericResource.class); + query.addCondition( + "$resource/Profile/SecondaryType/text() eq '" + Constants.ACCOUNTING__DASHBOARD_CATEGORY + "'") + .addCondition("$resource/Profile/Name/text() eq '" + Constants.ACCOUNTING_DASHBOARD_NAME + "'") + .setResult("$resource"); + + DiscoveryClient client = ICFactory.clientFor(GenericResource.class); + List accountingResources = client.submit(query); + logger.debug("Resources: " + accountingResources); + + AccountingDashboardConfigJAXB accountingDashboardConfigJAXB = null; + + for (GenericResource genericResource : accountingResources) { + if (genericResource.scopes() != null) { + ScopeGroup scopes = genericResource.scopes(); + Iterator iterator = scopes.iterator(); + String scopeFound = null; + boolean found = false; + while (iterator.hasNext() && !found) { + scopeFound = iterator.next(); + if (scopeFound.compareTo(scope) == 0) { + found = true; + } + } + if (found) { + try { + JAXBParser parser = new JAXBParser(AccountingDashboardConfigJAXB.class); + logger.debug("Body: " + genericResource.profile().bodyAsString()); + accountingDashboardConfigJAXB = (AccountingDashboardConfigJAXB) parser.parse(genericResource.profile().bodyAsString()); + logger.debug("Nodes: " + accountingDashboardConfigJAXB); + } catch (Throwable e) { + String error = "Error in discovery Accounting Dashboard config in scope " + + scope + ". " + "Resource parsing failed!"; + logger.error(error); + logger.error( + "Error {resource=" + genericResource + ", error=" + e.getLocalizedMessage() + "}"); + logger.error(e.getLocalizedMessage(), e); + throw new ServiceException(error, e); + } + break; + + } + + } + } + + return accountingDashboardConfigJAXB; + + } catch (ServiceException e) { + throw e; + } catch (Throwable e) { + String error = "Error in discovery Accounting Dashboard config in scope: " + scope; + logger.error(error,e); + throw new ServiceException(error, e); + } + } + +} diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InfraNodeJAXB.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InfraNodeJAXB.java new file mode 100644 index 0000000..99e7908 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/server/is/InfraNodeJAXB.java @@ -0,0 +1,72 @@ +package org.gcube.portlets.user.accountingdashboard.server.is; + +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementWrapper; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * + * @author Giancarlo Panichi + * + * + */ + +@XmlRootElement(name = "node") +@XmlAccessorType(XmlAccessType.FIELD) +public class InfraNodeJAXB { + @XmlElement + private String scope; + + @XmlElement + private String name; + + @XmlElement(name = "description", required = false) + private String description; + + @XmlElementWrapper(name = "children", required = false) + @XmlElement(name = "node", required = false) + private List children; + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + @Override + public String toString() { + return "InfraNodeJAXB [scope=" + scope + ", name=" + name + ", description=" + description + ", children=" + + children + "]"; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/Constants.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/Constants.java index 67c2a2b..4aa1871 100644 --- a/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/Constants.java @@ -24,14 +24,16 @@ public class Constants { // public static final int PAGE_SIZE_DEFAULT = 20; public static final int PAGE_SIZE_IN_FORM_DEFAULT = 10; - + // Session public static final String CURR_GROUP_ID = "CURR_GROUP_ID"; public static final String CURR_USER_ID = "CURR_USER_ID"; - - + // Service public static final int CLIENT_MONITOR_PERIODMILLIS = 2000; - + + // IS Resource + public static final String ACCOUNTING_DASHBOARD_NAME = "AccountingDashboard"; + public static final String ACCOUNTING__DASHBOARD_CATEGORY = "AccountingProfile"; } diff --git a/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/is/InfraNode.java b/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/is/InfraNode.java new file mode 100644 index 0000000..30b5629 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/accountingdashboard/shared/is/InfraNode.java @@ -0,0 +1,77 @@ +package org.gcube.portlets.user.accountingdashboard.shared.is; + +import java.io.Serializable; +import java.util.ArrayList; + +public class InfraNode implements Serializable { + + private static final long serialVersionUID = 2238683459962419017L; + private String scope; + private String name; + private String description; + private ArrayList children; + + public InfraNode() { + super(); + } + + public InfraNode(String scope, String name) { + super(); + this.scope = scope; + this.name = name; + } + + public InfraNode(String scope, String name, String description) { + super(); + this.scope = scope; + this.name = name; + this.description=description; + } + + public InfraNode(String scope, String name, String description, ArrayList children) { + super(); + this.scope = scope; + this.name = name; + this.description = description; + this.children = children; + } + + public String getScope() { + return scope; + } + + public void setScope(String scope) { + this.scope = scope; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public ArrayList getChildren() { + return children; + } + + public void setChildren(ArrayList children) { + this.children = children; + } + + @Override + public String toString() { + return "InfraNode [scope=" + scope + ", name=" + name + ", description=" + description + ", children=" + + children + "]"; + } + +} \ No newline at end of file diff --git a/src/test/java/org/gcube/portlets/user/accountingdashboard/ISTest.java b/src/test/java/org/gcube/portlets/user/accountingdashboard/ISTest.java new file mode 100644 index 0000000..6be825e --- /dev/null +++ b/src/test/java/org/gcube/portlets/user/accountingdashboard/ISTest.java @@ -0,0 +1,112 @@ +/** + * + */ +package org.gcube.portlets.user.accountingdashboard; + +import java.io.StringWriter; +import java.util.ArrayList; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.gcube.portlets.user.accountingdashboard.server.is.AccountingDashboardConfigJAXB; +import org.gcube.portlets.user.accountingdashboard.server.is.BuildInfraNode; +import org.gcube.portlets.user.accountingdashboard.server.is.InfraNodeJAXB; +import org.gcube.portlets.user.accountingdashboard.shared.Constants; +import org.gcube.portlets.user.accountingdashboard.shared.is.InfraNode; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import junit.framework.TestCase; + +/** + * + * @author Giancarlo Panichi + * + * + */ +public class ISTest extends TestCase { + + private static Logger logger = LoggerFactory.getLogger(ISTest.class); + + @Test + public void testAccountingDashboardResource() { + if (Constants.TEST_ENABLE) { + logger.debug("Test Enabled"); + + try { + logger.debug("Scope: " + Constants.DEFAULT_SCOPE); + InfraNode infraNode = BuildInfraNode.build(Constants.DEFAULT_SCOPE); + logger.debug("Infra Node: " + infraNode); + assertTrue(true); + + } catch (Exception e) { + logger.error(e.getLocalizedMessage(), e); + assertTrue("Error searching the resource!", false); + } + + } else { + logger.debug("Test Disabled"); + assertTrue(true); + } + } + + @Test + public void testInfraNodeMarshaller() { + if (Constants.TEST_ENABLE) { + logger.debug("Test Enabled"); + + try { + InfraNodeJAXB infraNodeCoreServices = new InfraNodeJAXB(); + infraNodeCoreServices.setScope("CoreServices"); + infraNodeCoreServices.setName("Core Services"); + + InfraNodeJAXB infraNodeCatalogue = new InfraNodeJAXB(); + infraNodeCatalogue.setScope("CoreServices/Catalogue"); + infraNodeCatalogue.setName("Catalogue"); + + InfraNodeJAXB infraNodeWorkspace = new InfraNodeJAXB(); + infraNodeWorkspace.setScope("CoreServices/Workspace"); + infraNodeWorkspace.setName("Workspace"); + + InfraNodeJAXB infraNodeMessages = new InfraNodeJAXB(); + infraNodeMessages.setScope("CoreServices/Messages"); + infraNodeMessages.setName("Messages"); + + ArrayList children = new ArrayList<>(); + children.add(infraNodeCatalogue); + children.add(infraNodeWorkspace); + children.add(infraNodeMessages); + infraNodeCoreServices.setChildren(children); + + AccountingDashboardConfigJAXB config=new AccountingDashboardConfigJAXB(); + config.setEnabledInfraNode(true); + config.setBaseInfraNode(infraNodeCoreServices); + + JAXBContext jaxbContext = JAXBContext.newInstance(AccountingDashboardConfigJAXB.class); + Marshaller jaxbMarshaller = jaxbContext.createMarshaller(); + jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + + // Print XML String to Console + StringWriter sw = new StringWriter(); + + // Write XML to StringWriter + jaxbMarshaller.marshal(config, sw); + + // Verify XML Content + String xmlContent = sw.toString(); + logger.debug(xmlContent); + assertTrue(true); + + } catch (Throwable e) { + logger.error(e.getLocalizedMessage(), e); + assertTrue("Error in InfraNode Marshal!", false); + } + } else { + logger.debug("Test Disabled"); + assertTrue(true); + } + } + +}