Examples of LibrarySet


Examples of com.github.maven_nar.cpptasks.types.LibrarySet

   * Evaluate isActive when "unless" specifies a property whose value suggests
   * the user thinks the value is significant.
   *
   */
  public final void testIsActive5() {
    LibrarySet libset = new LibrarySet();
    Project project = new Project();
    //
    // setting the value to false should throw
    //    exception to warn user that they are misusing if
    //
    project.setProperty("windows", "false");
    libset.setUnless("windows");
    try {
      boolean isActive = libset.isActive(project);
    } catch (BuildException ex) {
      return;
    }
    fail();
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

  /**
   * Evaluate isActive when "unless" specifies a property that is not set.
   */
  public final void testIsActive6() {
    LibrarySet libset = new LibrarySet();
    Project project = new Project();
    libset.setProject(project);
    libset.setUnless("windows");
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder("kernel32");
    libset.setLibs(libs);
    boolean isActive = libset.isActive(project);
    assertTrue(isActive);
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

  /**
   * The libs parameter should not end with .lib, .so, .a etc New behavior is
   * to warn if it ends in a suspicious extension.
   */
  public final void testLibContainsDot() {
    LibrarySet libset = new LibrarySet();
    Project p = new Project();
    MockBuildListener listener = new MockBuildListener();
    p.addBuildListener(listener);
    libset.setProject(p);
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder("mylib1.1");
    libset.setLibs(libs);
    assertEquals(0, listener.getMessageLoggedEvents().size());
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

   * should be kernel, not kernel.lib).  Previously the libset would
   * warn on configuration, now provides more feedback
   * when library is not found.
   */
  public final void testLibContainsDotLib() {
    LibrarySet libset = new LibrarySet();
    Project p = new Project();
    MockBuildListener listener = new MockBuildListener();
    p.addBuildListener(listener);
    libset.setProject(p);
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder(
        "mylib1.lib");
    libset.setLibs(libs);
    assertEquals(0, listener.getMessageLoggedEvents().size());
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

  /**
   * Use of a libset or syslibset without a libs attribute should log a
   * warning message.
   */
  public final void testLibNotSpecified() {
    LibrarySet libset = new LibrarySet();
    Project p = new Project();
    MockBuildListener listener = new MockBuildListener();
    p.addBuildListener(listener);
    libset.setProject(p);
    boolean isActive = libset.isActive(p);
    assertEquals(false, isActive);
    assertEquals(1, listener.getMessageLoggedEvents().size());
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

  /**
   * this threw an exception prior to 2002-09-05 and started to throw one
   * again 2002-11-19 up to 2002-12-11.
   */
  public final void testShortLibName() {
    LibrarySet libset = new LibrarySet();
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder("li");
    libset.setProject(new Project());
    libset.setLibs(libs);
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

   * pthread not libpthread).  Previously the libset would
   * warn on configuration, now provides more feedback
   * when library is not found.
   */
  public final void testStartsWithLib() {
    LibrarySet libset = new LibrarySet();
    Project p = new Project();
    MockBuildListener listener = new MockBuildListener();
    p.addBuildListener(listener);
    libset.setProject(p);
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder(
        "libmylib1");
    libset.setLibs(libs);
    assertEquals(0, listener.getMessageLoggedEvents().size());
  }
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

   *             files
   */
  public final void testVisitFiles(final Linker linker,
                                   final int expected)
      throws IOException {
    LibrarySet libset = new LibrarySet();
    Project p = new Project();
    MockBuildListener listener = new MockBuildListener();
    p.addBuildListener(listener);
    libset.setProject(p);
    //
    //   create temporary files named cpptasksXXXXX.lib
    //
    File lib1 = File.createTempFile("cpptasks", ".lib");
    String lib1Name = lib1.getName();
    lib1Name = lib1Name.substring(0, lib1Name.indexOf(".lib"));
    File lib2 = File.createTempFile("cpptasks", ".lib");
    File baseDir = lib1.getParentFile();

    //   set the dir attribute to the temporary directory
    libset.setDir(baseDir);
    //   set libs to the file name without the suffix
    CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder(lib1Name);
    libset.setLibs(libs);

    //
    //   collect all files visited
    MockFileCollector collector = new MockFileCollector();
    libset.visitLibraries(p, linker, new File[0], collector);

    //
    //  get the canonical paths for the initial and visited libraries
    String expectedCanonicalPath = lib1.getCanonicalPath();
    String actualCanonicalPath = null;
View Full Code Here

Examples of com.github.maven_nar.cpptasks.types.LibrarySet

     * a build exception will be raised.
     *
     * See bug 1380366
     */
    public final void testBadLibname() {
      LibrarySet libset = new LibrarySet();
      Project p = new Project();
      MockBuildListener listener = new MockBuildListener();
      p.addBuildListener(listener);
      libset.setProject(p);
      //   set libs to the file name without the suffix
      CUtil.StringArrayBuilder libs = new CUtil.StringArrayBuilder("badlibname");
      libset.setLibs(libs);

      //
      //   collect all files visited
      MockFileCollector collector = new MockFileCollector();
      try {
        libset.visitLibraries(p, DevStudioLinker.getInstance(), new File[0], collector);
      } catch(BuildException ex) {
          return;
      }
//
//      code around line 320 in LibrarySet that would throw BuildException
View Full Code Here

Examples of de.innovationgate.eclipse.wgadesigner.classpath.LibrarySet

        TableItem[] items = _tabLibraries.getItems();
        for (TableItem item : items) {
          if (item.getChecked()) {
            itemsChecked = true;           
            // check dependencies
            LibrarySet set = (LibrarySet) item.getData();
            if (set.getDependencies() != null) {
              for (String id : set.getDependencies()) {
                for (TableItem dependentItem : items) {
                  LibrarySet dependentSet = (LibrarySet) dependentItem.getData();
                  if (dependentSet.getId().equals(id)) {
                    dependentItem.setChecked(true);
                    dependentItem.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
                  }
                }
              }
            }                       
          } else {
            // deselect dependencies
            LibrarySet set = (LibrarySet) item.getData();
            if (set.getDependencies() != null) {
              for (String id : set.getDependencies()) {
                for (TableItem dependentItem : items) {
                  LibrarySet dependentSet = (LibrarySet) dependentItem.getData();
                  if (dependentSet.getId().equals(id)) {
                    dependentItem.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));                   
                  }
                }
              }
            }   
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.