Commit ff910e52 authored by Gwenael Cattez's avatar Gwenael Cattez

Add JSONRPC, REST, SCA and UPNP Binding processors

parent 7e2027c7
......@@ -106,6 +106,7 @@ public interface RemoteScaDomain
@POST
@Path("/port/{id:.*}")
@Consumes("application/x-www-form-urlencoded")
@Produces({"text/plain"})
public String invokeMethod(@PathParam("id") String fullInterfaceId ,MultivaluedMap<String, String> params);
......
......@@ -101,6 +101,7 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
......@@ -208,6 +209,13 @@
<type>jar</type>
<destFileName>helloworld-ws-client.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.ow2.frascati.examples</groupId>
<artifactId>helloworld-annotations</artifactId>
<version>1.5-SNAPSHOT</version>
<type>jar</type>
<destFileName>helloworld-annotated.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
......@@ -314,6 +322,13 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.mojo</groupId>
<artifactId>frascati-contribution-plugin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -114,11 +114,10 @@ public class DeploymentImpl implements Deployment
public String deployComposite(String compositeName, String encodedComposite)
{
File destFile = null;
JarFile jarFile = null;
try
{
destFile = FileUtil.decodeFile(encodedComposite, "jar");
jarFile = new JarFile(destFile);
new JarFile(destFile);
}
catch (Base64Exception b64e)
{
......
......@@ -329,7 +329,7 @@ public class RemoteScaDomainImpl implements RemoteScaDomain
throw new MyWebApplicationException(bpte);
}
String invocationResponse;
String invocationResponse=null;
try
{
Object invokationReturn = method.invoke(itf, arguments);
......
......@@ -30,7 +30,6 @@ package org.ow2.frascati.remote;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
......@@ -73,7 +72,6 @@ import org.ow2.frascati.util.FrascatiException;
*/
@RunWith(Suite.class)
@SuiteClasses({DeploymentTest.class, FractalUtilTest.class,SCAModelUtilTest.class,BindingManagerTest.class,ResourceUtilTest.class})
//@SuiteClasses({ResourceUtilTest.class})
public class IntrospectionTestSuite
{
/** REST binding URI */
......@@ -162,39 +160,42 @@ public class IntrospectionTestSuite
return bindingManager;
}
public static String getResourcePath(String resourceName)
public static File getResource(String resourceName)
{
return RESOURCES_FOLDER+resourceName;
String resourcePath=RESOURCES_FOLDER+resourceName;
File resource=new File(resourcePath);
if(!resource.exists())
{
resourcePath="src/test/resources/"+resourceName;
resource=new File(resourcePath);
}
return resource;
}
/** Helper methods */
public static StringList deployContribution(String contributionName)
{
//TODO remove comment when contribution file will be imported from maven repo
// String contributionPath=getResourcePath(contributionName+".zip");
String contributionPath="src/test/resources/"+contributionName+".zip";
File contribution=getResource(contributionName+".zip");
String contrib = null;
try
{
contrib = FileUtil.getStringFromFile(new File(contributionPath));
contrib = FileUtil.getStringFromFile(contribution);
} catch (IOException e)
{
fail("Cannot read the contribution "+contributionName);
}
StringList deployedComponents=IntrospectionTestSuite.deployment.deployContribution(contrib);
assertTrue(deployedComponents.getStringList().size()>0);
return deployedComponents;
}
public static String deployComposite(String compositeFinaleName, String compositeName)
{
String compositePath=getResourcePath(compositeFinaleName+".jar");
File composite=getResource(compositeFinaleName+".jar");
String compositeFile = null;
try
{
compositeFile = FileUtil.getStringFromFile(new File(compositePath));
compositeFile = FileUtil.getStringFromFile(composite);
}
catch (IOException e)
{
......
......@@ -63,20 +63,20 @@ public class DeploymentTest
deployment=IntrospectionTestSuite.getDeployment();
String contributionName="helloworld-multiple-reference.zip";
String contributionPath=IntrospectionTestSuite.getResourcePath(contributionName);
File contributionFile=IntrospectionTestSuite.getResource(contributionName);
try
{
contributionString = FileUtil.getStringFromFile(new File(contributionPath));
contributionString = FileUtil.getStringFromFile(contributionFile);
} catch (IOException e)
{
fail("Cannot read the contribution "+contributionName);
}
String compositeName="helloworld-multiple-reference.jar";
String compositePath=IntrospectionTestSuite.getResourcePath(compositeName);
File compositeFile=IntrospectionTestSuite.getResource(compositeName);
try
{
compositeString = FileUtil.getStringFromFile(new File(compositePath));
compositeString = FileUtil.getStringFromFile(compositeFile);
}
catch (IOException e)
{
......
......@@ -31,11 +31,16 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import java.io.IOException;
import org.jdom.JDOMException;
import org.junit.BeforeClass;
import org.junit.Test;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.ow2.frascati.remote.IntrospectionTestSuite;
import org.ow2.frascati.remote.introspection.binding.exception.NoBindingKindException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingComponentException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingException;
import org.ow2.frascati.remote.introspection.binding.processor.BindingProcessorException;
......@@ -148,7 +153,7 @@ public class BindingManagerTest
}
@Test
public void jsonrpcBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
public void jsonrpcBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException, IllegalLifeCycleException, NoBindingKindException
{
JSONRPCBindingProcessorTest jsonrpcBindingProcessorTest=new JSONRPCBindingProcessorTest();
jsonrpcBindingProcessorTest.startTest();
......@@ -160,7 +165,7 @@ public class BindingManagerTest
}
@Test
public void restBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
public void restBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException, IllegalLifeCycleException, NoBindingKindException
{
RestBindingProcessorTest restBindingProcessorTest=new RestBindingProcessorTest();
restBindingProcessorTest.startTest();
......@@ -171,20 +176,21 @@ public class BindingManagerTest
restBindingProcessorTest.finishTest();
}
// @Test
// public void rmiBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
// {
// RMIBindingProcessorTest rmiBindingProcessorTest=new RMIBindingProcessorTest();
// rmiBindingProcessorTest.startTest();
// this.getBindinProcessor(rmiBindingProcessorTest);
// this.getClientBindingBundle(rmiBindingProcessorTest);
// //TODO RMI server is not proceed
// rmiBindingProcessorTest.testSuite();
// rmiBindingProcessorTest.finishTest();
// }
//FIXME
//@Test
public void rmiBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
{
RMIBindingProcessorTest rmiBindingProcessorTest=new RMIBindingProcessorTest();
rmiBindingProcessorTest.startTest();
this.getBindinProcessor(rmiBindingProcessorTest);
this.getClientBindingBundle(rmiBindingProcessorTest);
//FIXME RMI server is not proceed
rmiBindingProcessorTest.testSuite();
rmiBindingProcessorTest.finishTest();
}
@Test
public void scaBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
public void scaBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException, IllegalLifeCycleException, NoBindingKindException, IOException, JDOMException
{
SCABindingProcessorTest scaBindingProcessorTest=new SCABindingProcessorTest();
scaBindingProcessorTest.startTest();
......@@ -208,7 +214,7 @@ public class BindingManagerTest
}
@Test
public void wsBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException
public void wsBindingProcessor() throws NoSuchInterfaceException, UnsupportedBindingComponentException, UnsupportedBindingException, BindingProcessorException, IllegalLifeCycleException, NoBindingKindException
{
WSBindingProcessorTest wsBindingProcessorTest=new WSBindingProcessorTest();
wsBindingProcessorTest.startTest();
......
......@@ -33,20 +33,26 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ws.rs.core.MultivaluedMap;
import org.apache.cxf.jaxrs.impl.MetadataMap;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.ow2.frascati.remote.IntrospectionTestSuite;
import org.ow2.frascati.remote.introspection.RemoteScaDomain;
import org.ow2.frascati.remote.introspection.binding.BindingAttribute;
import org.ow2.frascati.remote.introspection.binding.BindingManagerItf;
import org.ow2.frascati.remote.introspection.binding.exception.NoBindingKindException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingComponentException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingException;
import org.ow2.frascati.remote.introspection.resources.BindingKind;
import org.ow2.frascati.remote.introspection.stringlist.StringList;
import org.ow2.frascati.remote.introspection.util.FractalUtilItf;
......@@ -57,18 +63,15 @@ import org.ow2.frascati.remote.introspection.util.FractalUtilItf;
public abstract class BindingProcessorTest
{
protected Logger logger=Logger.getLogger(BindingProcessorTest.class.getName());
/**
* List of the deployed composites
*/
protected List<String> deployedComposites;
protected FractalUtilItf fractalUtil;
protected BindingManagerItf bindingManager;
protected BindingKind bindingKind;
private List<String> contributionsToDeploy;
private Map<String,String> compositesToDeploy;
protected List<String> deployedComposites;
protected String serverInterfacePath;
protected String serverInterfaceName;
......@@ -76,16 +79,14 @@ public abstract class BindingProcessorTest
protected String clientInterfaceName;
protected Interface serverInterfaceFc;
protected Component serverComponentFc;
protected Object skeltonObject;
protected Interface skeltonInterfaceFc;
protected Interface clientInterfaceFc;
protected Component clientComponentFc;
protected Interface stubInterfaceFc;
protected Object stubObject;
protected Interface stubInterfaceFc;
protected BindingProcessorItf bindingProcessor;
public BindingProcessorTest(BindingKind bindingKind, String serverInterfacePath, String clientInterfacePath)
{
......@@ -115,6 +116,7 @@ public abstract class BindingProcessorTest
{
this.logEntering("startTest");
this.fractalUtil=IntrospectionTestSuite.getFractalUtil();
this.bindingManager=IntrospectionTestSuite.getBindingManager();
this.deployedComposites=new ArrayList<String>();
/**deploy contributions*/
......@@ -140,8 +142,8 @@ public abstract class BindingProcessorTest
{
this.serverInterfaceFc=fractalUtil.getInterface(this.serverInterfacePath);
assertNotNull(this.serverInterfaceFc);
this.serverComponentFc=this.serverInterfaceFc.getFcItfOwner();
this.serverInterfaceName=fractalUtil.getComponentName(this.serverComponentFc)+"/"+this.serverInterfaceFc.getFcItfName();
Component serverComponentFc=this.serverInterfaceFc.getFcItfOwner();
this.serverInterfaceName=fractalUtil.getComponentName(serverComponentFc)+"/"+this.serverInterfaceFc.getFcItfName();
this.log("server : "+this.serverInterfaceName);
initServer();
}
......@@ -150,15 +152,15 @@ public abstract class BindingProcessorTest
if(this.clientInterfacePath!=null && !"".equals(this.clientInterfacePath))
{
this.clientInterfaceFc=fractalUtil.getInterface(this.clientInterfacePath);
this.clientComponentFc=this.clientInterfaceFc.getFcItfOwner();
this.clientInterfaceName=fractalUtil.getComponentName(this.clientComponentFc)+"/"+this.clientInterfaceFc.getFcItfName();
Component clientComponentFc=this.clientInterfaceFc.getFcItfOwner();
this.clientInterfaceName=fractalUtil.getComponentName(clientComponentFc)+"/"+this.clientInterfaceFc.getFcItfName();
this.log("client : "+this.clientInterfaceName);
assertNotNull(this.clientInterfaceFc);
initClient();
}
}
public abstract void testSuite() throws BindingProcessorException;
public abstract void testSuite() throws BindingProcessorException, NoSuchInterfaceException, IllegalLifeCycleException, UnsupportedBindingComponentException, NoBindingKindException, UnsupportedBindingException;
public void finishTest()
{
......@@ -176,7 +178,6 @@ public abstract class BindingProcessorTest
private void initServer()
{
logEntering("initServer");
BindingManagerItf bindingManager=IntrospectionTestSuite.getBindingManager();
List<Interface> clientInterfaces=bindingManager.getBindingInterfaces(this.serverInterfaceFc);
assertEquals(1, clientInterfaces.size());
this.skeltonObject=clientInterfaces.get(0);
......@@ -190,12 +191,12 @@ public abstract class BindingProcessorTest
try
{
this.bindingProcessor=bindingManager.getBindingProcessor(this.skeltonObject);
BindingProcessorItf bindingProcessor=bindingManager.getBindingProcessor(this.skeltonObject);
StringBuilder inconsistantBindingKing=new StringBuilder("Inconsistent BindingProcessor : ");
inconsistantBindingKing.append("The provided serverInterfacePath "+this.serverInterfacePath);
inconsistantBindingKing.append(" is bound to "+this.bindingProcessor.getBindingKind()+" skelton");
inconsistantBindingKing.append(" is bound to "+bindingProcessor.getBindingKind()+" skelton");
inconsistantBindingKing.append(", but the provided BindingKind is "+this.getBindingKind().name());
assertEquals(inconsistantBindingKing.toString(),this.bindingKind, this.bindingProcessor.getBindingKind());
assertEquals(inconsistantBindingKing.toString(),this.bindingKind, bindingProcessor.getBindingKind());
}
catch (UnsupportedBindingComponentException unsupportedBindingComponentException)
{
......@@ -218,13 +219,12 @@ public abstract class BindingProcessorTest
try
{
BindingManagerItf bindingManager=IntrospectionTestSuite.getBindingManager();
this.bindingProcessor=bindingManager.getBindingProcessor(this.stubObject);
BindingProcessorItf bindingProcessor=bindingManager.getBindingProcessor(this.stubObject);
StringBuilder inconsistantBindingKing=new StringBuilder("Inconsistent BindingProcessor : ");
inconsistantBindingKing.append("The provided clientInterfacePath "+this.clientInterfacePath);
inconsistantBindingKing.append(" is bound to "+this.bindingProcessor.getBindingKind()+" stub");
inconsistantBindingKing.append(" is bound to "+bindingProcessor.getBindingKind()+" stub");
inconsistantBindingKing.append(", but the provided BindingKind is "+this.bindingKind.name());
assertEquals(inconsistantBindingKing.toString(),this.bindingKind, this.bindingProcessor.getBindingKind());
assertEquals(inconsistantBindingKing.toString(),this.bindingKind, bindingProcessor.getBindingKind());
}
catch (UnsupportedBindingComponentException unsupportedBindingComponentException)
{
......@@ -232,31 +232,31 @@ public abstract class BindingProcessorTest
}
}
public void removeServerBinding() throws BindingProcessorException
public String invokeClient(String methodName, String...params)
{
if(this.bindingProcessor==null)
MultivaluedMap<String, String> multiValueparams=new MetadataMap<String, String>();
multiValueparams.add("methodName", methodName);
for(int i=0;i<params.length;i++)
{
this.log(Level.WARNING, "Current BindingProcessor is null");
return;
multiValueparams.add("Parameter"+i, params[i]);
}
RemoteScaDomain remoteScaDomain=IntrospectionTestSuite.getDomain();
return remoteScaDomain.invokeMethod(this.clientInterfacePath, multiValueparams);
}
public void removeServerBinding() throws BindingProcessorException, UnsupportedBindingComponentException
{
this.logEntering("removeServerBinding",this.serverInterfaceName, this.skeltonObject);
this.bindingProcessor.unexportService(serverComponentFc, serverInterfaceFc.getFcItfName(), this.skeltonObject);
BindingManagerItf bindingManager=IntrospectionTestSuite.getBindingManager();
bindingManager.unbind(serverInterfaceFc, serverInterfacePath, 0);
List<Interface> clientInterfaces=bindingManager.getBindingInterfaces(this.serverInterfaceFc);
assertEquals(true, clientInterfaces.isEmpty());
this.skeltonObject=null;
this.skeltonInterfaceFc=null;
}
public void addServerBinding(Map<String,String> serverHints) throws BindingProcessorException
public void addServerBinding(Map<String,String> serverHints) throws BindingProcessorException, NoBindingKindException, UnsupportedBindingException
{
if(this.bindingProcessor==null)
{
this.log(Level.WARNING,"Current BindingProcessor is null");
return;
}
if(serverHints==null || serverHints.isEmpty())
{
this.log(Level.WARNING,"No hints provided to create server Binding");
......@@ -264,18 +264,13 @@ public abstract class BindingProcessorTest
}
this.logEntering("addServerBinding",this.serverInterfaceName);
this.bindingProcessor.exportService(this.serverInterfaceFc, this.serverInterfaceFc.getFcItfName(), serverHints);
serverHints.put("kind", this.getBindingKind().name());
bindingManager.bind(serverInterfaceFc, serverInterfacePath, serverHints);
initServer();
}
public void setServerAttribute(List<BindingAttribute> serverBindingAttributes) throws BindingProcessorException
public void setServerAttribute(List<BindingAttribute> serverBindingAttributes) throws BindingProcessorException, UnsupportedBindingComponentException
{
if(this.bindingProcessor==null)
{
this.log(Level.WARNING,"Current BindingProcessor is null");
return;
}
if(serverBindingAttributes==null || serverBindingAttributes.isEmpty())
{
this.log(Level.WARNING,"No attributes provided to be set on current server binding");
......@@ -288,40 +283,30 @@ public abstract class BindingProcessorTest
attributeName=bindingAttributeToSet.getName();
attributeValue=bindingAttributeToSet.getValue();
this.logEntering("setServerAttribute",this.serverInterfaceName, attributeName, attributeValue, this.skeltonObject);
this.bindingProcessor.setAttribute(this.skeltonObject,attributeName, attributeValue);
this.bindingManager.setBindingAttribute(serverInterfaceFc, 0, attributeName, attributeValue);
}
List<BindingAttribute> serverBingAttributes=this.bindingProcessor.getAttributes(this.skeltonObject);
BindingProcessorItf bindingProcessor=bindingManager.getBindingProcessor(this.skeltonObject);
List<BindingAttribute> serverBingAttributes=bindingProcessor.getAttributes(this.skeltonObject);
for(BindingAttribute bindingAttributeToSet : serverBindingAttributes)
{
assertTrue(serverBingAttributes.contains(bindingAttributeToSet));
}
}
public void removeClientBinding() throws BindingProcessorException
public void removeClientBinding() throws BindingProcessorException, UnsupportedBindingComponentException
{
if(this.bindingProcessor==null)
{
this.log(Level.WARNING,"Current BindingProcessor is null");
return;
}
this.logEntering("removeServerBinding",this.clientInterfaceName, this.stubObject);
this.bindingProcessor.unbindReference(this.clientComponentFc, this.clientInterfaceFc.getFcItfName(), this.stubObject);
this.logEntering("removeClientBinding",this.clientInterfaceName, this.stubObject);
IntrospectionTestSuite.getBindingManager().unbind(clientInterfaceFc, clientInterfacePath, 0);
Object stubObject=fractalUtil.getServerInterface(this.clientInterfaceFc);
assertNull(stubObject);
this.stubObject=null;
this.stubInterfaceFc=null;
}
public void addClientBinding(Map<String,String> clientHints) throws BindingProcessorException
public void addClientBinding(Map<String,String> clientHints) throws BindingProcessorException, NoBindingKindException, UnsupportedBindingException
{
if(this.bindingProcessor==null)
{
this.log(Level.WARNING,"Current BindingProcessor is null");
return;
}
if(clientHints==null || clientHints.isEmpty())
{
this.log(Level.WARNING,"No hints provided to create client Binding");
......@@ -329,18 +314,13 @@ public abstract class BindingProcessorTest
}
this.logEntering("addClientBinding",this.clientInterfaceName);
this.bindingProcessor.bindReference(this.clientInterfaceFc, this.clientInterfaceFc.getFcItfName(), clientHints);
clientHints.put("kind", this.getBindingKind().name());
bindingManager.bind(clientInterfaceFc, clientInterfacePath, clientHints);
initClient();
}
public void setClientAttribute(List<BindingAttribute> clientBindingAttributes) throws BindingProcessorException
public void setClientAttribute(List<BindingAttribute> clientBindingAttributes) throws BindingProcessorException, UnsupportedBindingComponentException
{
if(this.bindingProcessor==null)
{
this.log(Level.WARNING,"Current BindingProcessor is null");
return;
}
if(clientBindingAttributes==null || clientBindingAttributes.isEmpty())
{
this.log(Level.WARNING,"No attributes provided to be set on current client binding");
......@@ -352,11 +332,12 @@ public abstract class BindingProcessorTest
{
attributeName=bindingAttributeToSet.getName();
attributeValue=bindingAttributeToSet.getValue();
this.logEntering("setServerAttribute",this.clientInterfaceName, attributeName, attributeValue, this.stubObject);
this.bindingProcessor.setAttribute(this.stubObject,attributeName, attributeValue);
this.logEntering("setClientAttribute",this.clientInterfaceName, attributeName, attributeValue, this.stubObject);
bindingManager.setBindingAttribute(clientInterfaceFc, 0, attributeName, attributeValue);
}
List<BindingAttribute> clientBingAttributes=this.bindingProcessor.getAttributes(this.stubObject);
BindingProcessorItf bindingProcessor=bindingManager.getBindingProcessor(this.skeltonObject);
List<BindingAttribute> clientBingAttributes=bindingProcessor.getAttributes(this.stubObject);
for(BindingAttribute bindingAttributeToSet : clientBindingAttributes)
{
assertTrue(clientBingAttributes.contains(bindingAttributeToSet));
......
......@@ -27,6 +27,14 @@
package org.ow2.frascati.remote.introspection.binding.processor;
import java.util.HashMap;
import java.util.Map;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.ow2.frascati.remote.introspection.binding.exception.NoBindingKindException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingComponentException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingException;
import org.ow2.frascati.remote.introspection.resources.BindingKind;
/**
......@@ -42,8 +50,19 @@ public class JSONRPCBindingProcessorTest extends BindingProcessorTest
}
@Override
public void testSuite() throws BindingProcessorException
public void testSuite() throws BindingProcessorException, NoSuchInterfaceException, IllegalLifeCycleException, UnsupportedBindingComponentException, NoBindingKindException, UnsupportedBindingException
{
this.log("Not Implemented yet");
this.invokeClient("print", this.getClass().getName());
this.removeClientBinding();
this.removeServerBinding();
Map<String,String> serverBindingHints=new HashMap<String, String>();
serverBindingHints.put("uri", "http://localhost:9399/JSON-RPC/HelloServiceReconfigured");
this.addServerBinding(serverBindingHints);
Map<String, String> clientBindingHints = new HashMap<String, String>();
clientBindingHints.put("uri", "http://localhost:9399/JSON-RPC/HelloServiceReconfigured");
this.addClientBinding(clientBindingHints);
this.invokeClient("print", this.getClass().getName());
}
}
......@@ -27,6 +27,19 @@
package org.ow2.frascati.remote.introspection.binding.processor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.*;
import org.objectweb.fractal.api.NoSuchInterfaceException;
import org.objectweb.fractal.api.control.IllegalLifeCycleException;
import org.ow2.frascati.remote.introspection.binding.BindingAttribute;
import org.ow2.frascati.remote.introspection.binding.exception.NoBindingKindException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingComponentException;
import org.ow2.frascati.remote.introspection.binding.exception.UnsupportedBindingException;
import org.ow2.frascati.remote.introspection.resources.BindingKind;
/**
......@@ -35,11 +48,6 @@ import org.ow2.frascati.remote.introspection.resources.BindingKind;
public class RestBindingProcessorTest extends BindingProcessorTest
{
/**
* @param bindingKind
* @param serverInterfacePath
* @param clientInterfacePath
*/
public RestBindingProcessorTest()
{
super(BindingKind.REST, "counter-server/server/counter","counter-client/client/counter");
......@@ -47,8 +55,53 @@ public class RestBindingProcessorTest extends BindingProcessorTest
}
@Override
public void testSuite() throws BindingProcessorException