use of org.pentaho.platform.plugin.services.webservices.content.AxisServiceWsdlGenerator in project pentaho-platform by pentaho.
the class WsdlPageTest method setUp.
@Before
public void setUp() {
beforeTestCfg = AxisWebServiceManager.currentAxisConfiguration;
beforeTestCtx = AxisWebServiceManager.currentAxisConfigContext;
AxisConfiguration axisCfg = new AxisConfiguration();
AxisWebServiceManager.currentAxisConfiguration = axisCfg;
AxisWebServiceManager.currentAxisConfigContext = new ConfigurationContext(axisCfg);
out = new ByteArrayOutputStream();
IOutputHandler outputHandler = new SimpleOutputHandler(out, false);
outputHandler.setMimeTypeListener(new MimeTypeListener());
StandaloneSession session = new StandaloneSession("test");
StubServiceSetup serviceSetup = new StubServiceSetup();
serviceSetup.setSession(session);
contentGenerator = new AxisServiceWsdlGenerator();
contentGenerator.setOutputHandler(outputHandler);
contentGenerator.setMessagesList(new ArrayList<String>());
contentGenerator.setSession(session);
contentGenerator.setUrlFactory(new SimpleUrlFactory(BASE_URL + "?"));
}
use of org.pentaho.platform.plugin.services.webservices.content.AxisServiceWsdlGenerator in project pentaho-platform by pentaho.
the class AxisServiceWsdlGeneratorTest method testBadInit3.
@Test
public void testBadInit3() throws Exception {
// $NON-NLS-1$
StandaloneSession session = new StandaloneSession("test");
AxisServiceWsdlGenerator contentGenerator = new AxisServiceWsdlGenerator();
// $NON-NLS-1$
assertNotNull("contentGenerator is null", contentGenerator);
// $NON-NLS-1$
assertNotNull("Logger is null", contentGenerator.getLogger());
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOutputHandler outputHandler = new SimpleOutputHandler(out, false);
// $NON-NLS-1$
String baseUrl = "http://testhost:testport/testcontent";
Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
SimpleParameterProvider requestParams = new SimpleParameterProvider();
parameterProviders.put(IParameterProvider.SCOPE_REQUEST, requestParams);
// $NON-NLS-1$
SimpleUrlFactory urlFactory = new SimpleUrlFactory(baseUrl + "?");
List<String> messages = new ArrayList<String>();
contentGenerator.setOutputHandler(outputHandler);
MimeTypeListener mimeTypeListener = new MimeTypeListener();
outputHandler.setMimeTypeListener(mimeTypeListener);
contentGenerator.setMessagesList(messages);
contentGenerator.setParameterProviders(parameterProviders);
contentGenerator.setSession(session);
contentGenerator.setUrlFactory(urlFactory);
contentGenerator.createContent();
String content = new String(out.toByteArray());
System.out.println(content);
assertTrue(content.indexOf(Messages.getInstance().getErrorString("WebServiceContentGenerator.ERROR_0001_AXIS_CONFIG_IS_NULL")) != // $NON-NLS-1$
-1);
}
Aggregations