Package org.wso2.carbon.integration.core.utils

Examples of org.wso2.carbon.integration.core.utils.StockQuoteClient


    }

    @Override
    public void runSuccessCase() {
        log.debug("Running SuccessCase ");
        StockQuoteClient stockQuoteClient = new StockQuoteClient();
        OMElement result = null;
        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();

            OMElement omElement = artifactReader.getOMElement(CloneMediatorTest.class.getResource("/clone.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
            } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            log.info(result);
            System.out.println(result);
            Thread.sleep(2000);
            assert result != null;
View Full Code Here


    @Override
    public void runSuccessCase() {
        log.debug("Running Fault Mediator SOAP12 SuccessCase ");
        OMElement result = null;

        StockQuoteClient stockQuoteClient = new StockQuoteClient();

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();
            OMElement omElement = artifactReader.getOMElement(Soap12ValReasonTest.class.getResource("/soap12_val_reason.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
            } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            log.info(result);
            System.out.println(result);

            assert result != null;
View Full Code Here

    }

    @Override
    public void runSuccessCase() {
        log.debug("Running HeaderProtocol11 with POST SuccessCase ");
        StockQuoteClient stockQuoteClient = new StockQuoteClient();

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();

            OMElement omElement = artifactReader.getOMElement(HeaderProtocol_11Test.class.getResource("/with_content_type_post.xml").getPath());

            configServiceAdminStub.updateConfiguration(omElement);

            String trpUrl = "http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT;
            OMElement result = stockQuoteClient.stockQuoteClientforProxy(trpUrl, null, "IBM");
            log.info(result);
            System.out.println(result);

            // Test for HeaderProtocol 11 with POST request
View Full Code Here

            OMElement omElement = artifactReader.getOMElement(ThrottleOnAccpetSeqKeyTest.class.getResource("/throttleOnAcceptSeqKey.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            /*Sending StockQuoteClient requests */
            for (int i = 0; i <= THROTTLE_MAX_MSG_COUNT; i++) {
                StockQuoteClient stockQuoteClient = new StockQuoteClient();
                if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                    result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
                } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                    result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
                }
                System.out.println(result);
                if (!result.toString().contains("IBM")) {
                    log.error("Required response not found");
                    Assert.fail("Required response not found");
View Full Code Here


    @Override
    public void runSuccessCase() {
        log.debug("Running SuccessCase ");
        StockQuoteClient stockQuoteClient = new StockQuoteClient();
        OMElement result = null;

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();
            OMElement omElement = artifactReader.getOMElement(SpringMediatorTest.class.getResource("/SpringTestConfig.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
            } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            assert result != null;
            if (!result.toString().contains("MSFT")) {
                log.error("Spring Mediator does not work");
                Assert.fail("Spring Mediator does not work");
View Full Code Here

    @Override
    public void runSuccessCase() {
        log.debug("Running SuccessCase ");
        OMElement result = null;
        boolean isFound = false;
        StockQuoteClient stockQuoteClient = new StockQuoteClient();

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            LogViewerStub logViewerStub = new LogViewerStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/LogViewer");
            authenticateStub.authenticateAdminStub(logViewerStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();

            OMElement omElement = artifactReader.getOMElement(CmdWithPropertyTest.class.getResource("/CmdWithProp.xml").getPath());

            configServiceAdminStub.updateConfiguration(omElement);

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
            }
            if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            GetLogsResponse getLogsResponse = new GetLogsResponse();
            GetLogs getLogs = new GetLogs();
            getLogs.setKeyword("mediator");
            getLogsResponse = logViewerStub.getLogs(getLogs);
View Full Code Here

    @Override
    public void runSuccessCase() {
        log.debug("Running Fault Mediator SOAP12 SuccessCase ");
        OMElement result = null;

        StockQuoteClient stockQuoteClient = new StockQuoteClient();

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();
            OMElement omElement = artifactReader.getOMElement(Soap12RoleTest.class.getResource("/soap12_role.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
            } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            log.info(result);
            System.out.println(result);

            assert result != null;
View Full Code Here

            OMElement omElement = artifactReader.getOMElement(ThrottleOnAccpetSeqInlineTest.class.getResource("/throttleOnAcceptSeqKey.xml").getPath());
            configServiceAdminStub.updateConfiguration(omElement);

            /*Sending StockQuoteClient requests */
            for (int i = 0; i <= THROTTLE_MAX_MSG_COUNT; i++) {
                StockQuoteClient stockQuoteClient = new StockQuoteClient();
                if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                    result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
                } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                    result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
                }
                System.out.println(result);
                if (!result.toString().contains("IBM")) {
                    log.error("Required response not found");
                    Assert.fail("Required response not found");
View Full Code Here

    }

    @Override
    public void runSuccessCase() {
        log.debug("Running Chunk Enabled SuccessCase ");
        StockQuoteClient stockQuoteClient = new StockQuoteClient();
        OMElement result = null;

        try {
            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();

            OMElement omElement = artifactReader.getOMElement(ChunkEnabledTest.class.getResource("/chunking_enabled.xml").getPath());

            configServiceAdminStub.updateConfiguration(omElement);

            String trpUrl = null;

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                trpUrl = "http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT;
                result = stockQuoteClient.stockQuoteClientforProxy(trpUrl, null, "IBM");
            } else if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                result = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }
            log.info(result);
            System.out.println(result);
            //<ns:getQuoteResponse xmlns:ns="http://services.samples"><ns:return xmlns:ax21="http://services.samples/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:GetQuoteResponse"><ax21:change>4.488382103511101</ax21:change><ax21:earnings>-8.983387861433535</ax21:earnings><ax21:high>-54.85240340206867</ax21:high><ax21:last>55.185600908158364</ax21:last><ax21:lastTradeTimestamp>Tue Oct 19 11:18:43 IST 2010</ax21:lastTradeTimestamp><ax21:low>-54.739935633390765</ax21:low><ax21:marketCap>1.4210456725425582E7</ax21:marketCap><ax21:name>IBM Company</ax21:name><ax21:open>57.531671038463294</ax21:open><ax21:peRatio>23.993007092941014</ax21:peRatio><ax21:percentageChange>7.542848922991673</ax21:percentageChange><ax21:prevClose>59.50513061225283</ax21:prevClose><ax21:symbol>IBM</ax21:symbol><ax21:volume>15739</ax21:volume></ns:return></ns:getQuoteResponse>
View Full Code Here


    @Override
    public void runSuccessCase() {
        log.debug("Running SuccessCase ");
        StockQuoteClient stockQuoteClient = new StockQuoteClient();
        OMElement omElement, firstResult = null, cacheResult = null, timeoutResult = null;

        try {

            AuthenticateStub authenticateStub = new AuthenticateStub();
            ConfigServiceAdminStub configServiceAdminStub = new ConfigServiceAdminStub("https://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTPS_PORT + "/services/ConfigServiceAdmin");
            authenticateStub.authenticateAdminStub(configServiceAdminStub, sessionCookie);
            ArtifactReader artifactReader = new ArtifactReader();

            omElement = artifactReader.getOMElement(WithoutCacheIDTest.class.getResource("/WithoutCacheID.xml").getPath());

            configServiceAdminStub.updateConfiguration(omElement);
            log.debug("With Cache ID synapse xml uploaded ");

            if (FrameworkSettings.STRATOS.equalsIgnoreCase("false")) {
                firstResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
                System.out.println("First Result: " + firstResult);
                Thread.sleep(2000);
                cacheResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
                System.out.println("Cache Result: " + cacheResult);
                Thread.sleep(6000);
                timeoutResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT, null, "IBM");
                System.out.println("Timeout Result: " + timeoutResult);
            }
            if (FrameworkSettings.STRATOS.equalsIgnoreCase("true")) {
                firstResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
                Thread.sleep(2000);
                cacheResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
                Thread.sleep(6000);
                timeoutResult = stockQuoteClient.stockQuoteClientforProxy("http://" + FrameworkSettings.HOST_NAME + ":" + FrameworkSettings.HTTP_PORT + "/services/" + FrameworkSettings.TENANT_NAME + "/", null, "IBM");
            }


            if (firstResult.toString().equals(cacheResult.toString())) {
                if (cacheResult.toString().equals(timeoutResult.toString())) {
View Full Code Here

TOP

Related Classes of org.wso2.carbon.integration.core.utils.StockQuoteClient

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.