// BridgeDb,
// An abstraction layer for identifier mapping services, both local and online.
//
// Copyright 2006-2009  BridgeDb developers
// Copyright 2012-2013  Christian Y. A. Brenninkmeijer
// Copyright 2012-2013  OpenPhacts
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
package org.bridgedb.mysql;

import org.bridgedb.pairs.IdSysCodePair;
import org.bridgedb.sql.SQLUriMapper;
import org.bridgedb.sql.TestSqlFactory;
import org.bridgedb.uri.UriListenerTest;
import org.bridgedb.uri.tools.RegexUriPattern;
import org.bridgedb.utils.BridgeDBException;
import org.bridgedb.utils.ConfigReader;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * Tests the UriMapper interface (and by loading the UriListener interface)
 *
 * Should be passable by any implementation of UriMapper that has the test data loaded.
 * 
 * @author Christian
 */
public class SQLUriMapperTest extends UriListenerTest{
   
    private static SQLUriMapper sqlUriMapper;
    
    @BeforeClass
    public static void setupIDMapper() throws BridgeDBException{
        TestSqlFactory.checkSQLAccess();
        ConfigReader.useTest();
        sqlUriMapper = SQLUriMapper.createNew();
    }
    
    @Test 
    public void testToUriPattern() throws BridgeDBException{
        report("ToUriPattern");
        IdSysCodePair result = sqlUriMapper.toIdSysCodePair(map1Uri1);
        IdSysCodePair expected = new IdSysCodePair (ds1Id1, dataSource1Code);
        assertEquals(expected, result);
    }

    @Test 
    public void testToUriPatternUsingLike() throws BridgeDBException{
        report("ToUriPatternUsingLike");
        IdSysCodePair result = sqlUriMapper.toIdSysCodePair("http://bio2rdf.org/chebi:1234");
        IdSysCodePair expected = new IdSysCodePair ("1234", "Ce"); //will be "Ce"
        assertEquals(expected, result);
    }
      
    @Test
    public void testBugInsdc() throws Exception {
        report("LoadBugInsdc");
        RegexUriPattern pattern = sqlUriMapper.toUriPattern("http://identifiers.org/ena.embl/AAG52984");
        assertNotNull(pattern);
    }
    
    @Test
    public void testBugDrugbank() throws Exception {
        report("BugDrugbank");
        RegexUriPattern pattern = sqlUriMapper.toUriPattern("http://drugbank.ca/drugs/DB01269");
        assertNotNull(pattern);
    }
    
}

@@ -1,10 +1,10 @@
 /
-/
+*
  BridgeD
@@ -6,18 +6,18 @@
 idgeDb,%0A
-//
+ *
  An abst
@@ -86,21 +86,21 @@
 online.%0A
-//%0A//
+ *%0A *
  Copyrig
@@ -133,18 +133,18 @@
 elopers%0A
-//
+ *
  Copyrig
@@ -188,18 +188,18 @@
 kmeijer%0A
-//
+ *
  Copyrig
@@ -223,21 +223,21 @@
 nPhacts%0A
-//%0A//
+ *%0A *
  License
@@ -293,18 +293,18 @@
 ense%22);%0A
-//
+ *
  you may
@@ -361,18 +361,18 @@
 icense.%0A
-//
+ *
  You may
@@ -404,21 +404,21 @@
 ense at%0A
-//%0A//
+ *%0A *
  http://
@@ -457,13 +457,13 @@
 2.0%0A
-//%0A//
+ *%0A *
  Unl
@@ -527,18 +527,18 @@
 oftware%0A
-//
+ *
  distrib
@@ -596,18 +596,18 @@
  BASIS,%0A
-//
+ *
  WITHOUT
@@ -672,18 +672,18 @@
 mplied.%0A
-//
+ *
  See the
@@ -743,18 +743,18 @@
 ons and%0A
-//
+ *
  limitat
@@ -781,11 +781,13 @@
 se.%0A
-/
+ *
 /%0A
+%0A
 pack
@@ -1107,22 +1107,16 @@
 er;%0A
+%0A
 import 
-static 
 org.
@@ -1125,25 +1125,39 @@
 nit.
-Assert.*;
+jupiter.api.BeforeAll;%0A
 %0Aimport 
 org.
@@ -1144,32 +1144,39 @@
 oreAll;%0A%0Aimport 
+static 
 org.junit.Before
@@ -1169,26 +1169,50 @@
 g.junit.
-BeforeClas
+jupiter.api.Assertions.assertEqual
 s;%0Aimpor
@@ -1205,32 +1205,39 @@
 tEquals;%0Aimport 
+static 
 org.junit.Test;%0A
@@ -1230,20 +1230,52 @@
 g.junit.
-Test
+jupiter.api.Assertions.assertNotNull
 ;%0A%0A/**%0A 
@@ -1594,13 +1594,11 @@
 fore
-Class
+All
 %0A   
@@ -1793,29 +1793,50 @@
 %7D%0A    %0A    @
+org.junit.jupiter.api.
 Test
- 
 %0A    public 
@@ -2118,21 +2118,42 @@
 %7D%0A%0A    @
+org.junit.jupiter.api.
 Test
- 
 %0A    pub
@@ -2482,32 +2482,54 @@
   %7D%0A      %0A    @
+org.junit.jupiter.api.
 Test%0A    public 
@@ -2742,26 +2742,44 @@
 ;%0A    %7D%0A
-    
 %0A    @
+org.junit.jupiter.api.
 Test%0A   
@@ -2988,21 +2988,16 @@
 ttern);%0A
+
     %7D%0A
-    %0A
 %7D%0A

Update SQLUriMapperTest.java