Package org.apache.ode.bpel.compiler.api

Examples of org.apache.ode.bpel.compiler.api.CompilationMessage


            InputSource isrc = new InputSource(new ByteArrayInputStream(StreamUtils.read(bpelFile.toURL())));
            isrc.setSystemId(bpelFile.getAbsolutePath());

            process = BpelObjectFactory.getInstance().parse(isrc,_bpelFile.toURI());
        } catch (Exception e) {
            CompilationMessage cmsg = __cmsgs.errBpelParseErr().setSource(new SourceLocation(bpelFile.toURI()));
            this.invalidate();
            throw new CompilationException(cmsg, e);
        }

        assert process != null;
View Full Code Here


    assertTrue(_errors.size()!=0);

    boolean found = false;
    for (Iterator<CompilationMessage> i = _errors.iterator(); i.hasNext(); ) {
      CompilationMessage msg = i.next();
      if (msg.severity == CompilationMessage.ERROR && msg.code.equals(name)) {
        found = true;
      }
    }
View Full Code Here

                        break;
                    case BPEL11:
                        compiler = new org.apache.ode.bpel.compiler.v1.BpelCompiler11();
                        break;
                    default:
                        CompilationMessage cmsg = __cmsgs.errUnrecognizedBpelVersion();
                        throw new CompilationException(cmsg);
                }
                break;
            case 2:
                switch (bpelVersion) {
                    case BPEL20:
                        compiler = new org.apache.ode.bpel.compiler.v2.BpelCompiler20();
                        break;
                    case BPEL20_DRAFT:
                        compiler = new org.apache.ode.bpel.compiler.v2.BpelCompiler20Draft();
                        break;
                    case BPEL11:
                        compiler = new org.apache.ode.bpel.compiler.v2.BpelCompiler11();
                        break;
                    default:
                        CompilationMessage cmsg = __cmsgs.errUnrecognizedBpelVersion();
                        throw new CompilationException(cmsg);
                }
                break;
            default:
                throw new RuntimeException("Non existant version: " + version);
View Full Code Here

    }

    public void validate(CompilerContext context, ExtensibleElement element)
        throws CompilationException {
      if (element.getNestedElement().getTextContent().trim().equals(TestExtensionBundle.cmpString)) {
        throw new CompilationException(new CompilationMessage());
      }
    }
View Full Code Here

    Locale.setDefault(oldLocale);
    super.tearDown();
  }

  public void testNoParameter() {
    CompilationMessage msg = _bundle.infNoParameter().setSource(sloc);
    assertEquals(NO_PARAMETER, msg.messageText);
    assertEquals(CompilationMessage.INFO, msg.severity);
    assertEquals(NO_PARAMETER_CODE, msg.code);
    assertSame(sloc, msg.source);
View Full Code Here

  }

  public void testNoParameterLocalized() {
    CompilationTestMessages bundle = MessageBundle.getMessages(
        CompilationTestMessages.class, Locale.GERMAN);
    CompilationMessage msg = bundle.infNoParameter().setSource(sloc);
    assertEquals(NO_PARAMETER_DE, msg.messageText);
    assertEquals(CompilationMessage.INFO, msg.severity);
    assertEquals(NO_PARAMETER_CODE, msg.code);
    assertSame(sloc, msg.source);
  }
View Full Code Here

    assertEquals(NO_PARAMETER_CODE, msg.code);
    assertSame(sloc, msg.source);
  }

  public void testWrongParameter() {
    CompilationMessage msg = _bundle.infWrongParameter(":-)").setSource(sloc);
    assertEquals(WRONG_PARAMETER, msg.messageText);
    assertEquals(CompilationMessage.INFO, msg.severity);
    assertEquals(WRONG_PARAMETER_CODE, msg.code);
    assertSame(sloc, msg.source);
View Full Code Here

            switch (process.getBpelVersion()) {
                case BPEL20:
                    compiler = new BpelCompiler20();
                    compiler.setResourceFinder(wf);
                    if (_bpel11wsdl != null) {
                        CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process();
                        logCompilationMessage(cmsg);
                    }
                    break;
                case BPEL20_DRAFT:
                    compiler = new BpelCompiler20Draft();
                    compiler.setResourceFinder(wf);
                    if (_bpel11wsdl != null) {
                        CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process();
                        logCompilationMessage(cmsg);
                    }
                    break;
                case BPEL11:
                    compiler = new BpelCompiler11();
                    compiler.setResourceFinder(wf);
                    if (_bpel11wsdl != null) {
                        compiler.addWsdlImport(new URI(_bpelFile.getName()), _bpel11wsdl,null);
                    } else {
                        CompilationMessage cmsg = __cmsgs.errBpel11RequiresWsdl();
                        logCompilationMessage(cmsg);
                        this.invalidate();
                        throw new CompilationException(cmsg);
                    }
                    break;
                default:
                    CompilationMessage cmsg = __cmsgs.errUnrecognizedBpelVersion();
                    logCompilationMessage(cmsg);
                    this.invalidate();
                    throw new CompilationException(cmsg);
            }
            compiler.setCompileListener(clistener);
            if (_compileProperties != null) {
                if (_compileProperties.get(PROCESS_CUSTOM_PROPERTIES) != null)
                    compiler.setCustomProperties((Map<QName, Node>) _compileProperties.get(PROCESS_CUSTOM_PROPERTIES));
            }
        } catch (CompilationException ce) {
            this.invalidate();
            throw ce;
        } catch (Exception ex) {
            CompilationMessage cmsg = __cmsgs.errBpelParseErr();
            logCompilationMessage(cmsg);
            this.invalidate();
            throw new CompilationException(cmsg,ex);
        }
View Full Code Here

            InputSource isrc = new InputSource(new ByteArrayInputStream(StreamUtils.read(bpelFile.toURL())));
            isrc.setSystemId(bpelFile.getAbsolutePath());

            process = BpelObjectFactory.getInstance().parse(isrc,_bpelFile.toURI());
        } catch (Exception e) {
            CompilationMessage cmsg = __cmsgs.errBpelParseErr().setSource(new SourceLocationImpl(bpelFile.toURI()));
            this.invalidate();
            throw new CompilationException(cmsg, e);
        }

        assert process != null;
View Full Code Here

    Locale.setDefault(oldLocale);
    super.tearDown();
  }

  public void testNoParameter() {
    CompilationMessage msg = _bundle.infNoParameter().setSource(sloc);
    assertEquals(NO_PARAMETER, msg.messageText);
    assertEquals(CompilationMessage.INFO, msg.severity);
    assertEquals(NO_PARAMETER_CODE, msg.code);
    assertSame(sloc, msg.source);
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.compiler.api.CompilationMessage

Copyright © 2018 www.massapicom. 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.