ConfigurationContext CTX = new ConfigurationContext("path to axis2 repo","path to axis2.XML"); ServiceClient sender=new ServiceClient(CTX, null);
/** * Get the default axis2 configuration context for a client * @return * @throws Exception */ protected ConfigurationContext getClientCfgCtx() throws Exception { AxisConfiguration axisCfg = new AxisConfiguration(); ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg); return cfgCtx; }
/** * Get the default axis2 configuration context for a client * @return * @throws Exception */ protected ConfigurationContext getClientCfgCtx() throws Exception { AxisConfiguration axisCfg = new AxisConfiguration(); ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg); return cfgCtx; }
/** * Get the default axis2 configuration context for a client * @return * @throws Exception */ protected ConfigurationContext getClientCfgCtx() throws Exception { AxisConfiguration axisCfg = new AxisConfiguration(); ConfigurationContext cfgCtx = new ConfigurationContext(axisCfg); return cfgCtx; }
/** * creates an empty configuration context. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createEmptyConfigurationContext() throws AxisFault { AxisConfiguration axisConfiguration = new AxisConfiguration(); ConfigurationContext configContext = new ConfigurationContext(axisConfiguration); if (axisConfiguration.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfiguration, configContext); return configContext; }
/** * creates an empty configuration context. * * @return Returns ConfigurationContext. */ public static ConfigurationContext createEmptyConfigurationContext() throws AxisFault { AxisConfiguration axisConfiguration = new AxisConfiguration(); ConfigurationContext configContext = new ConfigurationContext(axisConfiguration); if (axisConfiguration.getClusteringAgent() != null) { configContext.initCluster(); } setContextPaths(axisConfiguration, configContext); return configContext; }
protected void setConfigurationContextService(ConfigurationContextService ccService) { ConfigurationContext serverCtx = ccService.getServerConfigContext(); AxisConfiguration serverConfig = serverCtx.getAxisConfiguration(); LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig); LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services"); LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/"); Util.setConfigurationContextService(ccService); }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); }
/** * The default configuration of HolodeckB2B distribution is added to * src/test/resources/cfg dir to test config initialization. */ @BeforeClass public static void setUpClass() { repoUrl = ConfigTest.class.getClassLoader().getResource("cfg/repo"); AxisConfiguration ac = new AxisConfiguration(); ac.setRepository(repoUrl); cc = new ConfigurationContext(ac); }
/** * Create a mock SynapseEnvironment object. * * @return Axis2SynapseEnvironment instance * @throws AxisFault on creating/mocking object */ private Axis2SynapseEnvironment getMockedSynapseEnvironment() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = PowerMockito.mock(Axis2SynapseEnvironment.class); ConfigurationContext axis2ConfigurationContext = new ConfigurationContext(new AxisConfiguration()); Mockito.when(synapseEnvironment.getAxis2ConfigurationContext()).thenReturn(axis2ConfigurationContext); return synapseEnvironment; }
protected void setConfigurationContextService(ConfigurationContextService ccService) { ConfigurationContext serverCtx = ccService.getServerConfigContext(); AxisConfiguration serverConfig = serverCtx.getAxisConfiguration(); LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig); LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services"); LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/"); DataHolder.getInstance().setConfigurationContextService(ccService); }
/** * Create a mock SynapseEnvironment object * * @return Axis2SynapseEnvironment instance * @throws AxisFault on creating/mocking object */ private Axis2SynapseEnvironment getMockedSynapseEnvironment() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = PowerMockito.mock(Axis2SynapseEnvironment.class); ConfigurationContext axis2ConfigurationContext = new ConfigurationContext(new AxisConfiguration()); Mockito.when(synapseEnvironment.getAxis2ConfigurationContext()).thenReturn(axis2ConfigurationContext); return synapseEnvironment; }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope(); envelope.getBody().addChild(createOMElement("<sendEmail/>")); testCtx.setEnvelope(envelope); }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope(); envelope.getBody().addChild(createOMElement("<describeSObjects/>")); testCtx.setEnvelope(envelope); }
/** * Create a mock SynapseEnvironment object * * @return Axis2SynapseEnvironment instance * @throws AxisFault on creating/mocking object */ private Axis2SynapseEnvironment getMockedSynapseEnvironment() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = PowerMockito.mock(Axis2SynapseEnvironment.class); ConfigurationContext axis2ConfigurationContext = new ConfigurationContext(new AxisConfiguration()); axis2ConfigurationContext.getAxisConfiguration().addParameter(SynapseConstants.SYNAPSE_ENV, synapseEnvironment); Mockito.when(synapseEnvironment.getAxis2ConfigurationContext()).thenReturn(axis2ConfigurationContext); return synapseEnvironment; }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); SOAPEnvelope envelope = OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope(); envelope.getBody().addChild(createOMElement("<queryResponse>" + "<result>" + "<done>false</done><queryLocator>01g9000000MVzggAAD-200</queryLocator>" + "<size>370</size>" + "</result>" + "</queryResponse>")); testCtx.setEnvelope(envelope); }
/** * Create a mock SynapseEnvironment object * * @return Axis2SynapseEnvironment instance * @throws AxisFault on creating/mocking object */ private Axis2SynapseEnvironment getMockedSynapseEnvironment() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = PowerMockito.mock(Axis2SynapseEnvironment.class); ConfigurationContext axis2ConfigurationContext = new ConfigurationContext(new AxisConfiguration()); axis2ConfigurationContext.getAxisConfiguration().addParameter(SynapseConstants.SYNAPSE_ENV, synapseEnvironment); Mockito.when(synapseEnvironment.getAxis2ConfigurationContext()).thenReturn(axis2ConfigurationContext); return synapseEnvironment; }
/** * Initializing metricsAggregationModule and assert for the returned counter obj * @throws AxisFault */ public void testInit() throws AxisFault { AxisConfiguration axisConfiguration = new AxisConfiguration(); ConfigurationContext configurationContext = new ConfigurationContext(axisConfiguration); metricsAggregatorModule.init(configurationContext, null); Counter counter = (Counter) axisConfiguration.getParameter(MetricsConstants.GLOBAL_REQUEST_COUNTER).getValue(); Assert.assertEquals("Counter should be 0",counter.getCount(), 0); }
@Override protected void setUp() throws Exception { service = new AxisService(); outputStream = new ByteArrayOutputStream(); schemas = new ArrayList<XmlSchema>(); loadSampleSchemaFile(schemas); service.addSchema(schemas); AxisConfiguration axisConfiguration = new AxisConfiguration(); service.setName("test_service"); axisConfiguration.addChild(service); axisConfiguration.addService(service); configurationContext = new ConfigurationContext(axisConfiguration); configurationContext.setServicePath("test_service"); configurationContext.setContextRoot("test/context"); messageContext.setConfigurationContext(configurationContext); }