Package com.asakusafw.windgate.core.resource

Examples of com.asakusafw.windgate.core.resource.ResourceProfile


    @Test
    public void convert() throws Exception {
        hadoopConf.set("fs.default.name", "file:/");

        Map<String, String> conf = new HashMap<String, String>();
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);
View Full Code Here


    public void convert_basePath() throws Exception {
        File current = new File(".").getAbsoluteFile().getCanonicalFile();

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, current.toURI().toString());
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);
View Full Code Here

     */
    @Test
    public void convert_basePath_relative() throws Exception {
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "target");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

View Full Code Here

        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, current.toURI().toString() + "/${var}");

        Map<String, String> env = new HashMap<String, String>();
        env.put("var", "replacement");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList(env)),
                conf);
View Full Code Here

     */
    @Test(expected = IllegalArgumentException.class)
    public void convert_basePath_unresolved() throws Exception {
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "${__UNDEFINED__}");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

View Full Code Here

     */
    @Test(expected = IOException.class)
    public void convert_basePath_invalid() throws Exception {
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_BASE_PATH, "INVALIDFS:UNKNOWN");
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

View Full Code Here

     */
    @Test
    public void convert_compression() throws Exception {
        Map<String, String> conf = new HashMap<String, String>();
        conf.put(HadoopFsProfile.KEY_COMPRESSION, DefaultCodec.class.getName());
        ResourceProfile resourceProfile = new ResourceProfile(
                "testing",
                HadoopFsProvider.class,
                new ProfileContext(getClass().getClassLoader(), new ParameterList()),
                conf);

View Full Code Here

        Collection<? extends ResourceProfile> rps = ResourceProfile.loadFrom(
                p,
                ProfileContext.system(getClass().getClassLoader()));
        assertThat(rps.size(), is(1));
        ResourceProfile rp = rps.iterator().next();
        this.profile = SshProfile.convert(new Configuration(), rp);
    }
View Full Code Here

                        ProfileContext.system(BasicProcessProvider.class.getClassLoader()),
                        Collections.<String, String>emptyMap()
                ),
        });
        List<ResourceProfile> resources = Arrays.asList(new ResourceProfile[] {
                new ResourceProfile(
                        "fs1",
                        FileResourceProvider.class,
                        ProfileContext.system(FileResourceProvider.class.getClassLoader()),
                        Collections.<String, String>emptyMap()),
                new ResourceProfile(
                        "fs2",
                        FileResourceProvider.class,
                        ProfileContext.system(FileResourceProvider.class.getClassLoader()),
                        Collections.<String, String>emptyMap()),
        });
View Full Code Here

    public void convert() throws Exception {
        Map<String, String> map = new HashMap<String, String>();
        map.put(JdbcProfile.KEY_DRIVER, org.h2.Driver.class.getName());
        map.put(JdbcProfile.KEY_URL, h2.getJdbcUrl());

        ResourceProfile rp = toProfile(map);
        JdbcProfile profile = JdbcProfile.convert(rp);
        assertThat(profile.getResourceName(), is(rp.getName()));
        assertThat(profile.getBatchPutUnit(), greaterThan(0L));
        Connection conn = profile.openConnection();
        try {
            Statement stmt = conn.createStatement();
            stmt.execute("INSERT INTO SIMPLE (VALUE) VALUES ('Hello, world!')");
View Full Code Here

TOP

Related Classes of com.asakusafw.windgate.core.resource.ResourceProfile

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.