Package de.ailis.jollada.model

Examples of de.ailis.jollada.model.Unit


        assertEquals(0, asset.getKeywords().size());
        assertTrue(asset.getModified() >= now);
        assertNull(asset.getRevision());
        assertNull(asset.getSubject());
        assertNull(asset.getTitle());
        assertEquals(new Unit(), asset.getUnit());
        assertEquals(UpAxis.Y_UP, asset.getUpAxis());
    }
View Full Code Here


     */

    @Test
    public void testFullConstructor()
    {
        final Asset asset = new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T");
        assertEquals(1, asset.getCreated());
        assertEquals(2, asset.getModified());
        assertEquals(new Unit(2, "m"), asset.getUnit());
        assertEquals(UpAxis.X_UP, asset.getUpAxis());
        assertEquals("R", asset.getRevision());
        assertEquals("S", asset.getSubject());
        assertEquals("T", asset.getTitle());
    }
View Full Code Here

    @Test
    public void testUnit()
    {
        final Asset asset = new Asset();
        asset.setUnit(new Unit(2, "meters"));
        assertEquals(new Unit(2, "meters"), asset.getUnit());
    }
View Full Code Here

     */

    @Test
    public void testEquals()
    {
        final Asset asset = new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T");
        assertTrue(asset.equals(asset));
        assertTrue(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(null));
        assertFalse(asset.equals("something"));
        assertFalse(asset.equals(new Asset(2, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 3, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(3, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.Y_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(2, 2, 3), "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R2", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S2", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T2")));

        assertFalse(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            null, "R", "S", "T").equals(asset));
        assertFalse(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), null, "S", "T").equals(asset));
        assertFalse(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", null, "T").equals(asset));
        assertFalse(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", null).equals(asset));

        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            null, "R", "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), null, "S", "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", null, "T")));
        assertFalse(asset.equals(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", null)));

        assertTrue(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            null, "R", "S", "T").equals(new Asset(1,
            2, new Unit(2, "m"), UpAxis.X_UP, null, "R", "S", "T")));
        assertTrue(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), null, "S", "T").equals(new Asset(
            1,
            2, new Unit(2, "m"), UpAxis.X_UP, new GeographicLocation(1, 2, 3),
            null, "S", "T")));
        assertTrue(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", null, "T").equals(new Asset(
            1,
            2, new Unit(2, "m"), UpAxis.X_UP, new GeographicLocation(1, 2, 3),
            "R", null, "T")));
        assertTrue(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", null).equals(new Asset(
            1,
            2, new Unit(2, "m"), UpAxis.X_UP, new GeographicLocation(1, 2, 3),
            "R", "S", null)));

        final Asset asset2 = new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T");
        assertTrue(asset.equals(asset2));
        asset2.getContributors().add(new Contributor());
        assertFalse(asset.equals(asset2));
        asset2.getContributors().clear();
View Full Code Here

     */

    @Test
    public void testHashCode()
    {
        final int hc1 = new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode();
        assertEquals(hc1, new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode());
        assertThat(hc1, not(new Asset(2, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 3, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(3, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.Y_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(2, 2, 3), "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R2", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S2", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T2").hashCode()));

        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            null, "R", "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), null, "S", "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", null, "T").hashCode()));
        assertThat(hc1, not(new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", null).hashCode()));
    }
View Full Code Here

     */

    @Test
    public void testToString()
    {
        final Asset asset = new Asset(1, 2, new Unit(2, "m"), UpAxis.X_UP,
            new GeographicLocation(1, 2, 3), "R", "S", "T");
        asset.getKeywords().add("KEYWORD");
        assertEquals("Asset [contributors=[], created=1, modified=2, " +
                "geographicLocation=GeographicLocation [longitude=1.0, " +
                "latitude=2.0, altitude=3.0, altitudeMode=" +
View Full Code Here

     */

    @Test
    public void testDefaultConstructor()
    {
        final Unit unit = new Unit();
        assertEquals(1, unit.getMeter(), 0.0001f);
        assertEquals("meter", unit.getName());
    }
View Full Code Here

     */

    @Test
    public void testFullConstructor()
    {
        final Unit unit = new Unit(2, "meters");
        assertEquals(2, unit.getMeter(), 0.0001f);
        assertEquals("meters", unit.getName());
    }
View Full Code Here

     */

    @Test(expected = IllegalArgumentException.class)
    public void testConstructorWithNull()
    {
        new Unit(2, null).toString();
    }
View Full Code Here

     */

    @Test
    public void testEquals()
    {
        final Unit unit1 = new Unit(2, "meters");
        final Unit unit2 = new Unit(2, "meters");
        final Unit unit3 = new Unit(3, "meters");
        final Unit unit4 = new Unit(2, "kilometers");
        assertTrue(unit1.equals(unit2));
        assertTrue(unit1.equals(unit1));
        assertFalse(unit1.equals(null));
        assertFalse(unit1.equals("someOther"));
        assertFalse(unit1.equals(unit3));
View Full Code Here

TOP

Related Classes of de.ailis.jollada.model.Unit

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.