Examples of UUID


Examples of org.internna.iwebmvc.model.UUID

    @Test
    public void find_and_save() {
        entityManager.persist(anImage);
        entityManager.getTransaction().commit();
        UUID pk = anImage.getId();
        entityManager.getTransaction().begin();
        anImage = entityManager.find(Image.class, pk);
        assertNotNull("Record was saved", anImage.getId());
        assertEquals("Parent data saved", "/tmp/img1.gif" ,anImage.getUri());
        assertTrue("Child data saved", anImage.getWidth() == 100);
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @Test
    public void testEquals() {
        assertFalse("Null is not equal to any UUID", uuid.equals(null));
        assertEquals("Two UUIDs are equal if they are the same", uuid, uuid);
        assertEquals("Two UUIDs constructed in a diffenrent way may be equal", uuid2, new UUID("987654321098765432109876543210aa"));
        assertFalse("Different UUIDs cannot be equal", uuid.equals(uuid2));
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    public void equals() {
        Locale locale = entityManager.find(Locale.class, pk);
        assertFalse(locale.equals(null));
        Locale other = new Locale();
        assertFalse(locale.equals(other));
        other.setId(new UUID("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"));
        assertFalse(locale.equals(other));
        assertTrue(locale.equals(locale));
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @Test
    public void hascode() {
        Locale locale = entityManager.find(Locale.class, pk);
        Locale other = new Locale();
        assertFalse(locale.hashCode() == other.hashCode());
        other.setId(new UUID("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"));
        assertFalse(locale.hashCode() == other.hashCode());
        assertTrue(locale.hashCode() == locale.hashCode());
    }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @Test
    public void find_and_save() {
        entityManager.persist(hi);
        entityManager.getTransaction().commit();
        UUID pk = hi.getId();
        entityManager.getTransaction().begin();
        hi = entityManager.find(I18nText.class, pk);
        assertNotNull("Record was saved", hi.getId());
        assertTrue("Collection was saved", hi.getValues().size() == 2);
        assertNotNull("Sub records were saved", hi.getValues().iterator().next().getId());
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

        filterList.get(2).setType("ENTITY");
        filterList.get(2).setPath("readableText");
        filterList.get(2).setFrom("0000aa000000aa000000aa000000aa00");
        filters = impl.mapFilters(Link.class, filterList, null);
        assertTrue(filters.size() == 4);
        assertTrue(filters.containsValue(new UUID("0000aa000000aa000000aa000000aa00")));
        userManager.setName("guest");
        assertNull(impl.mapFilters(OwnedEntity.class, null, null).entrySet().iterator().next().getValue());
        userManager.setName("john");
        assertTrue(CollectionUtils.isNotEmpty(impl.mapFilters(OwnedEntity.class, null, new MockHttpServletRequest())));
        Map<String, Object> params = impl.mapFilters(OwnedEntity.class, null, new MockHttpServletRequest());
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    public void testParse() {
        assertNull(amountParser.parse(null));
        Amount amount = new Amount();
        assertEquals(amountParser.parse(amount), amount);
        amount.setCurrency(new Currency());
        amount.getCurrency().setId(new UUID("000000aa000000aa000000aa000000aa"));
        assertEquals(amountParser.parse(amount), amount);
        Amount amount2 = new Amount();
        amount2.setCurrency(new Currency());
        amount2.getCurrency().setCurrency(java.util.Currency.getInstance("USD"));
        assertNotNull(amountParser.parse(amount2).getCurrency().getId());
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

      if (!data.isNull()) {
            try {
            String id = LocalUtil.urlDecode(data.getValue());
            if (hasText(id)) {
                Assert.isEncrypted(decipherer, id);
                return new UUID(decipherer.decrypt(id));
            }
            } catch (Exception e) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert UUID from: " + data, e));
            }
      }
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

            int tokens = tokenizer.countTokens();
            Class<? extends DomainEntity> clazz = ClassUtils.forName(decipherer.decrypt(data.get(1)));
            for (int i = 0; i < tokens; i++) {
                String token = tokenizer.nextToken();
                if (!excludedPositions.contains(i)) {
                    list.add(dao.find(clazz, new UUID(decipherer.decrypt(token))));
                }
            }
            setValue(list);
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
View Full Code Here

Examples of org.internna.iwebmvc.model.UUID

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        Object selectable = null;
        if (StringUtils.hasText(text)) {
            Assert.isEncrypted(decipherer, text);
            selectable = dao.find(clazz, new UUID(decipherer.decrypt(text)));
        }
        setValue(selectable);
    }
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.