+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
package org.opendaylight.yangtools.yang.parser.util;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
import java.net.URI;
import java.net.URISyntaxException;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.Status;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
+import org.opendaylight.yangtools.yang.parser.builder.impl.ModuleBuilder;
import org.opendaylight.yangtools.yang.parser.builder.impl.UnknownSchemaNodeBuilder;
public class BitImplTest {
List<QName> qnamesA = new ArrayList<>();
qnamesA.add(qnameA1);
qnamesA.add(qnameA2);
- SchemaPath schemaPathA = new SchemaPath(qnamesA, true);
+ SchemaPath schemaPathA = SchemaPath.create(qnamesA, true);
QName qnameB = new QName(uriB, new Date(5000000), "some name");
List<QName> qnamesB = new ArrayList<>();
qnamesB.add(qnameB1);
qnamesB.add(qnameB2);
- SchemaPath schemaPathB = new SchemaPath(qnamesB, true);
+ SchemaPath schemaPathB = SchemaPath.create(qnamesB, true);
BitImpl biB = null;
BitImpl biA = new BitImpl(55L, qnameA, schemaPathA, "description", "reference", Status.CURRENT, null);
assertEquals("Incorrect hash code for biA.", 923522, biA.hashCode());
List<UnknownSchemaNode> unknownNodes = new ArrayList<>();
- UnknownSchemaNodeBuilder usnb = new UnknownSchemaNodeBuilder("module", 3, qnameB);
+ SchemaPath path = org.mockito.Mockito.mock(SchemaPath.class);
+ UnknownSchemaNodeBuilder usnb = new UnknownSchemaNodeBuilder("module", 3, qnameB, path);
+ ModuleBuilder parent = org.mockito.Mockito.mock(ModuleBuilder.class);
+ usnb.setParent(parent);
+
unknownNodes.add(usnb.build());
biA = new BitImpl(55L, qnameA, schemaPathA, "description", "reference", Status.CURRENT, unknownNodes);