Package com.github.maven_nar.cpptasks

Examples of com.github.maven_nar.cpptasks.ProcessorDef


  /**
   * Tests that the unless attribute in the base processor is effective when
   * evaluating if an extending processor is active.
   */
  public final void testExtendsUnless() {
    ProcessorDef baseLinker = create();
    baseLinker.setUnless("bogus");
    ProcessorDef extendedLinker = createExtendedProcessorDef(baseLinker);
    boolean isActive = extendedLinker.isActive();
    assertEquals(true, isActive);
    baseLinker.getProject().setProperty("bogus", "");
    isActive = extendedLinker.isActive();
    assertEquals(false, isActive);
  }
View Full Code Here


  /**
   * Tests that the debug attribute in the base processor is effective when
   * creating the command line for a processor that extends it.
   */
  public final void testExtendsDebug() {
    ProcessorDef baseLinker = create();
    baseLinker.setDebug(true);
    ProcessorDef extendedLinker = createExtendedProcessorDef(baseLinker);
    String[] preArgs = getPreArguments(extendedLinker);
    // FREEHEP, passes (sometimes) extra option
    assertEquals("-g", preArgs[Math.max(preArgs.length - 2, 0)]);
  }
View Full Code Here

   *            processor under test
   */
  protected final void testExtendsRebuild(
      final ProcessorDef baseProcessor) {
    baseProcessor.setRebuild(true);
    ProcessorDef extendedLinker = createExtendedProcessorDef(baseProcessor);
    ProcessorConfiguration config = getConfiguration(extendedLinker);
    boolean rebuild = config.getRebuild();
    assertEquals(true, rebuild);
  }
View Full Code Here

  /**
   * Tests that isActive returns true when "if" references a set property.
   */
  public final void testIsActive2() {
    ProcessorDef arg = create();
    Project project = new Project();
    project.setProperty("cond", "");
    arg.setProject(project);
    arg.setIf("cond");
    assertTrue(arg.isActive());
  }
View Full Code Here

  /**
   * Tests that isActive returns false when "if" references an unset property.
   */
  public final void testIsActive3() {
    ProcessorDef arg = create();
    arg.setProject(new Project());
    arg.setIf("cond");
    assertTrue(!arg.isActive());
  }
View Full Code Here

   * Tests that evaluating isActive when "if" refernces a property with the
   * value "false" throws an exception to warn of a suspicious value.
   *
   */
  public final void testIsActive4() {
    ProcessorDef arg = create();
    Project project = new Project();
    project.setProperty("cond", "false");
    arg.setProject(project);
    arg.setIf("cond");
    try {
      boolean isActive = arg.isActive();
    } catch (BuildException ex) {
      return;
    }
    fail("Should throw exception for suspicious value");
  }
View Full Code Here

  /**
   * Tests that isActive returns false when "unless" references a set
   * property.
   */
  public final void testIsActive5() {
    ProcessorDef arg = create();
    Project project = new Project();
    project.setProperty("cond", "");
    arg.setProject(project);
    arg.setUnless("cond");
    assertTrue(!arg.isActive());
  }
View Full Code Here

  /**
   * Tests that isActive returns true when "unless" references an unset
   * property.
   */
  public final void testIsActive6() {
    ProcessorDef arg = create();
    arg.setProject(new Project());
    arg.setUnless("cond");
    assertTrue(arg.isActive());
  }
View Full Code Here

   * Tests that evaluating isActive when "unless" references a property with
   * the value "false" throws an exception to warn of a suspicious value.
   *
   */
  public final void testIsActive7() {
    ProcessorDef arg = create();
    Project project = new Project();
    project.setProperty("cond", "false");
    arg.setProject(project);
    arg.setUnless("cond");
    try {
      boolean isActive = arg.isActive();
    } catch (BuildException ex) {
      return;
    }
    fail("Should throw exception for suspicious value");
  }
View Full Code Here

   * Tests if a processor is active when both "if" and "unless" are specified
   * and the associated properties are set.
   *
   */
  public final void testIsActive8() {
    ProcessorDef arg = create();
    Project project = new Project();
    project.setProperty("cond", "");
    arg.setProject(project);
    arg.setIf("cond");
    arg.setUnless("cond");
    assertTrue(!arg.isActive());
  }
View Full Code Here

TOP

Related Classes of com.github.maven_nar.cpptasks.ProcessorDef

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.