Package org.drools.guvnor.client.packages.PackageHeaderWidget

Examples of org.drools.guvnor.client.packages.PackageHeaderWidget.Import


    assertNotNull(t.globals);
    assertNotNull(t.imports);

    assertEquals(0, t.globals.size());
    assertEquals(3, t.imports.size());
    Import i = (Import) t.imports.get(0);
    assertEquals("goo.bar.Whee", i.type);

    i = (Import) t.imports.get(1);
    assertEquals("wee.waah.Foo", i.type);
View Full Code Here


    PackageHeaderWidget.Types t = PackageHeaderHelper.parseHeader(s);
    assertNotNull(t);
    assertEquals(1, t.imports.size());
    assertEquals(1, t.globals.size());

    Import i = (Import) t.imports.get(0);
    assertEquals("goo.bar.Whee", i.type);

    Global g = (Global) t.globals.get(0);
    assertEquals("wee.waah.Foo", g.type);
    assertEquals("asd", g.name);
View Full Code Here

    assertEquals(null, PackageHeaderHelper.parseHeader(s));
  }

  public void testRenderTypes() {
    Types t = new Types();
    t.imports.add(new Import("foo.bar.Baz"));
    String h = PackageHeaderHelper.renderTypes(t);
    assertNotNull(h);
    assertEquals("import foo.bar.Baz", h.trim());
    t = PackageHeaderHelper.parseHeader(h);
    assertEquals(1, t.imports.size());
    Import i = (Import) t.imports.get(0);
    assertEquals("foo.bar.Baz", i.type);

    t.globals.add(new Global("foo.Bar", "xs"));
    t.globals.add(new Global("whee.wah", "tt"));
    h = PackageHeaderHelper.renderTypes(t);
View Full Code Here

          if (tk.startsWith("import")) {
            tk = tk.substring(6).trim();
            if (tk.endsWith(";")) {
              tk = tk.substring(0, tk.length() - 1);
            }
            t.imports.add(new Import(tk));
          } else if (tk.startsWith("global")) {
            tk = tk.substring(6).trim();
            if (tk.endsWith(";")) {
              tk = tk.substring(0, tk.length() - 1);
            }
View Full Code Here

  }

  static String renderTypes(Types t) {
    StringBuffer sb = new StringBuffer();
    for (Iterator iterator = t.imports.iterator(); iterator.hasNext();) {
      Import i = (Import) iterator.next();
      sb.append("import " + i.type + "\n");
    }

    for (Iterator it = t.globals.iterator(); it.hasNext();) {
      Global g = (Global) it.next();
View Full Code Here

                        tk = tk.substring( 6 ).trim();
                        if ( tk.endsWith( ";" ) ) {
                            tk = tk.substring( 0,
                                               tk.length() - 1 );
                        }
                        t.imports.add( new Import( tk ) );
                    } else if ( tk.startsWith( "global" ) ) {
                        tk = tk.substring( 6 ).trim();
                        if ( tk.endsWith( ";" ) ) {
                            tk = tk.substring( 0,
                                               tk.length() - 1 );
View Full Code Here

    }

    static String renderTypes(Types t) {
        StringBuilder sb = new StringBuilder();
        for ( Iterator iterator = t.imports.iterator(); iterator.hasNext(); ) {
            Import i = (Import) iterator.next();
            sb.append( "import " + i.type + "\n" );
        }

        for ( Iterator it = t.globals.iterator(); it.hasNext(); ) {
            Global g = (Global) it.next();
View Full Code Here

          if (tk.startsWith("import")) {
            tk = tk.substring(6).trim();
            if (tk.endsWith(";")) {
              tk = tk.substring(0, tk.length() - 1);
            }
            t.imports.add(new Import(tk));
          } else if (tk.startsWith("global")) {
            tk = tk.substring(6).trim();
            if (tk.endsWith(";")) {
              tk = tk.substring(0, tk.length() - 1);
            }
View Full Code Here

  }

  static String renderTypes(Types t) {
    StringBuffer sb = new StringBuffer();
    for (Iterator iterator = t.imports.iterator(); iterator.hasNext();) {
      Import i = (Import) iterator.next();
      sb.append("import " + i.type + "\n");
    }

    for (Iterator it = t.globals.iterator(); it.hasNext();) {
      Global g = (Global) it.next();
View Full Code Here

        assertNotNull(t.globals);
        assertNotNull(t.imports);

        assertEquals(0, t.globals.size());
        assertEquals(3, t.imports.size());
        Import i = (Import) t.imports.get(0);
        assertEquals("goo.bar.Whee", i.type);

        i = (Import) t.imports.get(1);
        assertEquals("wee.waah.Foo", i.type);
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.packages.PackageHeaderWidget.Import

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.