Example usage for java.lang Boolean TRUE

List of usage examples for java.lang Boolean TRUE

Introduction

In this page you can find the example usage for java.lang Boolean TRUE.

Prototype

Boolean TRUE

To view the source code for java.lang Boolean TRUE.

Click Source Link

Document

The Boolean object corresponding to the primitive value true .

Usage

From source file:com.jaeksoft.searchlib.test.rest.CommonRestAPI.java

public WebClient client() {
    WebClient webClient = WebClient.create(IntegrationTest.SERVER_URL,
            Collections.singletonList(new JacksonJsonProvider()));
    WebClient.getConfig(webClient).getRequestContext().put("use.async.http.conduit", Boolean.TRUE);
    return webClient;
}

From source file:com.redhat.red.build.koji.HttpClientUtilsTest.java

/**
 * The test mocks available CloseableHttpQuietlyClient, and verfiy InputStream / CloseableHttpResponse close()
 * methods will never be met when closeQuietly( client ) called.
 *///from  w w w. j  av  a2s.c  om
@Test
public void testCloseQuietlyClient() throws Exception {
    final CloseableHttpClient client = Mockito.mock(CloseableHttpClient.class);
    final HttpPost request = Mockito.mock(HttpPost.class);
    final CloseableHttpResponse response = Mockito.mock(CloseableHttpResponse.class);
    final HttpEntity entity = Mockito.mock(HttpEntity.class);
    final InputStream inputStream = Mockito.mock(InputStream.class);

    Mockito.when(client.execute(request)).thenReturn(response);
    Mockito.when(response.getEntity()).thenReturn(entity);
    Mockito.when(entity.isStreaming()).thenReturn(Boolean.TRUE);
    Mockito.when(entity.getContent()).thenReturn(inputStream);

    closeQuietly(client);
    Mockito.verify(inputStream, never()).close();
    Mockito.verify(response, never()).close();
}

From source file:com.inkubator.hrm.web.loan.LoanNewSchemaFormController.java

@PostConstruct
@Override//from w  w w . j  a  v  a  2 s.com
public void initialization() {
    super.initialization();
    try {
        model = new LoanNewSchemaModel();
        isUpdate = Boolean.FALSE;
        String loanNewSchemaId = FacesUtil.getRequestParameter("loanNewSchemaId");
        if (StringUtils.isNotEmpty(loanNewSchemaId)) {
            LoanNewSchema savingType = loanNewSchemaService.getEntiyByPK(Long.parseLong(loanNewSchemaId));
            if (loanNewSchemaId != null) {
                model = getModelFromEntity(savingType);
                isUpdate = Boolean.TRUE;
            }
        }
    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:com.tacticlogistics.crm.model.bo.RadicacionBO.java

public List<GruposArchivosRadicados> getListGruposArchivosRadicados() throws Exception {
    List<HibernateOrder> conditionOrderList = new LinkedList<>();
    HibernateOrder hibernateOrder = new HibernateOrder("nombre", HibernateOrderEnum.ASC);
    conditionOrderList.add(hibernateOrder);

    GruposArchivosRadicados object = new GruposArchivosRadicados();
    object.setActivo(Boolean.TRUE);

    List<GruposArchivosRadicados> list = dao.getRQLList(object, conditionOrderList);
    return list;// ww  w  .j  a  v a 2 s  .co m
}

From source file:nz.co.senanque.vaadinsupport.ButtonProperty.java

public Object getValue() {
    // TODO Auto-generated method stub
    return Boolean.TRUE;
}

From source file:org.apache.streams.gnip.flickr.test.FlickrEDCSerDeTest.java

@Test
public void Tests() throws Exception {
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);

    InputStream is = FlickrEDCSerDeTest.class.getResourceAsStream("/FlickrEDC.xml");
    if (is == null)
        System.out.println("null");
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    XmlMapper xmlMapper = new XmlMapper();
    xmlMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    xmlMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);
    xmlMapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, Boolean.FALSE);

    ObjectMapper jsonMapper = new ObjectMapper();

    try {//from  w  w  w .  j a v a  2  s .  c  om
        while (br.ready()) {
            String line = br.readLine();
            //LOGGER.debug(line);

            Object activityObject = xmlMapper.readValue(line, Object.class);

            String jsonObject = jsonMapper.writeValueAsString(activityObject);

            //LOGGER.debug(jsonObject);
        }
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:com.redhat.rhn.frontend.action.errata.test.ErrataSearchActionTest.java

public void testExecute() throws Exception {

    ErrataSearchAction action = new ErrataSearchAction();
    ActionHelper ah = new ActionHelper();
    Errata e = ErrataFactoryTest/*  w  w  w. j av  a 2 s  .c  o m*/
            .createTestErrata(UserTestUtils.createOrg("testOrg" + this.getClass().getSimpleName()));
    String name = e.getAdvisory();

    ah.setUpAction(action, RhnHelper.DEFAULT_FORWARD);
    ah.getForm().set(BaseSearchAction.VIEW_MODE, BaseSearchAction.OPT_ADVISORY);
    ah.getForm().set(RhnAction.SUBMITTED, Boolean.TRUE);
    // these are duplicated on PURPOSE! Because mockobjects SUCK ASS!
    ah.getRequest().setupAddParameter(BaseSearchAction.SEARCH_STR, name);
    ah.getRequest().setupAddParameter(BaseSearchAction.SEARCH_STR, name);
    ah.getRequest().setupAddParameter(BaseSearchAction.VIEW_MODE, BaseSearchAction.OPT_ADVISORY);
    ah.getRequest().setupAddParameter(BaseSearchAction.VIEW_MODE, BaseSearchAction.OPT_ADVISORY);
    ah.getRequest().setupAddParameter(BaseSearchAction.FINE_GRAINED, "on");
    ah.getRequest().setupAddParameter(BaseSearchAction.FINE_GRAINED, "on");

    // I *HATE* Mockobjects
    Map paramnames = new HashMap();
    paramnames.put(BaseSearchAction.SEARCH_STR, name);
    paramnames.put(BaseSearchAction.VIEW_MODE, BaseSearchAction.OPT_ADVISORY);
    paramnames.put(BaseSearchAction.FINE_GRAINED, "on");
    paramnames.put(RhnAction.SUBMITTED, "true");
    ah.getRequest().setupGetParameterNames(IteratorUtils.asEnumeration(paramnames.keySet().iterator()));

    ah.setupClampListBounds();

    ActionForward af = ah.executeAction();
}

From source file:com.inkubator.hrm.web.personalia.OhsaCategoryFormController.java

@PostConstruct
@Override//from   ww w  . ja  va  2 s  .c  o  m
public void initialization() {
    super.initialization();
    try {
        String ohsaCategoryId = FacesUtil.getRequestParameter("ohsaCategoryId");
        model = new OhsaCategoryModel();
        isUpdate = Boolean.FALSE;
        if (StringUtils.isNotEmpty(ohsaCategoryId)) {
            OhsaCategory ohsaCategory = service.getEntiyByPK(Long.parseLong(ohsaCategoryId));
            if (ohsaCategoryId != null) {
                model = getModelFromEntity(ohsaCategory);
                isUpdate = Boolean.TRUE;
            }
        }
    } catch (Exception e) {
        LOGGER.error("Error", e);
    }
}

From source file:br.com.sicoob.cro.cop.batch.configuration.TaskletInjector.java

/**
 * Injeta a dependencia do contexto no takslet.
 *
 * @throws Exception para algum erro./*from  www . j a va 2s.c  om*/
 */
public void inject() throws Exception {
    Field[] fields = BatchUtil.getDeclaredFields(this.step.getTasklet());
    for (Field field : fields) {
        if (Validation.isFieldAnnotatedWith(field, Context.class)) {
            LOG.log(Level.INFO,
                    BatchPropertiesUtil.getInstance().getMessage(BatchKeys.BATCH_INJECTOR_INFO.getKey(),
                            new String[] { BatchKeys.CONTEXT.getKey(), field.getName() }));
            field.setAccessible(Boolean.TRUE);
            field.set(this.step.getTasklet(), createContext());
        }
    }
}

From source file:com.consol.citrus.admin.marshal.SpringBeanMarshaller.java

public SpringBeanMarshaller() {
    setContextPaths("com.consol.citrus.admin.model.spring", "com.consol.citrus.model.config.core",
            "com.consol.citrus.model.config.jms", "com.consol.citrus.model.config.ws",
            "com.consol.citrus.model.config.websocket", "com.consol.citrus.model.config.mail",
            "com.consol.citrus.model.config.ssh", "com.consol.citrus.model.config.vertx",
            "com.consol.citrus.model.config.ftp", "com.consol.citrus.model.config.mail",
            "com.consol.citrus.model.config.docker", "com.consol.citrus.model.config.rmi",
            "com.consol.citrus.model.config.jmx", "com.consol.citrus.model.config.http");

    Map<String, Object> marshallerProperties = new HashMap<>();
    marshallerProperties.put(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshallerProperties.put(Marshaller.JAXB_ENCODING, "UTF-8");
    marshallerProperties.put(Marshaller.JAXB_FRAGMENT, true);

    marshallerProperties.put("com.sun.xml.bind.namespacePrefixMapper", new NamespacePrefixMapper());
    setMarshallerProperties(marshallerProperties);

    try {/*w w w.j av  a  2  s.  com*/
        afterPropertiesSet();
    } catch (Exception e) {
        log.warn("Failed to setup configuration component marshaller", e);
    }
}