Project

General

Profile

Revision 19d67961

ID19d679617f164c5559be592718f01ae90d155040
Parent 2fa45f7e
Child 9b7bec58

Added by Andreas Müller about 3 years ago

ref #6960

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/reference/DefaultReferenceCacheStrategy.java
139 139
        }else{
140 140
            result = titleCacheDefaultReference(reference, isNotAbbrev);
141 141
        }
142
        if (reference.getType() == ReferenceType.WebPage && reference.getUri() != null){
142
        if (reference.getType() == ReferenceType.WebPage && reference.getUri() != null && !result.contains(reference.getUri().toString())){
143 143
            //might become UTF8.EN_DASH in future
144 144
            result = CdmUtils.concat(" - ", result, reference.getUri().toString());
145 145
        }
cdmlib-model/src/test/java/eu/etaxonomy/cdm/strategy/cache/reference/DefaultReferenceCacheStrategyTest.java
696 696
    @Test
697 697
    public void testWebPageGetTitleCache(){
698 698
        //still preliminary, may be modified in future
699
        webPage1.setTitle("Flora of Israel Online");
700 699
        webPage1.setUri(URI.create("http://flora.huji.ac.il"));
700
        Assert.assertEquals("Unexpected title cache.",
701
                "http://flora.huji.ac.il",
702
                webPage1.getTitleCache());
703

  
704
        webPage1.setTitle("Flora of Israel Online");
701 705
        webPage1.setAuthorship(webPageTeam1);
702 706
        webPage1.setAccessed(DateTime.parse("2001-01-05"));
703 707
        Assert.assertEquals("Unexpected title cache.",
704 708
                "Authorteam, D., Flora of Israel Online - http://flora.huji.ac.il [accessed 2001-01-05]",
705 709
                webPage1.getTitleCache());
710

  
706 711
    }
707 712

  
708 713
//  @Test

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)