Package org.apache.ivory.entity.v0.feed

Examples of org.apache.ivory.entity.v0.feed.Location


        CurrentUser.authenticate(USER);
    }

    @Test
    public void testGetType() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar");
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage(FileSystemStorage.FILE_SYSTEM_URL, locations);
        Assert.assertEquals(storage.getType(), Storage.TYPE.FILESYSTEM);
View Full Code Here


        for (Location loc : locations.getLocations()) {
            if (loc.getType() == type) {
                return loc;
            }
        }
        Location loc = new Location();
        loc.setPath("/tmp");
        loc.setType(type);
        return loc;
    }
View Full Code Here

                storage.getUriTemplate(LocationType.META));
    }

    @Test
    public void testGetUriTemplateForData() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar");
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("jail://global:00", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "jail://global:00/foo/bar");
View Full Code Here

        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "jail://global:00/foo/bar");
    }

    @Test
    public void testFSHomeDir() {
        final Location location = new Location();
        location.setPath("foo/bar"); // relative path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getWorkingDir().toString(), "/user/falcon");
View Full Code Here

        Assert.assertEquals(storage.getWorkingDir().toString(), "/user/falcon");
    }

    @Test
    public void testGetUriTemplateForDataWithRelativePath() throws Exception {
        final Location location = new Location();
        location.setPath("foo/bar"); // relative path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA),
View Full Code Here

                "hdfs://localhost:41020/user/" + USER + "/foo/bar");
    }

    @Test
    public void testGetUriTemplateForDataWithAbsolutePath() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar"); // absolute path
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "hdfs://localhost:41020/foo/bar");
View Full Code Here

    }

    @Test
    public void testGetUriTemplateForDataWithAbsoluteURL() throws Exception {
        final String absoluteUrl = "s3://host:1000/foo/bar";
        final Location location = new Location();
        location.setPath(absoluteUrl); // absolute url
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage("hdfs://localhost:41020", locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), absoluteUrl);
View Full Code Here

    }

    @Test (dataProvider = "locationTestWithRelativePathDataProvider")
    public void testGetUriTemplateWithRelativePath(String storageUrl, String path,
                                                   String expected) throws Exception {
        final Location location = new Location();
        location.setPath(path);
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage(storageUrl, locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), expected);
View Full Code Here

        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), expected);
    }

    @Test
    public void testGetUriTemplate() throws Exception {
        final Location dataLocation = new Location();
        dataLocation.setPath("/data/foo/bar");
        dataLocation.setType(LocationType.DATA);

        final Location metaLocation = new Location();
        metaLocation.setPath("/meta/foo/bar");
        metaLocation.setType(LocationType.META);

        final Location statsLocation = new Location();
        statsLocation.setPath("/stats/foo/bar");
        statsLocation.setType(LocationType.STATS);

        final Location tmpLocation = new Location();
        tmpLocation.setPath("/tmp/foo/bar");
        tmpLocation.setType(LocationType.TMP);

        List<Location> locations = new ArrayList<Location>();
        locations.add(dataLocation);
        locations.add(metaLocation);
        locations.add(statsLocation);
View Full Code Here

        Assert.assertEquals(storage.getUriTemplate(), expected.toString());
    }

    @Test
    public void testGetUriTemplateWithOutStorageURL() throws Exception {
        final Location location = new Location();
        location.setPath("/foo/bar");
        location.setType(LocationType.DATA);
        List<Location> locations = new ArrayList<Location>();
        locations.add(location);

        FileSystemStorage storage = new FileSystemStorage(FileSystemStorage.FILE_SYSTEM_URL, locations);
        Assert.assertEquals(storage.getUriTemplate(LocationType.DATA), "${nameNode}/foo/bar");
View Full Code Here

TOP

Related Classes of org.apache.ivory.entity.v0.feed.Location

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.