deleted unused testss
This commit is contained in:
parent
bdf6bc7192
commit
bd258bfbd7
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
package unitest;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import eu.dnetlib.repo.manager.config.RepoManagerContextLoaderListener;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = RepoManagerContextLoaderListener.class)
|
||||
public class PiwikTest {
|
||||
|
||||
String analyticsURL = "https://analytics.openaire.eu/addsite.php?";
|
||||
|
||||
@Test
|
||||
public void enableMetricsRepo1(){
|
||||
|
||||
String officialName = "BỘ SƯU TẬP SỐ";
|
||||
String repoWebsite = "http://www.vnulib.edu.vn:8000/dspace/";
|
||||
|
||||
enableMetrics(officialName, repoWebsite, analyticsURL);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void enableMetricsRepo2(){
|
||||
|
||||
String officialName = "ILC4CLARIN repository of language resources and tools";
|
||||
String repoWebsite = "https://dspace-clarin-it.ilc.cnr.it/repository/xmlui";
|
||||
|
||||
enableMetrics(officialName, repoWebsite, analyticsURL);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void enableMetricsRepo3(){
|
||||
|
||||
String officialName = "ANSTO Publications Online";
|
||||
String repoWebsite = "http://apo.ansto.gov.au/dspace/";
|
||||
|
||||
enableMetrics(officialName, repoWebsite, analyticsURL);
|
||||
}
|
||||
|
||||
private void enableMetrics(String officialName, String repoWebsite, String analyticsURL) {
|
||||
String url;
|
||||
try {
|
||||
url = analyticsURL + "siteName=" + URLEncoder.encode(officialName, "UTF-8") + "&url="
|
||||
+ URLEncoder.encode(repoWebsite, "UTF-8");
|
||||
url = StringEscapeUtils.escapeJava(url);
|
||||
|
||||
Map map = null;
|
||||
String siteId = null;
|
||||
|
||||
URL u = new URL(url);
|
||||
map = new ObjectMapper().readValue(u, Map.class);
|
||||
if(map.get("value")!=null) {
|
||||
siteId = map.get("value").toString();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}*/
|
|
@ -1,31 +0,0 @@
|
|||
//package unitest;
|
||||
//
|
||||
//import eu.dnetlib.repo.manager.config.RepoManagerContextLoaderListener;
|
||||
//import eu.dnetlib.repo.manager.utils.OaiTools;
|
||||
//import org.junit.Test;
|
||||
//import org.junit.runner.RunWith;
|
||||
//import org.springframework.test.context.ContextConfiguration;
|
||||
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
//
|
||||
//@RunWith(SpringJUnit4ClassRunner.class)
|
||||
//@ContextConfiguration(classes = RepoManagerContextLoaderListener.class)
|
||||
////@WebAppConfiguration
|
||||
//public class ValidatorTest {
|
||||
//
|
||||
//
|
||||
// @Test
|
||||
// public void identiFy(){
|
||||
//
|
||||
// String url = "https://repozitorij.srce.unizg.hr/oai";
|
||||
//
|
||||
//
|
||||
// System.out.println("Identify repository with url : " + url);
|
||||
// try {
|
||||
// System.out.println(OaiTools.identifyRepository(url));
|
||||
// } catch (Exception e) {
|
||||
// System.out.println(e);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//}
|
Loading…
Reference in New Issue