Examples of InterfaceImpl


Examples of org.apache.tuscany.sca.interfacedef.impl.InterfaceImpl

        // Create and set the operation name
        Operation operation = new OperationImpl();
        operation.setName(name);

        // Make the operation remotable
        Interface iface = new InterfaceImpl();
        iface.setRemotable(true);
        operation.setInterface(iface);

        // Construct the parameters
        List<DataType> types = new ArrayList<DataType>();
        DataType<List<DataType>> inputType = new DataTypeImpl<List<DataType>>(Object[].class, types);
View Full Code Here

Examples of org.apache.woden.internal.wsdl20.InterfaceImpl

    // Test that the assertion returns true for an interace that extends no other interfaces.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
    if(!val.testAssertionInterface1009(interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned false for an interface that extends no other interfaces.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true if the interface is not in the direct or indirect list.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      descEl.setTargetNamespace(namespace1);
     
      // Create an interface element, name it and add to the description element
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
     
      // Create another interface element, name it and add to the description element
      InterfaceElement interfac2 = descEl.addInterfaceElement();
      interfac2.setName(name2);

      interfac.addExtendedInterfaceName(interfac2.getName());
     
      InterfaceElement interfac3 = descEl.addInterfaceElement();
      interfac3.setName(name3);
     
      interfac.addExtendedInterfaceName(interfac3.getName());
     
      InterfaceElement interfac4 = descEl.addInterfaceElement();
      interfac4.setName(name4);
     
      interfac2.addExtendedInterfaceName(interfac4.getName());
       
      descComp.getInterfaces(); //init Interface's ref to its Description, needed for interface extension
   
    if(!val.testAssertionInterface1009((Interface)interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned false for an interface that is not in the list of exteneded interfaces.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false if the interface is in the direct list.
  try
  {
    DescriptionElement descEl = factory.newDescription();
    Description descComp = descEl.toComponent();
      descEl.setTargetNamespace(namespace1);
    InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac3.setName(name3);
      interfac.addExtendedInterfaceName(interfac.getName());
      interfac.addExtendedInterfaceName(interfac2.getName());
      interfac.addExtendedInterfaceName(interfac3.getName());
     
      descComp.getInterfaces(); //init Interface's ref to its Description, needed for interface extension
   
    if(val.testAssertionInterface1009(interfac, reporter))
    {
      fail("The testAssertionInterface1009 method returned true for an interface that is in the direct extended interface list.");
    }
  }
  catch(Exception e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false if the interface is in the indirect list.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      Description descComp = descEl.toComponent();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac3.setName(name3);
      interfac.addExtendedInterfaceName(interfac2.getName());
      interfac.addExtendedInterfaceName(interfac3.getName());
      interfac2.addExtendedInterfaceName(interfac.getName());
     
      descComp.getInterface(interfac.getName()); //to ensure the Interface can reference its containing Description
   
    if(val.testAssertionInterface1009(interfac, reporter))
View Full Code Here

Examples of org.apache.woden.internal.wsdl20.InterfaceImpl

 
    // Test that the assertion returns true for an interface that is the only interface defined.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
    interfac.setName(name1);
    if(!val.testAssertionInterface1010(new Interface[]{interfac}, reporter))
    {
      fail("The testAssertionInterface1010 method returned false for an list of interfaces that contains only one interface.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns true for a list of interfaces that contains no duplicate names.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac3.setName(name3);
   
    Interface[] interfaces = new Interface[]{interfac, interfac2, interfac3};
   
    if(!val.testAssertionInterface1010(interfaces, reporter))
    {
      fail("The testAssertionInterface1010 method returned false for a list of interfaces that contains no duplicates.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for two interfaces that are defined with the same QName object.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
    interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac3.setName(name1);
   
    Interface[] interfaces = new Interface[]{interfac, interfac2, interfac3};
   
    if(val.testAssertionInterface1010(interfaces, reporter))
    {
      fail("The testAssertionInterface1010 method returned true for a list of interfaces that contains two interfaces defined with the same QName object.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false for two interfaces that are defined with the same name and
  // different QName objects.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      InterfaceImpl interfac = (InterfaceImpl)descEl.addInterfaceElement();
      interfac.setName(name1);
      InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
      interfac3.setName(new NCName("name1"));
         
      Interface[] interfaces = new Interface[]{interfac, interfac2, interfac3};
   
    if(val.testAssertionInterface1010(interfaces, reporter))
    {
View Full Code Here

Examples of org.apache.woden.internal.wsdl20.InterfaceImpl

      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      interfac.addExtendedInterfaceName(name2QN);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceImpl interfac2 = new InterfaceImpl();
      interfac2.setName(name2);
      InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
      interfaceOperation2.setName(name4);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);
      BindingOperationElement bindingOperation2 = binding.addBindingOperationElement();
      bindingOperation2.setRef(name4QN);
     
    if(!val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1045 method returned false for a binding with an interface with one defined operation and one extended operation and two binding operations defined.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false when an interface is specified with two operations, one
  // explicit and one inherited, and the binding defines an operation only for the explicit operation.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      interfac.addExtendedInterfaceName(name2QN);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceElement interfac2 = descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
      interfaceOperation2.setName(name4);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name3QN);
     
    if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1045 method returned true for a binding with an interface with one defined operation and one extended operation and one binding operation defined for the defined operation.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  // Test that the assertion returns false when an interface is specified with two operations, one
  // explicit and one inherited, and the binding defines an operation only for the inherited operation.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      interfac.addExtendedInterfaceName(name2QN);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceImpl interfac2 = new InterfaceImpl();
      interfac2.setName(name2);
      InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
      interfaceOperation2.setName(name4);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
      BindingOperationElement bindingOperation = binding.addBindingOperationElement();
      bindingOperation.setRef(name4QN);
     
    if(val.testAssertionBinding1045(descEl.toComponent().getBindings()[0], reporter))
    {
      fail("The testAssertionBinding1045 method returned true for a binding with an interface with one defined operation and one inherited operation and one binding operation defined for the inherited operation.");
    }
  }
  catch(WSDLException e)
  {
    fail("There was a problem running the test assertion method " + e);
  }
 
  handler.reset();
 
  // Test that two messages are returned when an interface with two operations, one explicit and one
  // inherited, is specified and the binding defines no operations.
  try
  {
      DescriptionElement descEl = factory.newDescription();
      descEl.setTargetNamespace(namespace1);
      InterfaceElement interfac = descEl.addInterfaceElement();
      interfac.setName(name1);
      interfac.addExtendedInterfaceName(name2QN);
      InterfaceOperationElement interfaceOperation = interfac.addInterfaceOperationElement();
      interfaceOperation.setName(name3);
      InterfaceElement interfac2 = descEl.addInterfaceElement();
      interfac2.setName(name2);
      InterfaceOperationElement interfaceOperation2 = interfac2.addInterfaceOperationElement();
      interfaceOperation2.setName(name4);
      BindingElement binding = descEl.addBindingElement();
      binding.setName(name2);
      binding.setInterfaceName(name1QN);
     
View Full Code Here

Examples of org.apache.woden.internal.wsdl20.InterfaceImpl

    Description descComp = descEl.toComponent();
        descEl.setTargetNamespace(URI.create("http://testnamespace"));
       
        InterfaceElement interfac = descEl.addInterfaceElement();
    interfac.setName(new NCName("name1"));
    InterfaceImpl interfac2 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac2.setName(new NCName("name2"));
       
    interfac.addExtendedInterfaceName(interfac2.getName());
    interfac2.addExtendedInterfaceName(interfac.getName());
       
    // init Interface's ref to its Description, needed for interface extension.
    descComp.getInterfaces();
     
    try {
View Full Code Here

Examples of org.apache.woden.internal.wsdl20.InterfaceImpl

    interfac.setName(name);
    InterfaceElement interfac2 = descEl.addInterfaceElement();
    interfac2.setName(name);
    // Need to create an extended interface otherwise the component model treats the
    // two interfaces as equal and only adds one to the set.
    InterfaceImpl interfac3 = (InterfaceImpl)descEl.addInterfaceElement();
    interfac3.setName(new NCName("name3"));
    interfac2.addExtendedInterfaceName(interfac3.getName());
     
    try {
      assertion.validate(descComp, wodenContext);
    } catch(WSDLException e) {
      fail("Assertion Interface1010 threw WSDLException.");
View Full Code Here

Examples of railo.runtime.InterfaceImpl

      
    return rtn;
    }
 
    public static InterfaceImpl loadInterface(PageContext pc,Page page, PageSource ps,String callPath, boolean isRealPath, Map interfaceUDFs) throws PageException  {
      InterfaceImpl rtn=null;
        if(pc.getConfig().debug()) {
            DebugEntryTemplate debugEntry=pc.getDebugger().getEntry(pc,ps);
            pc.addPageSource(ps,true);
           
            int currTime=pc.getExecutionTime();
View Full Code Here

Examples of railo.runtime.InterfaceImpl

    private static InterfaceImpl initInterface(PageContext pc,Page page,String callPath,boolean isRealPath, Map interfaceUDFs) throws PageException {
      if(!(page instanceof InterfacePage))
      throw new ApplicationException("invalid interface definition ["+callPath+"]");
    InterfacePage ip=(InterfacePage)page;
    InterfaceImpl i = ip.newInstance(callPath,isRealPath,interfaceUDFs);
    return i;
  }
View Full Code Here

Examples of railo.runtime.InterfaceImpl

      return cfc.getMetaData(pc);
    }
    // TODO better solution
    catch(ApplicationException ae){
      try{
        InterfaceImpl inter = ComponentLoader.loadInterface(pc,((PageContextImpl)pc).getCurrentPageSource(null), Caster.toString(obj), new HashMap());
        return inter.getMetaData(pc);
      }
      catch(PageException pe){
        throw ae;
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.