* 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.controller.binding.generator.util.generated.type.builder;
+package org.opendaylight.yangtools.binding.generator.util.generated.type.builder;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
-import org.opendaylight.controller.binding.generator.util.Types;
-import org.opendaylight.controller.sal.binding.model.api.AnnotationType;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedTransferObject;
-import org.opendaylight.controller.sal.binding.model.api.GeneratedType;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.AnnotationTypeBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTOBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
-import org.opendaylight.controller.sal.binding.model.api.type.builder.MethodSignatureBuilder;
+import org.opendaylight.yangtools.binding.generator.util.Types;
+import org.opendaylight.yangtools.sal.binding.model.api.AnnotationType;
+import org.opendaylight.yangtools.sal.binding.model.api.GeneratedTransferObject;
+import org.opendaylight.yangtools.sal.binding.model.api.GeneratedType;
+import org.opendaylight.yangtools.sal.binding.model.api.type.builder.AnnotationTypeBuilder;
+import org.opendaylight.yangtools.sal.binding.model.api.type.builder.GeneratedPropertyBuilder;
+import org.opendaylight.yangtools.sal.binding.model.api.type.builder.GeneratedTOBuilder;
+import org.opendaylight.yangtools.sal.binding.model.api.type.builder.GeneratedTypeBuilder;
+import org.opendaylight.yangtools.sal.binding.model.api.type.builder.MethodSignatureBuilder;
public class AnnotationBuilderTest {
final List<AnnotationType> annotations = genType.getMethodDefinitions()
.get(0).getAnnotations();
assertEquals(2, annotations.size());
-
+
int annotCount = 0;
for (final AnnotationType annotation : annotations) {
if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
&& annotation.getName().equals("ManagedAttribute")) {
annotCount++;
assertEquals(4, annotation.getParameters().size());
-
+
assertNotNull(annotation.getParameter("description"));
assertNotNull(annotation.getParameter("currencyTimeLimit"));
assertNotNull(annotation.getParameter("defaultValue"));
if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
&& annotation.getName().equals("ManagedOperation")) {
annotCount++;
-
+
assertEquals(1, annotation.getParameters().size());
assertNotNull(annotation.getParameter("types"));
assertEquals(3, annotation.getParameter("types").getValues().size());
final List<AnnotationType> annotations = genTransObj.getProperties()
.get(0).getAnnotations();
assertEquals(2, annotations.size());
-
+
int annotCount = 0;
for (final AnnotationType annotation : annotations) {
if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
&& annotation.getName().equals("ManagedAttribute")) {
annotCount++;
assertEquals(4, annotation.getParameters().size());
-
+
assertNotNull(annotation.getParameter("description"));
assertNotNull(annotation.getParameter("currencyTimeLimit"));
assertNotNull(annotation.getParameter("defaultValue"));
if (annotation.getPackageName().equals("org.springframework.jmx.export.annotation")
&& annotation.getName().equals("ManagedOperation")) {
annotCount++;
-
+
assertEquals(1, annotation.getParameters().size());
assertNotNull(annotation.getParameter("types"));
assertEquals(3, annotation.getParameter("types").getValues().size());