Package com.ontology2.haruhi.flows

Examples of com.ontology2.haruhi.flows.SpringStepTest


                        "<http://rdf.basekb.com/ns/dataworld.gardening_hint.replaced_by>"
                        ,"<http://rdf.basekb.com/ns/m.0j2r8t8>"))
                ,new PrimitiveTriplePredicateRewriter(
                        "<http://rdf.basekb.com/ns/type.object.type>",
                        "<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"))
                ,new PrimitiveTripleTypeRewriter(
                        "xsd:datetime",
                        "<http://rdf.ontology2.com/freebaseDate>"
                        ));
    }
View Full Code Here


    RewriteSubjectMapper mapper;
    Mapper<LongWritable,Text,Text,Text>.Context context;

    @Before
    public void setup() {
        mapper=new RewriteSubjectMapper();
        context=mock(Mapper.Context.class);
    }
View Full Code Here

    RewriteSubjectReducer reducer;
    Reducer<TaggedTextItem,TaggedTextItem,Text,Text>.Context context;

    @Before
    public void setup() {
        reducer=new RewriteSubjectReducer();
        context=mock(Reducer.Context.class);
    }
View Full Code Here

        this.name=o.name();
        this.defaultValue=o.defaultValue();
        this.description=o.description();
        if(!Object.class.equals(o.contextualConverter())
            &&  !ContextualConverter.class.isAssignableFrom(o.contextualConverter()))
            throw new MisconfigurationException("A contextualConverter must be a ContextualConverter for option "+name);
        this.substitutor=o.contextualConverter();
    }
View Full Code Here

        } else {
            try {
                ContextualConverter<?> cc=(ContextualConverter <?>) getContextualConverter().newInstance();
                return cc.convert(value, context);
            } catch(InstantiationException x) {
                throw new MisconfigurationException("The contextual converter "+getContextualConverter()+" must have a zero argument constructor");
            }
        }
    };
View Full Code Here

     AbstractApplicationContext createApplicationContext(CentipedeShellOptions centipedeOptions, List<String> contextPath) {
        contextPath.addAll(centipedeOptions.applicationContext);
        contextPath.addAll(centipedeOptions.applicationContext);

        if(centipedeOptions.eager && centipedeOptions.lazy)
            throw new MisconfigurationException("Cannot force eager and lazy load at same time");

        Boolean forcedMode =
                centipedeOptions.lazy ? Boolean.TRUE :
                        (centipedeOptions.eager ? Boolean.FALSE : isLazyByDefault());
View Full Code Here

    protected abstract void _run(String[] arguments) throws Exception;

    protected void die(String message) {
        System.err.println(message);
        throw new ShutTheProcessDown();
    }
View Full Code Here

        assertEquals(Long.class, blowup.getTargetType());
    }

    @Test
    public void unparsableDefaultFailsAppropriately() throws IllegalAccessException {
        UnparsableDefaultException blowup = null;
        try {
            invalidDefault.parse(
                    new ArrayList<String>()
            );
        } catch (UnparsableDefaultException x) {
            blowup = x;
        }

        assertNotNull(blowup);
        assertEquals("burn", blowup.getOptionName());
        assertEquals("i am the king of hellfire", blowup.getInvalidValue());
        assertEquals(Integer.TYPE, blowup.getTargetType());
    }
View Full Code Here

    }


    @Test
    public void unparsableOptionFailsAppropriately() throws IllegalAccessException {
        UnparsableOptionException blowup = null;
        try {
            InheritedOptionExample ioe = (InheritedOptionExample) exampleOne.parse(
                    new ArrayList<String>() {{
                        add("-johnny");
                        add("-badass");
                        add("421");
                    }}
            );
        } catch (UnparsableOptionException x) {
            blowup = x;
        }

        assertNotNull(blowup);
        assertEquals("johnny", blowup.getOptionName());
        assertEquals("-badass", blowup.getInvalidValue());
        assertEquals(Long.class, blowup.getTargetType());
    }
View Full Code Here

        OptionParser parser=new OptionParser(ExtractIsAOptions.class);
        applicationContext.getAutowireCapableBeanFactory().autowireBean(parser);

        ExtractIsAOptions options=(ExtractIsAOptions) parser.parse(Lists.newArrayList(strings));
        if (options.input.isEmpty())
            throw new UsageException("You did not specify a value for -input");

        if (options.output==null || options.output.isEmpty())
            throw new UsageException("You did not specify a value for -output");

        if (options.type.isEmpty())
            throw new UsageException("You did not specify a value for -type");

        if(options.reducerCount<1) {
            options.reducerCount=1;
        }
        return options;
View Full Code Here

TOP

Related Classes of com.ontology2.haruhi.flows.SpringStepTest

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.