Bug 4662: Introduce a SemanticVersion concept - import processing
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / SchemaContextProxyTest.java
index 8be97cddd7a7f9f15645008dc4987226113254a4..59bbfd93c63fe66634bae9b0241fac6f5659478e 100644 (file)
@@ -12,6 +12,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
+
 import com.google.common.collect.Sets;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -22,6 +23,7 @@ import java.util.HashSet;
 import java.util.Set;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.opendaylight.yangtools.concepts.SemVer;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
 import org.opendaylight.yangtools.yang.model.api.Module;
@@ -64,7 +66,7 @@ public class SchemaContextProxyTest {
      * CFG(R)
      *  | \
      *  |  \
-     * M2 <- M3
+     * M2 &lt;- M3
      * </pre>
      */
     @Test
@@ -87,7 +89,7 @@ public class SchemaContextProxyTest {
      * No root or additional modules
      *  | \
      *  |  \
-     * M2 <- M3
+     * M2 &lt;- M3
      * </pre>
      */
     @Test
@@ -110,7 +112,7 @@ public class SchemaContextProxyTest {
      *  Config
      *  | \ (NR)
      *  |  \
-     * M2 <- M3
+     * M2 &lt;- M3
      * </pre>
      */
     @Test
@@ -135,7 +137,7 @@ public class SchemaContextProxyTest {
      *     CFG(R)
      *    |      \
      *   |         \
-     * M2<-(NullRev)M3
+     * M2&lt;-(NullRev)M3
      * </pre>
      */
     @Test
@@ -187,7 +189,7 @@ public class SchemaContextProxyTest {
      * CFG(R)
      *  |
      *  |
-     * M2 <- M3
+     * M2 &lt;- M3
      * </pre>
      */
     @Test
@@ -210,7 +212,7 @@ public class SchemaContextProxyTest {
      * CFG(R)
      *  |
      *  |
-     * M2 -> M3 -> M4 -> M5
+     * M2 -&gt; M3 -&gt; M4 -&gt; M5
      * </pre>
      */
     @Test
@@ -236,7 +238,7 @@ public class SchemaContextProxyTest {
      * CFG(R)
      *  |
      *  |
-     * M2 -> M3 <- M4
+     * M2 -&gt; M3 &lt;- M4
      * </pre>
      */
     @Test
@@ -287,7 +289,7 @@ public class SchemaContextProxyTest {
      * CFG(R)
      *  | \
      *  |  \
-     * M2 <- M3 M4=M3(Different revision)
+     * M2 &lt;- M3 M4=M3(Different revision)
      * </pre>
      */
     @Test
@@ -312,7 +314,7 @@ public class SchemaContextProxyTest {
      * <pre>
      * CFG(R)
      * |
-     * M2 -(no revision)-> M3(R2) ... M3(R1)
+     * M2 -(no revision)-&gt; M3(R2) ... M3(R1)
      * </pre>
      */
     @Test
@@ -337,9 +339,9 @@ public class SchemaContextProxyTest {
      * CFG(R)
      * |   \
      * |    \
-     * |    M2 -> M3
+     * |    M2 -&gt; M3
      * |
-     * M41(S) => M4
+     * M41(S) =&gt; M4
      * </pre>
      */
     @Test
@@ -363,7 +365,7 @@ public class SchemaContextProxyTest {
     /**
      * <pre>
      *
-     * M2 -> M3 -> M4 -> M5
+     * M2 -&gt; M3 -&gt; M4 -&gt; M5
      *
      * </pre>
      */
@@ -392,7 +394,7 @@ public class SchemaContextProxyTest {
      *  |       M5
      * M2
      *
-     * M3 -> M4
+     * M3 -&gt; M4
      *
      * </pre>
      */
@@ -418,7 +420,7 @@ public class SchemaContextProxyTest {
 
         Set<Module> modSet = Sets.newHashSet();
 
-        if(expected!=null) {
+        if (expected!=null) {
 
             modSet = Sets.newHashSet(expected);
         }
@@ -428,7 +430,7 @@ public class SchemaContextProxyTest {
         assertEquals(modSet, modSetFiltering);
 
         //asserting collections
-        if(expected!=null) {
+        if (expected!=null) {
             for (final Module module : expected) {
                 assertEquals(module, filteringSchemaContextProxy.findModuleByName(module.getName(), module.getRevision()));
 
@@ -447,7 +449,7 @@ public class SchemaContextProxyTest {
 
         Set<Module> modulesSet = new HashSet<>();
 
-        if(modules!=null) {
+        if (modules!=null) {
 
             modulesSet = Sets.newHashSet(modules);
 
@@ -460,7 +462,7 @@ public class SchemaContextProxyTest {
 
         Set<ModuleId> moduleIds = Sets.newHashSet();
 
-        if(modules!=null && modules.size()>0) {
+        if (modules!=null && modules.size()>0) {
 
             for (Module module : modules) {
 
@@ -498,6 +500,11 @@ public class SchemaContextProxyTest {
                     return module.getName();
                 }
 
+                @Override
+                public SemVer getSemanticVersion() {
+                    return module.getSemanticVersion();
+                }
+
                 @Override
                 public String toString() {