Package br.com.caelum.vraptor.util

Examples of br.com.caelum.vraptor.util.EmptyBundle


      this.delegate = new PropertyResourceBundle(new FileInputStream(bundle));
      logger.debug("REPORT_LOCALE --> " + locale);
      logger.debug("REPORT_RESOURCE_BUNDLE --> " + bundle.getAbsolutePath());
        } catch (FileNotFoundException e) {
          logger.debug("Couldn't find report bundle at " + bundle.getAbsolutePath() + ", creating an empty one");
            this.delegate = new EmptyBundle();
        } catch (IOException e) {
          logger.debug("Couldn't use report bundle at " + bundle.getAbsolutePath() + ", creating an empty one");
            this.delegate = new EmptyBundle();
    }
  }
View Full Code Here


public class MockLocalization implements Localization {

  private final ResourceBundle bundle;

  public MockLocalization() {
    this.bundle = new SafeResourceBundle(new EmptyBundle());
  }
View Full Code Here

 
      try {
      return ResourceBundle.getBundle(baseName, getLocale());
      } catch (MissingResourceException e) {
      logger.debug("couldn't find message bundle, creating an empty one");
      return new EmptyBundle();
      }
 
    }
    if (bundle instanceof LocalizationContext) {
      return ((LocalizationContext) bundle).getResourceBundle();
    }
    logger.warn("Can't handle bundle {}. Please report this bug. Using an empty bundle", bundle);
    return new EmptyBundle();
  }
View Full Code Here

*
*/
public class MockLocalization implements Localization {

  public ResourceBundle getBundle() {
    return new SafeResourceBundle(new EmptyBundle());
  }
View Full Code Here

  }


  @SuppressWarnings("unchecked")
  protected <T> T getParameters(ResourceMethod method) {
    return (T) provider.getParametersFor(method, errors, new SafeResourceBundle(new EmptyBundle()))[0];
  }
View Full Code Here

public class IogiParametersProviderTest extends ParametersProviderTest {
  private @Mock Localization mockLocalization;

  @Override
  protected ParametersProvider getProvider() {
    when(mockLocalization.getBundle()).thenReturn(new SafeResourceBundle(new EmptyBundle()));
    return new IogiParametersProvider(nameProvider, request, new VRaptorInstantiator(converters, new VRaptorDependencyProvider(container), mockLocalization, new VRaptorParameterNamesProvider(nameProvider), request));
  }
View Full Code Here

  @Before
  public void setup() {
  Proxifier proxifier = new JavassistProxifier(new ObjenesisInstanceCreator());
  validator = new DefaultValidator(result, viewsFactory, outjector, proxifier, null, localization);
  when(localization.getBundle()).thenReturn(new EmptyBundle());
  }
View Full Code Here

    this.validator = new DefaultValidator(result, new DefaultValidationViewsFactory(result, proxifier), outjector, proxifier, beanValidator, localization);
    when(result.use(LogicResult.class)).thenReturn(logicResult);
    when(result.use(PageResult.class)).thenReturn(pageResult);
    when(logicResult.forwardTo(MyComponent.class)).thenReturn(instance);
    when(pageResult.of(MyComponent.class)).thenReturn(instance);
    when(localization.getBundle()).thenReturn(new EmptyBundle());
  }
View Full Code Here

      this.delegate = new PropertyResourceBundle(new FileInputStream(bundle));
      logger.debug("REPORT_LOCALE --> " + locale);
      logger.debug("REPORT_RESOURCE_BUNDLE --> " + bundle.getAbsolutePath());
        } catch (FileNotFoundException e) {
          logger.debug("Couldn't find report bundle at " + bundle.getAbsolutePath() + ", creating an empty one");
            this.delegate = new EmptyBundle();
        } catch (IOException e) {
          logger.debug("Couldn't use report bundle at " + bundle.getAbsolutePath() + ", creating an empty one");
            this.delegate = new EmptyBundle();
    }
  }
View Full Code Here

      try {
        return ResourceBundle.getBundle(baseName, getLocale());
      } catch (MissingResourceException e) {
        logger.debug("couldn't find message bundle, creating an empty one");
        return new EmptyBundle();
      }

    }
    if (bundle instanceof LocalizationContext) {
      return ((LocalizationContext) bundle).getResourceBundle();
    }
    logger.warn("Can't handle bundle {}. Please report this bug. Using an empty bundle", bundle);
    return new EmptyBundle();
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.util.EmptyBundle

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.