Examples of FieldReader


Examples of org.apache.drill.exec.vector.complex.reader.FieldReader

      holder.start = offsets.getAccessor().get(index);
      holder.end = offsets.getAccessor().get(index+1);
    }

    public void get(int index, ComplexHolder holder){
      FieldReader reader = getReader();
      reader.setPosition(index);
      holder.reader = reader;
    }
View Full Code Here

Examples of org.apache.drill.exec.vector.complex.reader.FieldReader

      int offset = h.start + arrayIndex;

      if(offset >= h.end){
        holder.reader = NullReader.INSTANCE;
      }else{
        FieldReader r = vector.getAccessor().getReader();
        r.setPosition(offset);
        holder.reader = r;
      }

    }
View Full Code Here

Examples of org.apache.drill.exec.vector.complex.reader.FieldReader

      holder.start = offsets.getAccessor().get(index);
      holder.end = offsets.getAccessor().get(index+1);
    }

    public void get(int index, ComplexHolder holder){
      FieldReader reader = getReader();
      reader.setPosition(index);
      holder.reader = reader;
    }
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

    private static Set<Field> scanForInjection(Object testClass, Class<?> clazz) {
        Set<Field> testedFields = new HashSet<Field>();
        Field[] fields = clazz.getDeclaredFields();
        for (Field field : fields) {
            if (null != field.getAnnotation(InjectMocks.class)) {
                if(new FieldReader(testClass, field).isNull()) {
                    new Reporter().injectMockAnnotationFieldIsNull(field.getName());
                }
                testedFields.add(field);
            }
        }
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

     */
    private Set<Object> scan() {
        Set<Object> mocks = newMockSafeHashSet();
        for (Field field : clazz.getDeclaredFields()) {
            // mock or spies only
            FieldReader fieldReader = new FieldReader(instance, field);

            Object mockInstance = preparedMock(fieldReader.read(), field);
            if (mockInstance != null) {
                mocks.add(mockInstance);
            }
        }
        return mocks;
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

*/
public class SpyOnInjectedFieldsHandler extends MockInjectionStrategy {

    @Override
    protected boolean processInjection(Field field, Object fieldOwner, Set<Object> mockCandidates) {
        FieldReader fieldReader = new FieldReader(fieldOwner, field);

        // TODO refoctor : code duplicated in SpyAnnotationEngine
        if(!fieldReader.isNull() && field.isAnnotationPresent(Spy.class)) {
            try {
                Object instance = fieldReader.read();
                if (new MockUtil().isMock(instance)) {
                    // A. instance has been spied earlier
                    // B. protect against multiple use of MockitoAnnotations.initMocks()
                    Mockito.reset(instance);
                } else {
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

     */
    private Set<Object> scan() {
        Set<Object> mocks = newMockSafeHashSet();
        for (Field field : clazz.getDeclaredFields()) {
            // mock or spies only
            FieldReader fieldReader = new FieldReader(instance, field);

            Object mockInstance = preparedMock(fieldReader.read(), field);
            if (mockInstance != null) {
                mocks.add(mockInstance);
            }
        }
        return mocks;
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

    private static Set<Field> scanForInjection(Object testClass, Class<?> clazz) {
        Set<Field> testedFields = new HashSet<Field>();
        Field[] fields = clazz.getDeclaredFields();
        for (Field field : fields) {
            if (null != field.getAnnotation(InjectMocks.class)) {
                if(new FieldReader(testClass, field).isNull()) {
                    new Reporter().injectMockAnnotationFieldIsNull(field.getName());
                }
                testedFields.add(field);
            }
        }
View Full Code Here

Examples of org.mockito.internal.util.reflection.FieldReader

    */
   private Set<Object> scan() {
      Set<Object> mocks = newMockSafeHashSet();
      for (Field field : clazz.getDeclaredFields()) {
         // mock or spies only
         FieldReader fieldReader = new FieldReader(instance, field);

         Object mockInstance = preparedMock(fieldReader.read(), field);
         if (mockInstance != null) {
            mocks.add(mockInstance);
         }
      }
      return mocks;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.