2016-09-08 14:45:08 +02:00
|
|
|
package org.gcube.social_networking.socialutillibrary;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
2016-09-08 22:33:34 +02:00
|
|
|
|
2016-09-08 14:45:08 +02:00
|
|
|
public class TestUnit {
|
|
|
|
|
|
|
|
//@Test
|
|
|
|
public void testHashtag() {
|
2017-12-14 12:34:20 +01:00
|
|
|
String text = "Dear members, The item 'ADSDTest4CWP' has been just published by Leonardo Candela. " +
|
|
|
|
"You can find it here: http://data.d4science.org/ctlg/CWP_Secretariat/adsdtest4cwp " +
|
|
|
|
"#Area #Geospatial #Periodicity-When_updates_are_available ";
|
2016-09-08 14:45:08 +02:00
|
|
|
List<String> hashtags = Utils.getHashTags(text);
|
|
|
|
System.out.println("Hashtags are " + hashtags);
|
|
|
|
}
|
|
|
|
|
2017-11-08 16:30:10 +01:00
|
|
|
//@Test
|
2016-10-06 16:54:45 +02:00
|
|
|
public void extractUrl(){
|
|
|
|
|
2018-01-19 11:55:54 +01:00
|
|
|
String url = " test http://[2001:db8:0:1:1:1:1:1]:8080/group/preeco/what-if?p_p_id=simul_WAR_simulfishgrowthportlet&p_p_lifecycle=0 ";
|
2017-11-08 16:30:10 +01:00
|
|
|
String result = Utils.extractURL(url);
|
2016-10-06 16:54:45 +02:00
|
|
|
System.out.println("urls are " + result);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-08 14:45:08 +02:00
|
|
|
}
|