Package com.asakusafw.testdriver.core

Examples of com.asakusafw.testdriver.core.TestToolRepository


     * Load from SPI.
     * @throws Exception if failed
     */
    @Test
    public void spi() throws Exception {
        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.xls");
        file.delete();

        DataModelSinkFactory factory = repo.getDataModelSinkFactory(file.toURI());
        DataModelSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
        try {
            Simple model = new Simple();
            model.text = "expected";
            sink.put(SIMPLE.toReflection(model));
View Full Code Here


     * Attempt to load from SPI, but its extension is wrong.
     * @throws Exception if failed
     */
    @Test
    public void spi_wrong_extension() throws Exception {
        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.INVALID");
        file.delete();

        DataModelSinkFactory factory = repo.getDataModelSinkFactory(file.toURI());
        try {
            DataModelSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
            sink.close();
            fail();
        } catch (IOException e) {
View Full Code Here

     * Load the provider via SPI.
     * @throws Exception if failed
     */
    @Test
    public void spi() throws Exception {
        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.html");
        file.delete();

        DifferenceSinkFactory factory = repo.getDifferenceSinkFactory(file.toURI());
        DifferenceSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
        try {
            Simple expected = new Simple();
            expected.text = "expected";
            Simple actual = new Simple();
View Full Code Here

     * Attempt to load the provider via SPI, but its extension is wrong.
     * @throws Exception if failed
     */
    @Test
    public void spi_wrong_extension() throws Exception {
        TestToolRepository repo = new TestToolRepository(getClass().getClassLoader());

        File file = temp.newFile("example.invalid");
        file.delete();

        DifferenceSinkFactory factory = repo.getDifferenceSinkFactory(file.toURI());
        try {
            DifferenceSink sink = factory.createSink(SIMPLE, new TestContext.Empty());
            sink.close();
            fail();
        } catch (IOException e) {
View Full Code Here

    public TestDriverContext(Class<?> contextClass) {
        if (contextClass == null) {
            throw new IllegalArgumentException("contextClass must not be null"); //$NON-NLS-1$
        }
        this.callerClass = contextClass;
        this.repository = new TestToolRepository(contextClass.getClassLoader());
        this.extraConfigurations = new TreeMap<String, String>();
        this.batchArgs = new TreeMap<String, String>();
        this.environmentVariables = new HashMap<String, String>(System.getenv());
        this.options = new FlowCompilerOptions();
        configureOptions();
View Full Code Here

TOP

Related Classes of com.asakusafw.testdriver.core.TestToolRepository

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.