Package de.ailis.jollada.model

Examples of de.ailis.jollada.model.Asset


     */

    @Test
    public void testSubject()
    {
        final Asset asset = new Asset();
        asset.setSubject("SUBJECT");
        assertEquals("SUBJECT", asset.getSubject());
    }
View Full Code Here


     */

    @Test
    public void testTitle()
    {
        final Asset asset = new Asset();
        asset.setTitle("TITLE");
        assertEquals("TITLE", 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(expected = IllegalArgumentException.class)
    public void testNullUnit()
    {
        new Asset().setUnit(null);
    }
View Full Code Here

     */

    @Test
    public void testUpAxis()
    {
        final Asset asset = new Asset();
        asset.setUpAxis(UpAxis.X_UP);
        assertEquals(UpAxis.X_UP, asset.getUpAxis());
    }
View Full Code Here

     */

    @Test(expected = IllegalArgumentException.class)
    public void testNullUpAxis()
    {
        new Asset().setUpAxis(null);
    }
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();
        assertTrue(asset.equals(asset2));
        asset2.getKeywords().add("KEYWORD");
        assertFalse(asset.equals(asset2));
        asset2.getKeywords().clear();
        assertTrue(asset.equals(asset2));
    }
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=" +
                "RELATIVE_TO_GROUND], keywords=[KEYWORD], revision=R, " +
                "subject=S, title=T, unit=2.0 m, upAxis=X_UP]",
            asset.toString());
    }
View Full Code Here

    @Test
    public void testAsset()
    {
        final VisualSceneLibrary lib = new VisualSceneLibrary();
        assertNull(lib.getAsset());
        lib.setAsset(new Asset());
        assertNotNull(lib.getAsset());
        lib.setAsset(null);
        assertNull(lib.getAsset());
    }
View Full Code Here

TOP

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

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.