Analizo

 view release on metacpan or  search on metacpan

t/Analizo/Command.t  view on Meta::CPAN

}

sub execute_some_command : Tests {
  my $analizo = Analizo->new;
  my $return = $analizo->execute_command( $analizo->prepare_command('fake') );
  is($return, "command fake executed");
}

sub executing_commands_with_version_argument_is_not_allowed : Tests {
  my $analizo = Analizo->new;
  throws_ok {
    $analizo->execute_command( $analizo->prepare_command('fake', '--version') )
  } qr /Invalid option/;
}

__PACKAGE__->runtests;

package t::Analizo::Command::fake;
use Analizo -command;
use parent qw(Analizo::Command);
sub validate {}

t/samples/abstract_class/java/AbstractDao.java  view on Meta::CPAN

/**
 * Parent class of all Kalibro data access objects. Contains utility data access methods.
 *
 * @author Carlos Morais
 */

public abstract class AbstractDao {

    protected DatabaseConnector connector;

    public AbstractDao() throws SQLException {
        this(new DatabaseConnector());
    }

    public AbstractDao(DatabaseConnector connector) {
        this.connector = connector;
    }

    /**
     * Returns the string quoted (with simple quotes).

t/samples/abstract_class/java/AbstractDao.java  view on Meta::CPAN

        String result = skeleton;
        for (KalibroType object : objects)
            result = prepare(result, object);
        return result;
    }

    /**
     * Does what ResultSet.getDouble() does, but when the field content is null, returns a null
     * Double object instead of 0.0
     */
    protected Double getDouble(ResultSet resultSet, String column) throws SQLException {
        double value = resultSet.getDouble(column);
        return resultSet.wasNull() ? null : value;
    }
}

t/samples/mlpack-3.0.0/parse_command_line.hpp  view on Meta::CPAN

  {
    Log::Fatal << "Caught exception from parsing command line: " << ex.what()
        << std::endl;
  }

  // Now iterate through the filled vmap, and overwrite default values with
  // anything that's found on the command line.
  for (variables_map::iterator i = vmap.begin(); i != vmap.end(); ++i)
  {
    // There is not a possibility of an unknown option, since
    // boost::program_options would have already thrown an exception.  Because
    // some names may be mapped, we have to look through each ParamData object
    // and get its boost name.
    const std::string identifier = boostNameMap[i->first];
    util::ParamData& param = parameters[identifier];
    param.wasPassed = true;
    CLI::GetSingleton().functionMap[param.tname]["SetParam"](param,
        (void*) &vmap[i->first].value(), NULL);
  }

  // Flush the buffer, make sure changes are propagated to vmap.



( run in 0.307 second using v1.01-cache-2.11-cpan-496ff517765 )