2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.stmt.retest;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertTrue;
12 import com.google.common.base.Optional;
13 import com.google.common.collect.Iterables;
14 import org.junit.Before;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.model.api.AugmentationSchema;
17 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
18 import org.opendaylight.yangtools.yang.parser.builder.impl.AugmentationSchemaBuilderImpl;
21 * @deprecated Pre-Beryllium implementation, scheduled for removal.
24 public class AugmentationSchemaBuilderImplTest {
26 private AugmentationSchemaBuilderImpl augmentSchemaBuilderImpl;
27 private AugmentationSchemaBuilderImpl augmentSchemaBuilderImpl2;
28 private AugmentationSchemaBuilderImpl augmentSchemaBuilderImpl3;
29 private AugmentationSchemaBuilderImpl augmentSchemaBuilderImpl4;
30 private AugmentationSchema augmentSchema;
34 augmentSchemaBuilderImpl = new AugmentationSchemaBuilderImpl("test-module", 10, "augment-test/rpc", SchemaPath.ROOT, 1);
35 augmentSchemaBuilderImpl2 = new AugmentationSchemaBuilderImpl("test-module", 10, "augment-test/rpc2", SchemaPath.ROOT, 1);
36 augmentSchemaBuilderImpl3 = augmentSchemaBuilderImpl;
37 augmentSchemaBuilderImpl4 = new AugmentationSchemaBuilderImpl("test-module", 10, null, SchemaPath.ROOT, 1);
38 augmentSchema = augmentSchemaBuilderImpl.build();
42 public void testgetPath() {
43 assertTrue(Iterables.isEmpty(augmentSchemaBuilderImpl.getPath().getPathFromRoot()));
47 public void testEquals() {
48 assertFalse(augmentSchemaBuilderImpl.equals("test"));
49 assertFalse(augmentSchemaBuilderImpl.equals(null));
50 assertTrue(augmentSchemaBuilderImpl.equals(augmentSchemaBuilderImpl3));
51 assertFalse(augmentSchemaBuilderImpl4.equals(augmentSchemaBuilderImpl));
52 assertFalse(augmentSchemaBuilderImpl.equals(augmentSchemaBuilderImpl2));
56 public void testGetOriginalDefinition() {
57 augmentSchema = augmentSchemaBuilderImpl.build();
58 Optional<AugmentationSchema> origDefinition = augmentSchema.getOriginalDefinition();
59 assertFalse(origDefinition.isPresent());
63 public void testGetUnknownSchemaNodes() {
64 assertTrue(Iterables.isEmpty(augmentSchema.getUnknownSchemaNodes()));