Project

General

Profile

Revision e4785bf4

IDe4785bf43b1d4fad34df65c5756e8ef5b09c130b
Parent 6ab98a2c
Child 87a2c7e2

Added by Andreas Müller about 2 months ago

cleanup

View differences:

cdmlib-ext/src/test/java/eu/etaxonomy/cdm/ext/openurl/MobotOpenUrlServiceWrapperTest.java
18 18

  
19 19
/**
20 20
 * @author a.mueller
21
 *
22 21
 */
23 22
public class MobotOpenUrlServiceWrapperTest {
24
	public static final Logger logger = Logger.getLogger(MobotOpenUrlServiceWrapperTest.class);
25
	public static final String baseUrl = "http://www.biodiversitylibrary.org/openurl";
26 23

  
24
    public static final Logger logger = Logger.getLogger(MobotOpenUrlServiceWrapperTest.class);
25
	public static final String baseUrl = "http://www.biodiversitylibrary.org/openurl";
27 26

  
28 27
	private MobotOpenUrlServiceWrapper openUrlServiceWrapper;
29 28
	private static boolean internetIsAvailable = true;
......
33 32
		internetIsAvailable = true;
34 33
	}
35 34

  
36
	/**
37
	 * @throws java.lang.Exception
38
	 */
39 35
	@Before
40 36
	public void setUp() throws Exception {
41 37
		openUrlServiceWrapper = new MobotOpenUrlServiceWrapper();
......
44 40

  
45 41
// ******************************* TESTS ******************************************************/
46 42

  
47

  
48 43
	@Test
49 44
	public void testDoResolveAndPage_1() {
50 45

  
......
67 62

  
68 63
		if (testInternetConnectivity(refList)){
69 64

  
70

  
71 65
			// Assert.assertEquals("There should be exactly 2 result for 'Linnaei Species Plantarum Europae'",
72 66
			// 2, refList.size());
73 67
			OpenUrlReference reference = refList.get(0);
......
102 96
	@Ignore // it seems as if oclc number are no longer supported by the api. Email send to mobot to clarify (a.kohlbecker 2016-07-11)
103 97
	public void testDoResolveAndPage_2() {
104 98

  
105

  
106 99
	    try {
107 100
            if(!UriUtils.isServiceAvailable(new URI(baseUrl), 1000)) {
108 101
                logger.error("Test skipped due to " + baseUrl + " being unavailable");
......
119 112

  
120 113
		if (testInternetConnectivity(refList)){
121 114

  
122

  
123 115
			// Assert.assertEquals("There should be exactly 2 result for 'Linnaei Species Plantarum Europae'",
124 116
			// 2, refList.size());
125 117
			OpenUrlReference reference = refList.get(0);
......
149 141
		query.startPage = "813";
150 142

  
151 143
		List<OpenUrlReference> refList = openUrlServiceWrapper.doResolve(query);
152

  
153 144
		if (testInternetConnectivity(refList)){
154

  
155 145
			Assert.assertTrue("There should be at least one result", refList.size() > 0);
156 146
			OpenUrlReference reference = refList.get(0);
157 147
		}
158 148
	}
159 149

  
160

  
161 150
	private boolean testInternetConnectivity(List<?> list) {
162 151
		if (list == null || list.isEmpty()){
163 152
			boolean result = internetIsAvailable && UriUtils.isInternetAvailable(null);
164 153
			internetIsAvailable = result;
165 154
			return result;
166

  
167 155
		}
168 156
		return true;
169 157
	}
170

  
171 158
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/TaxonGraphEdgeDTO.java
13 13
/**
14 14
 * @author a.kohlbecker
15 15
 * @since Sep 28, 2018
16
 *
17 16
 */
18 17
public class TaxonGraphEdgeDTO {
19 18

  
......
22 21
    private UUID citationUuid;
23 22
    private String citationTitleCache;
24 23

  
25
    /**
26
     * @param from
27
     * @param to
28
     * @param citationUuid
29
     * @param citationTitleCache
30
     */
31 24
    public TaxonGraphEdgeDTO(TaxonGraphNodeDTO from, TaxonGraphNodeDTO to, UUID citationUuid,
32 25
            String citationTitleCache) {
33
        super();
34 26
        this.from = from;
35 27
        this.to = to;
36 28
        this.citationUuid = citationUuid;
......
40 32
    public TaxonGraphEdgeDTO(UUID fromTaxonUuid, String fromName, String fromRank, Integer fromRankOrderId,
41 33
            UUID toTaxonUuid, String toName, String toRank, Integer toRankOrderId, UUID citationUuid,
42 34
            String citationTitleCache) {
43
        super();
44 35
        this.from = new TaxonGraphNodeDTO(null, fromTaxonUuid, fromName, fromRank, fromRankOrderId);
45 36
        this.to = new TaxonGraphNodeDTO(null, toTaxonUuid, toName, toRank, toRankOrderId);
46 37
        this.citationUuid = citationUuid;
47 38
        this.citationTitleCache = citationTitleCache;
48 39
    }
49 40

  
50
    /**
51
     * @return the from
52
     */
53 41
    public TaxonGraphNodeDTO getFrom() {
54 42
        return from;
55 43
    }
56
    /**
57
     * @param from the from to set
58
     */
59 44
    public void setFrom(TaxonGraphNodeDTO from) {
60 45
        this.from = from;
61 46
    }
62
    /**
63
     * @return the to
64
     */
47

  
65 48
    public TaxonGraphNodeDTO getTo() {
66 49
        return to;
67 50
    }
68
    /**
69
     * @param to the to to set
70
     */
71 51
    public void setTo(TaxonGraphNodeDTO to) {
72 52
        this.to = to;
73 53
    }
74
    /**
75
     * @return the citationUuid
76
     */
54

  
77 55
    public UUID getCitationUuid() {
78 56
        return citationUuid;
79 57
    }
80
    /**
81
     * @param citationUuid the citationUuid to set
82
     */
83 58
    public void setCitationUuid(UUID citationUuid) {
84 59
        this.citationUuid = citationUuid;
85 60
    }
86
    /**
87
     * @return the citationTitleCache
88
     */
61

  
89 62
    public String getCitationTitleCache() {
90 63
        return citationTitleCache;
91 64
    }
92
    /**
93
     * @param citationTitleCache the citationTitleCache to set
94
     */
95 65
    public void setCitationTitleCache(String citationTitleCache) {
96 66
        this.citationTitleCache = citationTitleCache;
97 67
    }
98

  
99

  
100

  
101
}
68
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)