removed obsolete test

This commit is contained in:
Massimiliano Assante 2021-07-14 09:54:39 +02:00
parent 236d29f054
commit 6cc80228e0
4 changed files with 17 additions and 34 deletions

15
pom.xml
View File

@ -22,11 +22,11 @@
<properties> <properties>
<!-- Convenience property to set the GWT version --> <!-- Convenience property to set the GWT version -->
<gwtVersion>2.7.0</gwtVersion> <gwtVersion>2.8.2</gwtVersion>
<!-- GWT needs at least java 1.6 --> <!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<distroDirectory>distro</distroDirectory> <distroDirectory>distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory> <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<liferayVersion>6.2.5</liferayVersion> <liferayVersion>6.2.5</liferayVersion>
@ -105,13 +105,12 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.common</groupId>
<artifactId>aslsocial</artifactId> <artifactId>storagehub-client-library</artifactId>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>home-library</artifactId> <artifactId>aslsocial</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -16,8 +16,8 @@ import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
import org.gcube.applicationsupportlayer.social.NotificationsManager; import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite; import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser; import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
import org.gcube.common.homelibrary.home.HomeLibrary; import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
import org.gcube.common.homelibrary.home.workspace.Workspace; import org.gcube.common.storagehub.client.proxies.MessageManagerClient;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.admin.vredefinition.client.VREDefinitionService; import org.gcube.portlets.admin.vredefinition.client.VREDefinitionService;
import org.gcube.portlets.admin.vredefinition.shared.Functionality; import org.gcube.portlets.admin.vredefinition.shared.Functionality;
@ -601,19 +601,22 @@ public class VREDefinitionServiceImpl extends RemoteServiceServlet implements V
getVREGenerator().setVREtoPendingState(); getVREGenerator().setVREtoPendingState();
getASLSession().setAttribute(VRE_DEFINER_GENERATOR_ATTRIBUTE, null); getASLSession().setAttribute(VRE_DEFINER_GENERATOR_ATTRIBUTE, null);
Workspace workspace = HomeLibrary.getUserWorkspace(getASLSession().getUsername());
ArrayList<String> toSend = new ArrayList<String>(); ArrayList<String> toSend = new ArrayList<String>();
toSend.add(managerUserName); toSend.add(managerUserName);
String subject = "New VRE Definition requires your approval"; String subject = "New VRE Definition requires your approval";
String body = "Dear Manager, \n\n" + completeDesigner + " has created a VRE Definition indicating you as VRE Manager on " + getASLSession().getScope(); String body = "Dear Manager, \n\n" + completeDesigner + " has created a VRE Definition indicating you as VRE Manager on " + getASLSession().getScope();
body+=".\n\nThe VRE Name is: " + bean.getName() +", the VRE Description is: " + bean.getDescription()+"."; body+=".\n\nThe VRE Name is: " + bean.getName() +", the VRE Description is: " + bean.getDescription()+".";
String messagedId = workspace.getWorkspaceMessageManager().sendMessageToPortalLogins(subject, body, new ArrayList<String>(), toSend);
MessageManagerClient client = AbstractPlugin.messages().build();
String messageId = client.sendMessage(toSend, subject, body, null);
ASLSession session = getASLSession(); ASLSession session = getASLSession();
SocialNetworkingUser user = new SocialNetworkingUser(session.getUsername(), session.getUserEmailAddress(), session.getUserFullName(), session.getUserAvatarId()); SocialNetworkingUser user = new SocialNetworkingUser(session.getUsername(), session.getUserEmailAddress(), session.getUserFullName(), session.getUserAvatarId());
NotificationsManager nnm = new ApplicationNotificationsManager(new SocialNetworkingSite(getThreadLocalRequest()), session.getScope(), user); NotificationsManager nnm = new ApplicationNotificationsManager(new SocialNetworkingSite(getThreadLocalRequest()), session.getScope(), user);
if (nnm.notifyMessageReceived(managerUserName, messagedId, subject, body)) if (nnm.notifyMessageReceived(managerUserName, messageId, subject, body))
logger.trace("Sending VRE Definition create notification: " + subject + " OK"); logger.trace("Sending VRE Definition create notification: " + subject + " OK");

View File

@ -24,7 +24,7 @@
<!-- If you add any GWT meta tags, they must --> <!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. --> <!-- be added before this line. -->
<!-- --> <!-- -->
<script type="text/javascript" src="vredefinition/vredefinition.nocache.js"></script> <!-- <script type="text/javascript" src="vredefinition/vredefinition.nocache.js"></script> -->
</head> </head>
<!-- --> <!-- -->

View File

@ -1,19 +0,0 @@
package org.gcube.portlets.admin.vredefinition.client;
import static org.junit.Assert.assertTrue;
import org.gcube.portlets.admin.vredefinition.server.VREDefinitionServiceImpl;
import org.junit.Test;
public class TestForDeploy {
@Test
public void testUserIsTestUser() {
VREDefinitionServiceImpl serviceImpl = new VREDefinitionServiceImpl();
String username = serviceImpl.getDevelopmentUser();
System.out.println("username for deploy is: " + username);
assertTrue(username.compareTo(VREDefinitionServiceImpl.defaultUserId) == 0);
System.out.println("Test OK!");
}
}