Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.IMemberValuePairBinding


    IMocksControl control = createStrictControl();
   
    ITypeBinding binding = control.createMock(ITypeBinding.class);
    IAnnotationBinding anno = control.createMock(IAnnotationBinding.class);
    ITypeBinding typeBinding = control.createMock(ITypeBinding.class);
    IMemberValuePairBinding memberValue = control.createMock(IMemberValuePairBinding.class);
   
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {anno});
    expect(anno.getAnnotationType()).andReturn(typeBinding);
    expect(typeBinding.getQualifiedName()).andReturn("java.lang.String");
    expect(anno.getAllMemberValuePairs()).andReturn(new IMemberValuePairBinding[] {memberValue});
    expect(memberValue.getName()).andReturn("value");
    expect(memberValue.getValue()).andReturn("Test-Annotation");
   
    control.replay();
   
    assertEquals("Test-Annotation",
        mappingHelper.getAnnotationValue(binding, String.class));
View Full Code Here


    reset(binding);
   
    // Last test is with an annotation value
    IAnnotationBinding annoBinding = createMock(IAnnotationBinding.class);
    ITypeBinding annoTypeBinding = createMock(ITypeBinding.class);
    IMemberValuePairBinding memberValuePairBinding = createMock(IMemberValuePairBinding.class);
    IPackageBinding packageBinding = createMock(IPackageBinding.class);
   
    expect(binding.getQualifiedName()).andReturn("de.supertest.TestClass");
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {annoBinding});
    expect(annoBinding.getAnnotationType()).andReturn(annoTypeBinding);
    expect(annoTypeBinding.getQualifiedName()).andReturn(BelongsToComponent.class.getCanonicalName());
    expect(annoBinding.getAllMemberValuePairs()).andReturn(new IMemberValuePairBinding[]
                             { memberValuePairBinding });
    expect(memberValuePairBinding.getName()).andReturn("value");
    expect(memberValuePairBinding.getValue()).andReturn("Comp1");
   
    expect(binding.getName()).andReturn("TestClass");
    expect(binding.getPackage()).andReturn(packageBinding);
    expect(packageBinding.getName()).andReturn("de.supertest");
    expect(binding.getAnnotations()).andReturn(new IAnnotationBinding[] {}).anyTimes();
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.IMemberValuePairBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.