Commit d9040cf3 authored by Philippe Merle's avatar Philippe Merle

Corrected http://bamboo.ow2.org/browse/SCA-DEF-JOB1-949/test/case/67182262

* Updated the HTTP server port from 8088 to 8888 as port 8088 is already used on the OW2 Bamboo server.
* Added a property to configure the HTTP server port.
parent e56a0d2c
============================================================================
OW2 FraSCAti Examples: Comanche
Copyright (C) 2009-2010 INRIA, University of Lille 1
Copyright (C) 2009-2012 Inria, University of Lille 1
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
......@@ -35,7 +35,7 @@ The Web server implementation is decoupled in few SCA composites
responsible for receiving requests, dispatching and handling responses.
When running Comanche server will display the GNU logo when browsing the url
http://localhost:8080/gnu.jpg
http://localhost:8888/gnu.jpg
Note: the run() method of the service "r" exposed by the Comanche composite
must be called for starting the Web server.
......
/**
* OW2 FraSCAti Examples: Comanche
* Copyright (C) 2008-2010 INRIA, University of Lille 1
* Copyright (C) 2008-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -32,6 +32,7 @@ import java.net.Socket;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
import org.osoa.sca.annotations.Property;
@Service(Runnable.class)
public class RequestReceiver
......@@ -43,6 +44,9 @@ public class RequestReceiver
@Reference
private RequestHandler rh;
@Property
private int port = 8888;
// --------------------------------------------------------------------------
// Implementation of the Runnable interface
// --------------------------------------------------------------------------
......@@ -52,9 +56,9 @@ public class RequestReceiver
new Thread() {
public void run() {
try {
ServerSocket ss = new ServerSocket(8088);
System.out.println("Comanche HTTP Server ready on port 8088.");
System.out.println("Load http://localhost:8088/gnu.jpg");
ServerSocket ss = new ServerSocket(port);
System.out.println("Comanche HTTP Server ready on port " + port + ".");
System.out.println("Load http://localhost:" + port + "/gnu.jpg");
while (true) {
final Socket socket = ss.accept();
s.schedule(new Runnable() {
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- OW2 FraSCAti Assembly Factory Examples: Comanche -->
<!-- Copyright (C) 2008-2010 INRIA, University of Lille 1 -->
<!-- OW2 FraSCAti Examples: Comanche -->
<!-- Copyright (C) 2008-2012 Inria, University of Lille 1 -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
......@@ -20,7 +20,7 @@
<!-- -->
<!-- Author: Nicolas Pessemier -->
<!-- -->
<!-- Contributor(s): Nicolas Dolet -->
<!-- Contributor(s): Nicolas Dolet, Philippe Merle -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="frontend">
......@@ -30,6 +30,7 @@
<component name="requestReceiver">
<implementation.java class="org.ow2.frascati.examples.comanche.RequestReceiver" />
<property name="port">8888</property>
</component>
<component name="scheduler">
......
/**
* OW2 FraSCAti Assembly Factory Examples: Comanche
* Copyright (C) 2008-2010 INRIA, University of Lille 1
* OW2 FraSCAti Examples: Comanche
* Copyright (C) 2008-2012 Inria, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -47,7 +47,7 @@ public class ComancheTestCase
service.run();
// Wait for 1 second to be sure that the Web server is started.
Thread.sleep(1000);
URL url = new URL("http://localhost:8088/gnu.jpg");
URL url = new URL("http://localhost:8888/gnu.jpg");
File file = new File("gnu.jpg");
BufferedImage remoteImage = ImageIO.read(url);
BufferedImage localImage = ImageIO.read(file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment