// 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.rdf;

import org.bridgedb.utils.BridgeDBException;
import org.bridgedb.utils.Reporter;
import static org.hamcrest.number.OrderingComparison.*;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

/**
 *
 * @author Christian
 */
public class UriPatternTest {
    
    public UriPatternTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    @Ignore("Cannot make sense of this fail: the $id gets added, but the map is empty")
    public void testByPatternNoId() throws BridgeDBException{
        Reporter.println("ByPatternNoId");
        UriPattern result = UriPattern.byPattern("http://rdf.ebi.ac.uk/resource/chembl/molecule/");
        assertNotNull(result);
    }
    
    /**
     * Test of compareTo method, of class UriPattern.
     */
    @Test 
    public void testCompareTo() throws BridgeDBException {
        Reporter.println("compareTo");
        UriPattern pattern1 = UriPattern.register("http://www.example.com/UriPatternTest/testCompareTo/1$id", "UriPatternTest", UriPatternType.dataSourceUriPattern);
        UriPattern pattern1s = UriPattern.register("https://www.example.com/UriPatternTest/testCompareTo/1$id", "UriPatternTest", UriPatternType.dataSourceUriPattern);
        UriPattern pattern2 = UriPattern.register("http://www.example.com/UriPatternTest/testCompareTo/2$id", "UriPatternTest", UriPatternType.dataSourceUriPattern);
        assertThat(pattern2.compareTo(pattern1), greaterThan(0));
        assertThat(pattern1.compareTo(pattern2), lessThan(0));
        assertThat(pattern2.compareTo(pattern1s), greaterThan(0));
        assertThat(pattern1s.compareTo(pattern2), lessThan(0));
    }
}

@@ -1,10 +1,13 @@
 /
-/
+*%0A *
  BridgeD
@@ -9,18 +9,18 @@
 idgeDb,%0A
-//
+ *
  An abst
@@ -89,21 +89,18 @@
 online.%0A
-//%0A//
+ *
  Copyrig
@@ -105,14 +105,20 @@
 ight
+ (c)
  2006
--
+ - 
 2009
@@ -128,17 +128,17 @@
 ridgeDb 
-d
+D
 eveloper
@@ -139,18 +139,18 @@
 elopers%0A
-//
+ *
  Copyrig
@@ -143,32 +143,36 @@
 ers%0A * Copyright
+ (c)
  2012-2013  Chri
@@ -166,17 +166,16 @@
 12-2013 
- 
 Christia
@@ -197,18 +197,18 @@
 kmeijer%0A
-//
+ *
  Copyrig
@@ -213,20 +213,25 @@
 ight
+ (c)
  2012
--
+ - 
 2013 
- 
 Open
@@ -237,21 +237,21 @@
 nPhacts%0A
-//%0A//
+ *%0A *
  License
@@ -307,18 +307,18 @@
 ense%22);%0A
-//
+ *
  you may
@@ -375,18 +375,18 @@
 icense.%0A
-//
+ *
  You may
@@ -417,22 +417,16 @@
 cense at
-%0A//%0A//
  http://
@@ -465,13 +465,13 @@
 2.0%0A
-//%0A//
+ *%0A *
  Unl
@@ -534,19 +534,16 @@
 software
-%0A//
  distrib
@@ -601,18 +601,18 @@
  BASIS,%0A
-//
+ *
  WITHOUT
@@ -677,18 +677,18 @@
 mplied.%0A
-//
+ *
  See the
@@ -747,19 +747,16 @@
 ions and
-%0A//
  limitat
@@ -783,11 +783,13 @@
 se.%0A
-/
+ *
 /%0A
+%0A
 pack
@@ -887,24 +887,78 @@
 ls.Reporter;
+%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;
 %0Aimport stat
@@ -1013,189 +1013,95 @@
 ort 
-org.junit.After;%0Aimport org.junit.AfterClass;%0Aimport static org.junit.Assert.*;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test
+static org.junit.jupiter.api.Assertions.assertNotNull;%0A%0A%0Aimport org.junit.jupiter.api.*
 ;%0A%0A/
@@ -1218,21 +1218,19 @@
  @Before
-Class
+All
 %0A    pub
@@ -1281,21 +1281,19 @@
   @After
-Class
+All
 %0A    pub
@@ -1348,16 +1348,20 @@
  @Before
+Each
 %0A    pub
@@ -1400,16 +1400,20 @@
   @After
+Each
 %0A    pub
@@ -1450,14 +1450,16 @@
    @
-Ignore
+Disabled
 (%22Ca
@@ -1848,16 +1848,16 @@
      */%0A
+
     @Tes
@@ -1857,17 +1857,16 @@
    @Test
- 
 %0A    pub

Update UriPatternTest.java