BUG-865: remove unused model.util types
[yangtools.git] / yang / yang-model-util / src / test / java / org / opendaylight / yangtools / yang / model / util / BinaryTypeTest.java
index 90dd72fd57404307e061e8fb4eab1c251ee4264f..146cb48191dd6b9099188149da2977dbebba8388 100644 (file)
@@ -7,40 +7,32 @@
  */
 package org.opendaylight.yangtools.yang.model.util;
 
-import org.junit.Test;
-import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.type.LengthConstraint;
-import java.util.Collections;
-import java.util.List;
-
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.opendaylight.yangtools.yang.model.util.type.BaseTypes.binaryType;
+import java.util.Collections;
+import org.junit.Test;
+import org.opendaylight.yangtools.yang.model.api.Status;
+import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
 
 public class BinaryTypeTest {
 
     @Test
     public void canCreateBinaryType() {
-        BinaryType binType = BinaryType.getInstance();
-        BinaryType binType1 = BinaryType.getInstance();
-        String stringBinType = binType.toString();
+        BinaryTypeDefinition binType = binaryType();
+        BinaryTypeDefinition binType1 = binaryType();
 
-
-        List<LengthConstraint> lengthConstraints = binType.getLengthConstraints();
-        assertTrue(lengthConstraints.toString().contains("max=9223372036854775807"));
-        assertTrue(lengthConstraints.toString().contains("min=0"));
-
-        assertEquals("Default value is []", Collections.EMPTY_LIST, binType.getDefaultValue());
+        assertEquals(0, binType.getLengthConstraints().size());
+        assertNull(binType.getDefaultValue());
         assertEquals("CURRENT", Status.CURRENT, binType.getStatus());
         assertEquals("Base type is null", null, binType.getBaseType());
         assertEquals("getQName gives BINARY_QNAME", BaseTypes.BINARY_QNAME, binType.getQName());
-        assertEquals("empty string", "", binType.getUnits());
+        assertNull("Units should be null", binType.getUnits());
         assertEquals("getPath gives List of BINARY_QNAME",
                 Collections.singletonList(BaseTypes.BINARY_QNAME), binType.getPath().getPathFromRoot());
 
-        assertTrue("BinType.toString should contain Description", stringBinType.contains(binType.getDescription()));
-        assertTrue("BinType.toString should contain Reference", stringBinType.contains(binType.getReference()));
-
         assertTrue("binType1 should equal to binType",
                 binType.equals(binType1) && binType1.equals(binType));
         assertTrue("Hash code of binType and binType1 should be equal",