source: vlo/branches/vlo-2.13-param/vlo_web_app/src/test/java/eu/clarin/cmdi/vlo/pages/ResourceLinkPanelTest.java @ 2659

Last change on this file since 2659 was 2659, checked in by keeloo, 11 years ago

Removed VloConfig?.get() and made the member variables static themselves. Cleaned up the VloConfig? class.

File size: 1.5 KB
Line 
1package eu.clarin.cmdi.vlo.pages;
2
3import eu.clarin.cmdi.vlo.FacetConstants;
4import eu.clarin.cmdi.vlo.VloWebApplication;
5import eu.clarin.cmdi.vlo.config.VloConfig;
6import org.apache.wicket.util.tester.WicketTester;
7import org.junit.Before;
8import org.junit.Assert;
9import org.junit.Test;
10
11
12public class ResourceLinkPanelTest {
13   
14    static VloConfig testConfig;
15
16    public static final String _SAME_STRING = "http://blabla";
17    public static final String _RESOLVE_STRING = "hdl:1839/00-0000-0000-0004-3357-F";
18    public static final String _RESOLVE_OUT = "http://corpus1.mpi.nl/qfs1/media-archive/dobes_data/Marquesan/North_Marquesas/Nuku_Hiva/narratives/Media/Expl-Anc-Et-NH.m4a";
19    @Before
20    public void setUp() {
21       
22        WicketTester wicketTester;
23
24        String fileName = VloConfig.class.getResource("/VloConfig.xml").getFile();
25
26        testConfig = VloConfig.readTestConfig(fileName);
27
28        // optionally, modify the test configuration here
29
30        wicketTester = new WicketTester(new VloWebApplication(testConfig));
31    }
32
33    @Test
34    public void getNameFromLinkTest(){
35        ResourceLinkPanel totest = new ResourceLinkPanel("a", FacetConstants.RESOURCE_TYPE_AUDIO, "a");
36        String uit = totest.getNameFromLink(_SAME_STRING);
37        Assert.assertTrue("Returns the same string if it does not start with the handle-prefix",uit.equals(_SAME_STRING));
38
39        uit = totest.getNameFromLink(_RESOLVE_STRING);
40        Assert.assertTrue("Returns the resolved url of the handle pid", uit.equals(_RESOLVE_OUT));
41    }
42}
Note: See TracBrowser for help on using the repository browser.