Examples of TestContext


Examples of io.reactivex.netty.contexts.TestContext

                    }
                };
                ContextsContainer container = new ContextsContainerImpl(supplier);
                try {
                    String ctx1 = container.getContext(CTX_1_NAME);
                    TestContext ctx2 = container.getContext(CTX_2_NAME);
                    if (null != ctx1 && null != ctx2 && ctx1.equals(CTX_1_VAL) && ctx2.equals(CTX_2_VAL)) {
                        return response.writeStringAndFlush("Welcome!");
                    } else {
                        response.setStatus(HttpResponseStatus.BAD_REQUEST);
                        return response.writeStringAndFlush("Contexts not found or have wrong values.");
                    }
View Full Code Here

Examples of javax.el.TestContext

    context.putContext(Integer.class, "foo");
    assertEquals("foo", context.getContext(Integer.class));
  }

  public void testLocale() {
    ELContext context = new TestContext();
    assertNull(context.getLocale());
    context.setLocale(Locale.ENGLISH);
    assertEquals(Locale.ENGLISH, context.getLocale());
  }
View Full Code Here

Examples of mondrian.test.TestContext

    public CurrentDateMemberUdfTest(String name) {
        super(name);
    }

    public void testCurrentDateMemberUdf() {
        TestContext context = TestContext.instance().create(
            null,
            null,
            null,
            null,
            "<UserDefinedFunction name=\"MockCurrentDateMember\" "
            + "className=\"mondrian.udf.MockCurrentDateMember\" /> ",
            null);
        context.assertQueryReturns(
            "SELECT NON EMPTY {[Measures].[Org Salary]} ON COLUMNS, "
            + "NON EMPTY {MockCurrentDateMember([Time].[Time], \"[yyyy]\")} ON ROWS "
            + "FROM [HR] ",
            "Axis #0:\n"
            + "{}\n"
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    @BeforeClass
    public void setup() throws Exception {
        Map<String, String> overlay = new HashMap<String, String>();
        overlay.put("cluster", "testCluster");
        TestContext context = new TestContext();
        String file = context.
                overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
        testCluster = StandAloneCluster.newCluster(file);
        STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
/*
        new File("target/libs").mkdirs();
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    @BeforeClass
    public void setup() throws Exception {
        Map<String, String> overlay = new HashMap<String, String>();
        overlay.put("cluster", "logProviderTest");
        overlay.put("colo", "gs");
        TestContext context = new TestContext();
        String file = context.
                overlayParametersOverTemplate(context.CLUSTER_TEMPLATE, overlay);
        testCluster = StandAloneCluster.newCluster(file);
        cleanupStore();
        STORE.publish(EntityType.CLUSTER, testCluster.getCluster());
        fs = FileSystem.get(testCluster.getConf());
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    public void testSubmitEntityValidCommands() throws Exception {

        FalconCLI.OUT.set(stream);

        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(TestContext.CLUSTER_TEMPLATE, overlay);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type cluster -file " + filePath));
        context.setCluster(filePath);
        Assert.assertEquals(stream.buffer.toString().trim(),
                "default/Submit successful (cluster) " + context.getClusterName());

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
                "default/Submit successful (feed) "
                        + overlay.get("inputFeedName"));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
                "default/Submit successful (feed) "
                        + overlay.get("outputFeedName"));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type process -file " + filePath));
        Assert.assertEquals(
                stream.buffer.toString().trim(),
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    @Test(enabled = TEST_ENABLED)
    public void testSubmitAndScheduleEntityValidCommands() throws Exception {

        Thread.sleep(5000);
        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
        Assert.assertEquals(-1,
                executeWithURL("entity -submitAndSchedule -type cluster -file "
                        + filePath));
        context.setCluster(filePath);

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type feed -file "
                        + filePath));
        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type feed -file "
                        + filePath));
        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -submitAndSchedule -type process -file "
                        + filePath));

        Thread.sleep(5000);
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    @Test(enabled = TEST_ENABLED)
    public void testValidateValidCommands() throws Exception {

        String filePath;
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();

        filePath = context.overlayParametersOverTemplate(context.getClusterFileTemplate(), overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type cluster -file "
                        + filePath));
        context.setCluster(filePath);
        Assert.assertEquals(
                0,
                executeWithURL("entity -submit -type cluster -file " + filePath));
        context.setCluster(filePath);

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE1, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type feed -file " + filePath));
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.FEED_TEMPLATE2, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type feed -file " + filePath));
        Assert.assertEquals(0,
                executeWithURL("entity -submit -type feed -file " + filePath));

        filePath = context.overlayParametersOverTemplate(TestContext.PROCESS_TEMPLATE, overlay);
        Assert.assertEquals(0,
                executeWithURL("entity -validate -type process -file "
                        + filePath));
        Assert.assertEquals(
                0,
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    }

    @Test(enabled = TEST_ENABLED)
    public void testDefinitionEntityValidCommands() throws Exception {
        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(0,
                executeWithURL("entity -definition -type cluster -name "
                        + overlay.get("cluster")));
View Full Code Here

Examples of org.apache.falcon.resource.TestContext

    }

    @Test(enabled = TEST_ENABLED)
    public void testScheduleEntityValidCommands() throws Exception {

        TestContext context = new TestContext();
        Map<String, String> overlay = context.getUniqueOverlay();
        submitTestFiles(context, overlay);

        Assert.assertEquals(-1,
                executeWithURL("entity -schedule -type cluster -name "
                        + overlay.get("cluster")));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.