1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2009 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.cdm.strategy.cache.reference.old;
|
11
|
|
12
|
|
13
|
import java.net.URI;
|
14
|
|
15
|
import org.apache.log4j.Logger;
|
16
|
import org.junit.Assert;
|
17
|
import org.junit.Before;
|
18
|
import org.junit.BeforeClass;
|
19
|
import org.junit.Ignore;
|
20
|
import org.junit.Test;
|
21
|
|
22
|
import eu.etaxonomy.cdm.model.agent.Team;
|
23
|
import eu.etaxonomy.cdm.model.reference.IWebPage;
|
24
|
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
|
25
|
import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
|
26
|
|
27
|
/**
|
28
|
* @author a.mueller
|
29
|
* @date 16.06.2010
|
30
|
*
|
31
|
* UNDER CONSTRUCTION
|
32
|
*
|
33
|
*/
|
34
|
public class WebPageDefaultCacheStrategyTest {
|
35
|
@SuppressWarnings("unused")
|
36
|
private static final Logger logger = Logger.getLogger(WebPageDefaultCacheStrategyTest.class);
|
37
|
|
38
|
private static IWebPage webPage1;
|
39
|
private static Team team1;
|
40
|
private static WebPageDefaultCacheStrategy defaultStrategy;
|
41
|
private static final String detail1 = "55";
|
42
|
|
43
|
/**
|
44
|
* @throws java.lang.Exception
|
45
|
*/
|
46
|
@BeforeClass
|
47
|
public static void setUpBeforeClass() throws Exception {
|
48
|
defaultStrategy = WebPageDefaultCacheStrategy.NewInstance();
|
49
|
}
|
50
|
|
51
|
/**
|
52
|
* @throws java.lang.Exception
|
53
|
*/
|
54
|
@Before
|
55
|
public void setUp() throws Exception {
|
56
|
webPage1 = ReferenceFactory.newWebPage();
|
57
|
team1 = Team.NewTitledInstance("Authorteam, D.", "AT.");
|
58
|
}
|
59
|
|
60
|
//**************************** TESTS ***********************************
|
61
|
|
62
|
|
63
|
@Test
|
64
|
@Ignore //under development
|
65
|
public void testGetTitleCache(){
|
66
|
webPage1.setTitle("Flora of Israel Online");
|
67
|
webPage1.setUri(URI.create("http://flora.huji.ac.il"));
|
68
|
webPage1.setAuthorship(team1);
|
69
|
webPage1.setDatePublished(TimePeriodParser.parseString("[accessed in 2011]"));
|
70
|
//taken from Berlin Model, may be modified in future
|
71
|
Assert.assertEquals("Unexpected title cache.", "Authorteam, D. - Flora of Israel Online - http://flora.huji.ac.il [accessed in 2011]", webPage1.getTitleCache());
|
72
|
}
|
73
|
|
74
|
// @Test
|
75
|
// //WebPages should usually not be used as nomencl.reference, therefore this is less important
|
76
|
// public void testGetAbbrevTitleCache(){
|
77
|
// webPage1.setTitle("auct.");
|
78
|
// Assert.assertEquals("Unexpected title cache.", "auct.", webPage1.getTitleCache());
|
79
|
// }
|
80
|
|
81
|
}
|