Package org.grouplens.lenskit.eval

Examples of org.grouplens.lenskit.eval.EvalProject$Listener


         private final boolean hidePrivate = vizState.hidePrivate(), hideMeta = vizState.hideMeta();
         {
            do_start();
            setRootVisible(false);
            setShowsRootHandles(false);
            listeners.add(new Listener() {
               public Object do_action(Object sender, Event event) { return null; }
               public Object do_action(Object sender, Event event, Object arg) { zoom(arg); return null; }
            });
         }
         @Override public String convertValueToText(Object value, boolean sel, boolean expand, boolean leaf, int i, boolean focus) {
View Full Code Here


     * Create a simple evaluator with a custom configuration.
     *
     * @param props Properties for the eval configuration.
     */
    public SimpleEvaluator(Properties props) {
        project = new EvalProject(props, null);
        result = new TrainTestEvalTask("simple-eval");
        result.setProject(project);
        result.setOutput((File) null);
    }
View Full Code Here

        logger.info("loading evaluation from {}", file);

        EvalScriptEngine engine = new EvalScriptEngine(environment.getClassLoader(),
                                                       getProperties());

        EvalProject project = engine.loadProject(file);
        if (getTargets().isEmpty()) {
            String dft = project.getDefaultTarget();
            if (dft != null) {
                project.executeTarget(dft);
            } else if (!project.getAntProject().getTargets().isEmpty()) {
                String targets = Joiner.on(", ")
                                       .join(project.getAntProject().getTargets().keySet());
                logger.error("No targets specified and no default provided (try one of: {})",
                             targets);
                System.exit(2);
            }
        } else {
            project.executeTargets(getTargets());
        }
    }
View Full Code Here

            System.err.println("run lenskit-eval --help for more information");
            System.exit(1);
        }
        logger.info("loading evaluation from {}", f);
        try {
            EvalProject project = engine.loadProject(f);
            if (options.getArgs().length == 0) {
                String dft = project.getDefaultTarget();
                if (dft == null && !project.getAntProject().getTargets().isEmpty()) {
                    String targets = Joiner.on(", ")
                                           .join(Iterables.transform(
                                                   project.getAntProject().getTargets().keySet(),
                                                   new Function<Object,Object>() {
                                                       @Nullable
                                                       @Override
                                                       public Object apply(@Nullable Object input) {
                                                           return input == null ? null : input;
                                                       }
                                                   }));
                    logger.error("No targets specified and no default provided (try one of: {})",
                                 targets);
                    System.exit(2);
                }
                project.executeTarget(dft);
            } else {
                project.executeTargets(options.getArgs());
            }
        } catch (TaskExecutionException e) {
            // we handle these specially
            reportError(e.getCause(), "%s: %s", f.getPath(), e.getMessage());
        } catch (IOException e) {
View Full Code Here

    /**
     * Create a new eval project.
     * @return The eval project.
     */
    public EvalProject createProject() {
        return new EvalProject(properties, classLoader);
    }
View Full Code Here

     * @throws org.grouplens.lenskit.eval.TaskExecutionException if there is a configuration error
     * @throws IOException      if there is an error reading the file
     */
    public EvalProject loadProject(File file) throws TaskExecutionException, IOException {
        logger.debug("loading script file {}", file);
        EvalProject project = new EvalProject(properties, classLoader);
        runScript(file, project);
        return project;
    }
View Full Code Here

     * @param in The input stream
     * @return A list of evaluations
     * @throws org.grouplens.lenskit.eval.TaskExecutionException if there is a configuration error
     */
    public Object loadProject(Reader in) throws TaskExecutionException, IOException {
        EvalProject project = createProject();
        runScript(in, project);
        return project;
    }
View Full Code Here

        final XMLBeansModel model = new XMLBeansModel(Factory.parse(is).getJbossesb());
       
        final List<Listener> awareListeners = model.getESBAwareListeners() ;
        assertEquals("Listener count", 1, awareListeners.size()) ;
       
        final Listener listener = awareListeners.get(0) ;
        assertTrue("JmsListener", listener instanceof JmsListener) ;
       
        final Document doc = YADOMUtil.createDocument() ;
        final Element root = doc.createElement("root") ;
        final Element listenerElement = JmsListenerMapper.map(root, (JmsListener)listener, model) ;
View Full Code Here

    JmsMessageFilter listenerDestination = awareListener.getJmsMessageFilter();
    assertEquals("queue/B", listenerDestination.getDestName());
    assertEquals(JmsMessageFilter.DestType.TOPIC, listenerDestination.getDestType());
    assertEquals("service='Reconciliation'", listenerDestination.getSelector());

    Listener untypedAwareListener = awareListeners.get(1);
    assertEquals("Bank-Listener-Generic", untypedAwareListener.getName());
    assertEquals("my-generic-bus", untypedAwareListener.getBusidref());
    assertTrue(!untypedAwareListener.getIsGateway());

    Service gatewayService = model.getService(gatewayListener);
    Service awareService = model.getService(awareListener);
    assertSame(gatewayService, awareService);
    assertEquals("Bank", awareService.getCategory());
View Full Code Here

        final XMLBeansModel model = new XMLBeansModel(Factory.parse(is).getJbossesb());
       
        final List<Listener> awareListeners = model.getESBAwareListeners() ;
        assertEquals("Listener count", 1, awareListeners.size()) ;
       
        final Listener listener = awareListeners.get(0) ;
        assertTrue("JmsListener", listener instanceof JmsListener) ;
       
        final Document doc = YADOMUtil.createDocument() ;
        final Element root = doc.createElement("root") ;
        final Element listenerElement = JmsListenerMapper.map(root, (JmsListener)listener, model) ;
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.eval.EvalProject$Listener

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.