@@ -0,0 +1,2666 @@
+// BridgeDb,%0A// An abstraction layer for identifier mapping services, both local and online.%0A//%0A// Copyright 2006-2009  BridgeDb developers%0A// Copyright 2012-2013  Christian Y. A. Brenninkmeijer%0A// Copyright 2012-2013  OpenPhacts%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A// http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A//%0Apackage org.bridgedb.rdf;%0A%0Aimport java.io.File;%0Aimport java.util.SortedSet;%0Aimport org.bridgedb.bio.BioDataSource;%0Aimport org.bridgedb.bio.DataSourceTxt;%0Aimport org.bridgedb.utils.Reporter;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Test;%0Aimport static org.hamcrest.Matchers.*;%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0A%0A/**%0A *%0A * @author Christian%0A */%0Apublic class BridgeDBRdfHandlerTest %7B%0A    %0A   /**%0A     * Test of init method, of class BridgeDBRdfHandler.%0A     */%0A    @Test%0A    public void testInit() throws Exception %7B%0A        Reporter.println(%22init%22);%0A        DataSourceTxt.init();%0A        UriPattern.registerUriPatterns();%0A        UriPattern.refreshUriPatterns(); %0A        BridgeDBRdfHandler.init();%0A        %0A        SortedSet%3CUriPattern%3E result = UriPattern.byCodeAndType(%22M%22, UriPatternType.mainUrlPattern);%0A        UriPattern expected = UriPattern.byPattern(%22http://www.informatics.jax.org/marker/$id%22);%0A        assertThat(result, hasItem(expected));%0A        assertEquals(1, result.size());%0A        %0A        result = UriPattern.byCodeAndType(%22M%22, UriPatternType.identifiersOrgPattern);%0A        expected = UriPattern.byPattern(%22http://identifiers.org/mgd/$id%22);%0A        assertThat(result, hasItem(expected));%0A        assertEquals(1, result.size());%0A        %0A        result = UriPattern.byCodeAndType(%22M%22, UriPatternType.codeMapperPattern);%0A        expected = UriPattern.byPattern(%22http://purl.uniprot.org/mgi/$id%22);%0A        assertThat(result, hasItem(expected));%0A        assertThat(result.size(), greaterThanOrEqualTo(1));%0A        %0A        File file = new File (%22test-data/GeneratedDataSource.ttl%22);%0A        Reporter.println(%22writing to %22 + file.getAbsolutePath());%0A        BridgeDBRdfHandler.writeRdfToFile(file);%0A        %0A        Reporter.println(%22Reading back in %22 + file.getAbsolutePath());%0A        BridgeDBRdfHandler.parseRdfFile(file);%0A    %7D%0A%0A%7D%0A

test for reading in rdf