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:edu.vt.middleware.cas.authentication.handler.LdapAuthenticationHandlerTest.java

@Test
public void testAuthenticate() throws Exception {
    String[] values;//from www.ja v a  2  s.  co m
    String password;
    String expected;
    for (String username : testCredentials.stringPropertyNames()) {
        values = testCredentials.get(username).toString().split("\\|");
        password = values[0];
        expected = values[1];
        if (Boolean.TRUE.toString().equalsIgnoreCase(expected)) {
            assertEquals(true, handler.authenticate(newCredentials(username, password)));
        } else {
            try {
                handler.authenticate(newCredentials(username, password));
                fail("Should have thrown " + expected);
            } catch (Exception e) {
                assertEquals(expected, e.getClass().getSimpleName());
            }
        }
    }
}

From source file:org.dspace.webmvc.controller.BrowseHierarchyController.java

@RequestMapping
protected String handleRequestInternal(@RequestAttribute Context context, ModelMap model,
        HttpServletRequest request) throws Exception {
    BrowseHierarchyRequestProcessor bhrp = new BrowseHierarchyRequestProcessor(context, request);

    model.addAttribute("collectionMap", bhrp.getCollectionMap());
    model.addAttribute("communityMap", bhrp.getCommunityMap());
    model.addAttribute("topLevelCommunities", bhrp.getTopLevelCommunities());

    if (AuthorizeManager.isAdmin(context)) {
        model.addAttribute("admin_button", Boolean.TRUE);
    }//from   w  ww. ja  v  a  2  s  . co  m

    //return "pages/hierarchy";
    return "pages/community-list";
}

From source file:cec.easyshop.storefront.security.impl.DefaultGuestCheckoutCartCleanStrategy.java

@Override
public void cleanGuestCart(final HttpServletRequest request) {

    if (Boolean.TRUE.equals(getSessionService().getAttribute(WebConstants.ANONYMOUS_CHECKOUT))
            && getCheckoutCustomerStrategy().isAnonymousCheckout()
            && StringUtils.isBlank(request.getHeader(AJAX_REQUEST_HEADER_NAME)) && isGetMethod(request)
            && !checkWhetherURLContainsCheckoutPattern(request)) {
        final CartModel cartModel = getCartService().getSessionCart();
        cartModel.setDeliveryAddress(null);
        cartModel.setDeliveryMode(null);
        cartModel.setPaymentInfo(null);//from w w w.j a  va  2  s. co m
        cartModel.setUser(getUserService().getAnonymousUser());
        getCartService().saveOrder(cartModel);
        getSessionService().removeAttribute(WebConstants.ANONYMOUS_CHECKOUT);
        getSessionService().removeAttribute(WebConstants.ANONYMOUS_CHECKOUT_GUID);
    }

}

From source file:com.google.gmail.test.GMailMessageSerDeTest.java

@Ignore
@Test/*from   ww w  .j a v  a  2s.co  m*/
public void Tests() {
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, Boolean.TRUE);
    mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, Boolean.TRUE);

    InputStream is = GMailMessageSerDeTest.class.getResourceAsStream("/datasift_jsons.txt");
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);

    try {
        while (br.ready()) {
            String line = br.readLine();
            LOGGER.debug(line);

            // implement
        }
    } catch (Exception e) {
        e.printStackTrace();
        Assert.fail();
    }
}

From source file:jj.resource.FileTypeSettingsDefaultProvider.java

private static ResourceSettings makeSettings(Map<String, Object> input) {
    String mimeType = (String) input.get("mimeType");
    Charset charset = input.containsKey("charset") ? Charset.forName((String) input.get("charset")) : null;
    boolean compressible = input.containsKey("compressible") && Boolean.TRUE.equals(input.get("compressible"));

    return new ResourceSettings(mimeType, charset, compressible);
}

From source file:net.jofm.format.BooleanFormat.java

@Override
protected Object doParse(String value, Class<?> destinationClazz) {
    if (value.startsWith(trueStr)) {
        return Boolean.TRUE;
    } else {//from www. j a va 2 s . c  om
        return Boolean.FALSE;
    }
}

From source file:za.co.dwarfsun.jobcardmanager.test.repository.AttributeRepositoryTest.java

@Test(enabled = false)
public void createAttribute() {
    attributeRepository = ctx.getBean(AttributeRepository.class);
    Attribute attribute = new Attribute.Builder("Parcel Number").tableName("parcel").field("strap")
            .iskey(Boolean.TRUE).build();
    attributeRepository.save(attribute);
    id = attribute.getId();//from  w  w w . ja  va 2 s .  c om
    Assert.assertNotNull(attribute);
}

From source file:mx.org.ift.sns.encryptor.Encryptor.java

public Boolean executeProcess(String fileName) {
    Boolean resp = Boolean.TRUE;
    try {/*  w  ww  .java 2  s.  c om*/

        readCsvFile(fileName);
        encryptPassword(userPassMap);
        printPasswordEncryptor();

    } catch (Exception e) {
        e.printStackTrace();
        resp = Boolean.FALSE;
    }
    return resp;

}

From source file:it.geosolutions.opensdi.operations.UserOperation.java

/**
 * Obtain run time directory//from   www. jav a  2  s . c o  m
 * 
 * @return default directory if differentDirectoryByUser it's disabled or user
 *         directory otherwise
 */
public String getRunTimeDir() {
    String dir = null;
    if (Boolean.TRUE.equals(differentDirectoryByUser)) {

        String username = SecurityContextHolder.getContext().getAuthentication().getName();
        dir = GeoBatchRunInfoUtils.getRunDir(getDefaultBaseDir(), username);
    } else {
        dir = getDefaultBaseDir();
    }
    return dir;
}

From source file:org.cleverbus.admin.web.console.ConsoleController.java

@RequestMapping("/console")
public String showConsole(@ModelAttribute("model") ModelMap model) {

    // this variable is set only if monitoring is switched on
    final String state = System.getProperty(JAVAMELODY_DISABLED);

    final Boolean monitoring = StringUtils.isEmpty(state) || Boolean.valueOf(state).equals(Boolean.TRUE);
    model.addAttribute("javamelody", monitoring);

    return VIEW_NAME;
}