org.wso2.carbon.integration.common.admin.client.LogViewerClient Java Examples
The following examples show how to use
org.wso2.carbon.integration.common.admin.client.LogViewerClient.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ESBJAVA2824MissingResponseTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = { "wso2.esb" }, description = "Test Sending message to a jms endpoint and check for response") public void testJmsResponse() throws Exception { try { axis2Client.sendSimpleStockQuoteRequest(getMainSequenceURL(), null, "IBM"); } catch (AxisFault fault) { String errMsg=fault.getMessage(); Assert.assertEquals(errMsg,"Send timeout", "JMS Client did not receive Send timeout"); LogViewerClient cli = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); LogEvent[] logs = cli.getAllRemoteSystemLogs(); Assert.assertNotNull(logs, "No logs found"); Assert.assertTrue(logs.length > 0, "No logs found"); boolean errorMsgTrue = Utils.checkForLogsWithPriority(cli,"ERROR", logLine0, 10); Assert.assertTrue(errorMsgTrue, "Axis Fault Did not receive"); } }
Example #2
Source File: ProxyServiceEndPointThroughURLTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", description = "Proxy service with providing endpoint through url") public void testLoggingProxy() throws Exception { OMElement response = axis2Client.sendSimpleStockQuoteRequest(getProxyServiceURLHttp("StockQuoteLoggingProxy"), null, "WSO2"); String lastPrice = response.getFirstElement(). getFirstChildWithName(new QName("http://services.samples/xsd", "last")).getText(); assertNotNull(lastPrice, "Fault: response message 'last' price null"); String symbol = response.getFirstElement(). getFirstChildWithName(new QName("http://services.samples/xsd", "symbol")).getText(); assertEquals(symbol, "WSO2", "Fault: value 'symbol' mismatched"); LogViewerClient logViewerClient = new LogViewerClient(context.getContextUrls().getBackEndUrl(), getSessionCookie()); assertNotNull(Utils.checkForLogsWithPriority(logViewerClient, "INFO", "getQuote", 30), "Request INFO log entry not found"); assertNotNull(Utils.checkForLogsWithPriority(logViewerClient, "INFO", "<ns:symbol>WSO2</ns:symbol>", 30), "Request INFO log entry not found"); assertNotNull(Utils.checkForLogsWithPriority(logViewerClient, "INFO", "ns:getQuoteResponse", 30), "Request INFO log entry not found"); }
Example #3
Source File: StoreAndForwardWithEmptyMessageBodyTesCase.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass public void init() throws Exception { super.init(); AutomationContext automationContext = new AutomationContext(); DB_PASSWORD = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_DB_PASSWORD); JDBC_URL = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_URL); DB_USER = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_DB_USER_NAME); String databaseName = System.getProperty("basedir") + File.separator + "target" + File.separator + "testdb_store" + new Random().nextInt(); JDBC_URL = JDBC_URL + databaseName + ";DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE"; h2DatabaseManager = new H2DataBaseManager(JDBC_URL, DB_USER, DB_PASSWORD); h2DatabaseManager.executeUpdate("CREATE TABLE IF NOT EXISTS JDBC_MESSAGE_STORE(\n" + "indexId BIGINT(20) NOT NULL AUTO_INCREMENT,\n" + "msg_id VARCHAR(200) NOT NULL ,\n" + "message BLOB NOT NULL,\n" + "PRIMARY KEY ( indexId )\n" + ")"); logViewer = new LogViewerClient(context.getContextUrls().getBackEndUrl(), sessionCookie); super.init(); }
Example #4
Source File: Utils.java From product-ei with Apache License 2.0 | 6 votes |
/** * Check whether a log found with expected string of given priority * * @param logViewerClient LogViewerClient object * @param priority priority level * @param expected expected string * @return true if a log found with expected string of given priority, false otherwise * @throws RemoteException */ private static boolean assertIfLogExistsWithGivenPriority(LogViewerClient logViewerClient, String priority, String expected) throws RemoteException { LogEvent[] systemLogs; systemLogs = logViewerClient.getAllRemoteSystemLogs(); boolean matchFound = false; if (systemLogs != null) { for (LogEvent logEvent : systemLogs) { if (logEvent == null) { continue; } if (logEvent.getPriority().equals(priority) && logEvent.getMessage().contains(expected)) { matchFound = true; break; } } } return matchFound; }
Example #5
Source File: Utils.java From product-ei with Apache License 2.0 | 6 votes |
/** * Get set of logs with expected string and given priority * * @param logViewerClient LogViewerClient object * @param priority priority level * @param expected expected string * @return set of logs with expected string and given priority * @throws RemoteException */ public static ArrayList<LogEvent> getLogsWithExpectedValue(LogViewerClient logViewerClient, String priority, String expected) throws RemoteException { LogEvent[] allLogs; allLogs = logViewerClient.getAllRemoteSystemLogs(); ArrayList<LogEvent> systemLogs = new ArrayList<>(); int i = 0; if (allLogs != null) { for (LogEvent logEvent : allLogs) { if (logEvent == null) { continue; } if (logEvent.getPriority().equals(priority) && logEvent.getMessage().contains(expected)) { systemLogs.add(logEvent); } } } return systemLogs; }
Example #6
Source File: InboundEPWithNonWorkerManager.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { super.init(); serverConfigurationManager = new ServerConfigurationManager(new AutomationContext("ESB", TestUserMode.SUPER_TENANT_ADMIN)); serverConfigurationManager.applyConfigurationWithoutRestart(new File(FULL_RESOURCE_PATH + "axis2.xml")); serverConfigurationManager.copyToComponentLib (new File(getClass().getResource(JAR_LOCATION + File.separator + HAWTBUF).toURI())); serverConfigurationManager.copyToComponentLib (new File(getClass().getResource(JAR_LOCATION + File.separator + ACTIVEMQ_BROKER).toURI())); serverConfigurationManager.copyToComponentLib (new File(getClass().getResource(JAR_LOCATION + File.separator + ACTIVEMQ_CLIENT).toURI())); serverConfigurationManager.copyToComponentLib (new File(getClass().getResource(JAR_LOCATION + File.separator + GERONIMO_J2EE_MANAGEMENT).toURI())); serverConfigurationManager.copyToComponentLib (new File(getClass().getResource(JAR_LOCATION + File.separator + GERONIMO_JMS).toURI())); serverConfigurationManager.restartGracefully(); super.init(); addInboundEndpoint(esbUtils.loadResource(RELATIVE_RESOURCE_PATH + "JMSEndpoint.xml")); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #7
Source File: FaviconTest.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = {"wso2.esb"}, description = "Test for ClosedChannel Exception") public void faviconTest() throws Exception { HttpsResponse response = HttpsURLConnectionClient. getRequest("https://localhost:8443/" + "favicon.ico", null); Assert.assertEquals(response.getResponseCode(), 301, "Response code mismatch"); LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); LogEvent[] logs = logViewerClient.getAllRemoteSystemLogs(); boolean exceptionFound = false; for (LogEvent item : logs) { String message = item.getMessage(); if (message.contains("ClosedChannelException")) { exceptionFound = true; break; } } Assert.assertTrue(!exceptionFound, "ClosedChannelException occurred while retrieving favicon.ico"); }
Example #8
Source File: TaskWithLargeIntervalValueTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = {"wso2.esb"}, description = "Test successful deployment of scheduled task with large interval value") public void testDeployWithLargeIntervalValue() throws Exception { OMElement task = AXIOMUtil.stringToOM("<task:task xmlns:task=\"http://www.wso2.org/products/wso2commons/tasks\"\n" + " name=\"ESBJAVA5234TestTask\"\n" + " class=\"org.apache.synapse.startup.tasks.MessageInjector\" group=\"synapse.simple.quartz\">\n" + " <task:trigger count=\"1\" interval=\"25920000\"/>\n" + " <task:property name=\"message\">\n" + " <m0:placeOrder xmlns:m0=\"http://services.samples\">\n" + " <m0:order>\n" + " <m0:price>100</m0:price>\n" + " <m0:quantity>200</m0:quantity>\n" + " <m0:symbol>IBM</m0:symbol>\n" + " </m0:order>\n" + " </m0:placeOrder>\n" + " </task:property>\n" + "</task:task>"); addScheduledTask(task); LogViewerClient logViewerClient = new LogViewerClient(context.getContextUrls().getBackEndUrl(), getSessionCookie()); boolean assertValue = Utils.checkForLog(logViewerClient, "ESBJAVA5234TestTask was added to the Synapse configuration successfully", 5); assertTrue(assertValue, "Scheduled task with large interval value has not deployed."); }
Example #9
Source File: SynapseArtifactsHotDeploymentTestCase.java From product-ei with Apache License 2.0 | 6 votes |
private boolean searchInLogs(LogViewerClient logViewerClient, String searchString) throws RemoteException, InterruptedException { boolean logFound = false; for (int i = 0; i < 60; i++) { LogEvent[] logEvents = logViewerClient.getAllRemoteSystemLogs(); if (logEvents != null) { for (LogEvent logEvent : logEvents) { if (logEvent == null) { continue; } if (logEvent.getMessage().contains(searchString)) { logFound = true; break; } } } if (logFound) { break; } Thread.sleep(500); } return logFound; }
Example #10
Source File: EagerLoadingTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass(alwaysRun = true) protected void startServerWithEagerLoading() throws Exception { super.init(TestUserMode.SUPER_TENANT_USER); serverManager = new ServerConfigurationManager(context); AutomationContext autoContext = new AutomationContext(); // upload a faulty sequence which refer registry resource doesn't exists FileUtils.copyFileToDirectory(new File(FrameworkPathUtil.getSystemResourceLocation() + "/artifacts/ESB/eager/loading/ESBJAVA3602-FaultySeq.xml"), getSynapseDeploymentDir()); File carbonXml = new File(FrameworkPathUtil.getSystemResourceLocation() + "/artifacts/ESB/eager/loading/ESBJAVA3602Carbon.xml"); serverManager.applyConfiguration(carbonXml, getCarbonXmlFile()); super.init(TestUserMode.TENANT_ADMIN); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #11
Source File: JDBCMessageStoreProcRESTTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass(alwaysRun = true) protected void init() throws Exception { super.init(); AutomationContext automationContext = new AutomationContext(); DATASOURCE_NAME = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_NAME); DB_PASSWORD = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_DB_PASSWORD); JDBC_URL = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_URL); DB_USER = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_DB_USER_NAME); JDBC_DRIVER = automationContext.getConfigurationValue(XPathConstants.DATA_SOURCE_DRIVER_CLASS_NAME); serverConfigurationManager = new ServerConfigurationManager(context); copyJDBCDriverToClassPath(); mySqlDatabaseManager = new MySqlDatabaseManager(JDBC_URL, DB_USER, DB_PASSWORD); mySqlDatabaseManager.executeUpdate("DROP DATABASE IF EXISTS WSO2SampleDBForAutomation"); super.init(); headers.put("Test-Header-Field", "TestHeaderValue"); logViewer = new LogViewerClient(contextUrls.getBackEndUrl(),getSessionCookie()); }
Example #12
Source File: JmsToBackendWithInboundEndpointTestCase.java From product-ei with Apache License 2.0 | 6 votes |
/** * Test whether consuming message from a queue and sending to a backend works (i.e. JMS -> HTTP) * * @throws Exception if any error occurred while running tests */ @SetEnvironment(executionEnvironments = {ExecutionEnvironment.STANDALONE}) @Test(groups = {"wso2.esb"}, description = "Test JMS to HTTP communication with inbound endpoint") public void testJmsQueueToHttpWithInboundEndpoint() throws Exception { LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); logViewerClient.clearLogs(); //send a message to the queue sendMessage(); //check for the log boolean assertValue = Utils.assertIfSystemLogContains(logViewerClient, "** testJmsQueueToHttpWithInboundEndpoint RESPONSE **"); Assert.assertTrue(assertValue, "HTTP backend response did not receive with the inbound endpoint."); }
Example #13
Source File: RabbitMQReceiverConnectionRecoveryFailureTestCase.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass(alwaysRun = true) public void init() throws Exception { super.init(); rabbitMQServer = RabbitMQTestUtils.getRabbitMQServerInstance(); sender = new RabbitMQProducerClient("localhost", 5672, "guest", "guest"); consumer = new RabbitMQConsumerClient("localhost"); configurationManagerAxis2 = new ServerConfigurationManager(new AutomationContext("ESB", TestUserMode.SUPER_TENANT_ADMIN)); File customAxisConfigAxis2 = new File(getESBResourceLocation() + File.separator + "axis2config" + File.separator + "axis2.xml"); configurationManagerAxis2.applyConfiguration(customAxisConfigAxis2); super.init(); logViewer = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); loadESBConfigurationFromClasspath("/artifacts/ESB/rabbitmq/transport/rabbitmq_consumer_proxy.xml"); }
Example #14
Source File: ESBJAVA4569RabbiMQSSLStoreWithClientCertValidationTest.java From product-ei with Apache License 2.0 | 6 votes |
@BeforeClass(alwaysRun = true) protected void init() throws Exception { super.init(); rabbitMQServer = RabbitMQTestUtils.getRabbitMQServerInstance(); rabbitMQServer.stop(); modifyAndAddRabbitMQConfigs(); rabbitMQServer.start(); headers.put("Test-Header-Field", "TestHeaderValue"); modifyAndUpdateSynapseConfigs(); logViewer = new LogViewerClient(contextUrls.getBackEndUrl(),getSessionCookie()); url = getApiInvocationURL("rabbitMQRestWithClientCert") + "/store"; }
Example #15
Source File: ESBJAVA3714JMXPauseJMSListener.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", description = "JMS Consumer Test after pause") public void testJMSPause() throws Exception { // pause JMS Listener from JMXClient Set<ObjectInstance> objSet = mbsc.queryMBeans(new ObjectName("org.apache.axis2:Type=Transport,ConnectorName=jms-listener-*"), null); Iterator i = objSet.iterator(); while (i.hasNext()) { ObjectInstance obj = (ObjectInstance) i.next(); mbsc.invoke(obj.getObjectName(), "pause" , null, null); } LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); assertTrue(Utils.checkForLogsWithPriority(logViewerClient, "INFO", "Listener paused", 10)); // Put message in queue. sendMessage(msgAfter); assertFalse(Utils.checkForLogsWithPriority(logViewerClient, "INFO", msgAfter, 10)); }
Example #16
Source File: ESBJAVA4565TestCase.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", description = "Analyze carbon logs to find NPE due to unresolved tenant domain.") public void checkErrorLog() throws Exception { LogViewerClient cli = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); LogEvent[] logs = cli.getAllRemoteSystemLogs(); Assert.assertNotNull(logs, "No logs found"); Assert.assertTrue(logs.length > 0, "No logs found"); boolean hasErrorLog = false; for (LogEvent logEvent : logs) { String msg = logEvent.getMessage(); if (msg.contains("java.lang.NullPointerException: Tenant domain has not been set in CarbonContext")) { hasErrorLog = true; break; } } Assert.assertFalse(hasErrorLog, "Tenant domain not resolved when registry resource is accessed inside " + "a scheduled task"); }
Example #17
Source File: MSMPCronForwarderCase.java From product-ei with Apache License 2.0 | 6 votes |
private Callable<Boolean> isLogWritten() { return new Callable<Boolean>() { @Override public Boolean call() throws Exception { LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); LogEvent[] logEvents = logViewerClient.getAllRemoteSystemLogs(); boolean success = false; int msgCount = 0; for (int i = 0; i < logEvents.length; i++) { if (logEvents[i].getMessage().contains("Jack")) { msgCount = ++msgCount; if (NUMBER_OF_MESSAGES == msgCount) { success = true; break; } } } return success; } }; }
Example #18
Source File: Sample364TestCase.java From product-ei with Apache License 2.0 | 6 votes |
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.PLATFORM }) @Test(groups = {"wso2.esb"}, description = "testDBMediator ") public void testDBMediator() throws Exception { LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); logViewerClient.clearLogs(); AxisServiceClient client = new AxisServiceClient(); client.sendRobust(Utils.getStockQuoteRequest("IBM") , getMainSequenceURL(), "getQuote"); LogEvent[] getLogsInfo = logViewerClient.getAllRemoteSystemLogs(); boolean assertValue = false; for (LogEvent event : getLogsInfo) { if (event.getMessage().contains("Stock Prize")) { assertValue = true; break; } } Assert.assertTrue(assertValue, "db lookup failed"); }
Example #19
Source File: ESBJAVA3714JMXPauseJMSListener.java From product-ei with Apache License 2.0 | 6 votes |
@Test(groups = "wso2.esb", description = "JMS Consumer Test after resume", enabled = false) public void testJMSResume() throws Exception { // redeploy proxy service addProxyService(AXIOMUtil.stringToOM(getJMSProxy())); LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); // JMS should still be paused. assertFalse(Utils.checkForLogsWithPriority(logViewerClient, "INFO", msgAfter, 16)); // resume JMS Listener from JMXClient Set<ObjectInstance> objSet = mbsc.queryMBeans(new ObjectName("org.apache.axis2:Type=Transport,ConnectorName=jms-listener-*"), null); Iterator i = objSet.iterator(); while (i.hasNext()) { ObjectInstance obj = (ObjectInstance) i.next(); mbsc.invoke(obj.getObjectName(), "resume" , null, null); } assertTrue(Utils.checkForLogsWithPriority(logViewerClient, "INFO", "Listener resumed", 10)); assertTrue(Utils.checkForLogsWithPriority(logViewerClient, "INFO", msgAfter, 10)); }
Example #20
Source File: CalloutJMSHeadersTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@Test(groups = { "wso2.esb" }, description = "Callout JMS headers test case") public void testCalloutJMSHeaders() throws Exception { LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); logViewerClient.clearLogs(); AxisServiceClient client = new AxisServiceClient(); String payload = "<payload/>"; AXIOMUtil.stringToOM(payload); client.sendRobust(AXIOMUtil.stringToOM(payload), getProxyServiceURLHttp("JMCalloutClientProxy"), "urn:mediate"); long startTime = System.currentTimeMillis(); boolean logFound = false; while (!logFound && (startTime + 60000 > System.currentTimeMillis())) { Thread.sleep(1000); LogEvent[] logs = logViewerClient.getAllRemoteSystemLogs(); if(logs == null) { continue; } for (LogEvent item : logs) { if(item == null) { continue; } else if (item.getPriority().equals("INFO")) { String message = item.getMessage(); if (message.contains("RequestHeaderVal")) { logFound = true; break; } } } } assertTrue(logFound, "Required log entry not found"); }
Example #21
Source File: FailoverForwardingProcessorTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { activeMQServer.startJMSBroker(); super.init(); loadESBConfigurationFromClasspath("/artifacts/ESB/synapseconfig/failover/failoverTest.xml"); logViewer = new LogViewerClient(context.getContextUrls().getBackEndUrl(), sessionCookie); }
Example #22
Source File: ESBJAVA4470StoreMediatorEmptyOMArraySerializeException.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) protected void init() throws Exception { super.init(); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); uploadCapp(carFileName , new DataHandler(new FileDataSource(new File(getESBResourceLocation() + File.separator + "car" + File.separator + carFileName)))); TimeUnit.SECONDS.sleep(30); log.info(carFileName + " uploaded successfully"); }
Example #23
Source File: ESBJAVA4540PinnedServerParameterTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@Test(groups = "wso2.esb", description = "Editing a proxy service when the pinnedServer is having" + " another instance name") public void modifyProxyService() throws Exception { ProxyServiceAdminClient proxyAdmin = new ProxyServiceAdminClient(contextUrls.getBackEndUrl() , getSessionCookie()); ProxyData proxyData = proxyAdmin.getProxyDetails(proxyServiceNameEditProxy); proxyData.setPinnedServers(new String[] {"invalidPinnedServer"}); LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); logViewerClient.clearLogs(); proxyAdmin.updateProxy(proxyData); LogEvent[] logEvents = logViewerClient.getAllRemoteSystemLogs(); boolean isLogMessageFound = false; for (LogEvent log : logEvents) { if (log != null && log.getMessage().contains("not in pinned servers list. Not deploying " + "Proxy service : EditProxyWithPinnedServer")) { isLogMessageFound = true; break; } } Assert.assertTrue(isLogMessageFound, "Log message not found in the console log"); //proxy service should not be deployed since the pinnedServer does not contain this server name Assert.assertFalse(esbUtils.isProxyDeployed(contextUrls.getBackEndUrl(), getSessionCookie() , proxyServiceName), "Proxy service deployed successfully"); }
Example #24
Source File: PassthroughTransportHttpProxyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { super.init(); serverConfigurationManager = new ServerConfigurationManager(new AutomationContext("ESB", TestUserMode.SUPER_TENANT_ADMIN)); serverConfigurationManager.applyConfiguration(new File(getESBResourceLocation() + File.separator + "passthru" + File.separator + "transport" + File.separator + "httpproxy" + File.separator + "axis2.xml")); super.init(); loadESBConfigurationFromClasspath("/artifacts/ESB/passthru/transport/httpproxy/httpProxy.xml"); logViewer = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #25
Source File: EnrichAddCustomHeaderTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { super.init(); loadESBConfigurationFromClasspath("/artifacts/ESB/synapseconfig/config14/custom_header_add.xml"); secureAxisServiceClient = new SecureServiceClient(); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #26
Source File: ESBJAVA1910TestCase.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) protected void init() throws Exception { super.init(); OMElement synapse = esbUtils.loadResource("/artifacts/ESB/jms/transport/HTTP_SC.xml"); updateESBConfiguration(JMSEndpointManager.setConfigurations(synapse)); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #27
Source File: ESBJAVA4692_MP_FaultSequence_HttpsEndpoint_TestCase.java From product-ei with Apache License 2.0 | 5 votes |
@Test(groups = {"wso2.esb"}, description = "MP Fault Sequence test case for https") public void testCalloutJMSHeaders() throws Exception { AxisServiceClient client = new AxisServiceClient(); String payload = "<payload/>"; AXIOMUtil.stringToOM(payload); client.sendRobust(AXIOMUtil.stringToOM(payload), getProxyServiceURLHttps("MSProxy"), "urn:mediate"); LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); boolean logFound = Utils.checkForLogsWithPriority(logViewerClient, "INFO", "FaultSeq = *********** FaultSeq *****************", 10); assertTrue(logFound, "Fault Sequence Not Executed for Soap Fault"); }
Example #28
Source File: ESBJAVA4852URITemplateWithCompleteURLTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@Test(groups = {"wso2.esb"}, description = "Sending complete URL to API and for dispatching") public void testCompleteURLWithHTTPMethod() throws Exception { DeleteMethod delete = new DeleteMethod(getApiInvocationURL("myApi1/order/21441/item/17440079" + "?message_id=41ec2ec4-e629-4e04-9fdf-c32e97b35bd1")); HttpClient httpClient = new HttpClient(); LogViewerClient logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); logViewerClient.clearLogs(); try { httpClient.executeMethod(delete); Assert.assertEquals(delete.getStatusLine().getStatusCode(), 202, "Response code mismatched"); } finally { delete.releaseConnection(); } LogEvent[] logEvents = logViewerClient.getAllRemoteSystemLogs(); boolean isLogMessageFound = false; for (LogEvent log : logEvents) { if (log != null && log.getMessage().contains("order API INVOKED")) { isLogMessageFound = true; break; } } Assert.assertTrue(isLogMessageFound, "Request Not Dispatched to API when HTTP method having full url"); }
Example #29
Source File: ESBJAVA_4239_HTTP_SC_HandlingTests.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) public void deployService() throws Exception { super.init(); int port = 1995; String expectedResponse = "HTTP/1.1 404 Not Found\r\nServer: testServer\r\n" + "Content-Type: text/xml; charset=UTF-8\r\n" + "Transfer-Encoding: chunked\r\n" + "\r\n" + "\"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<test></test>"; simpleSocketServer = new SimpleSocketServer(port, expectedResponse); simpleSocketServer.start(); verifyProxyServiceExistence("TestCalloutHTTP_SC"); logViewerClient = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); }
Example #30
Source File: PropertyIntegrationXPathBodyTestCase.java From product-ei with Apache License 2.0 | 5 votes |
@BeforeClass(alwaysRun = true) public void setEnvironment() throws Exception { super.init(); loadESBConfigurationFromClasspath ("/artifacts/ESB/mediatorconfig/property/Synapse_XPath_ Variables_Body.xml"); logViewer = new LogViewerClient(context.getContextUrls().getBackEndUrl(), sessionCookie); }