Examples of Solutions


Examples of com.redhat.gss.redhat_support_lib.infrastructure.Solutions

      String proxyPassword, URL proxyUrl, int proxyPort, String userAgent) {
    config = new ConfigHelper(username, password, url, proxyUser,
        proxyPassword, proxyUrl, proxyPort, userAgent, false);
    connectionManager = new ConnectionManager(config);

    solutions = new Solutions(connectionManager);
    articles = new Articles(connectionManager);
    cases = new Cases(connectionManager);
    products = new Products(connectionManager);
    comments = new Comments(connectionManager);
    entitlements = new Entitlements(connectionManager);
View Full Code Here

Examples of com.redhat.gss.redhat_support_lib.infrastructure.Solutions

      String proxyPassword, URL proxyUrl, int proxyPort, String userAgent, boolean isDevel) {
    config = new ConfigHelper(username, password, url, proxyUser,
        proxyPassword, proxyUrl, proxyPort, userAgent, isDevel);
    connectionManager = new ConnectionManager(config);

    solutions = new Solutions(connectionManager);
    articles = new Articles(connectionManager);
    cases = new Cases(connectionManager);
    products = new Products(connectionManager);
    comments = new Comments(connectionManager);
    entitlements = new Entitlements(connectionManager);
View Full Code Here

Examples of com.redhat.gss.redhat_support_lib.infrastructure.Solutions

    config = new ConfigHelper(username, password, url, proxyUsername,
        proxyPassword, hostUrl, proxyPort, ftpHost, ftpPort,
        ftpUsername, ftpPassword, devel);
    connectionManager = new ConnectionManager(config);

    solutions = new Solutions(connectionManager);
    articles = new Articles(connectionManager);
    cases = new Cases(connectionManager);
    products = new Products(connectionManager);
    comments = new Comments(connectionManager);
    entitlements = new Entitlements(connectionManager);
View Full Code Here

Examples of com.redhat.gss.redhat_support_lib.infrastructure.Solutions

 
  public API(String configFileName) throws IOException {
    config = new ConfigHelper(configFileName);
    connectionManager = new ConnectionManager(config);

    solutions = new Solutions(connectionManager);
    articles = new Articles(connectionManager);
    cases = new Cases(connectionManager);
    products = new Products(connectionManager);
    comments = new Comments(connectionManager);
    entitlements = new Entitlements(connectionManager);
View Full Code Here

Examples of spark.api.Solutions

            new Object[] { null },
        });
   
    DummySherpaServer server = new DummySherpaServer(data);
    try {
      Solutions s = helpExecuteQuery(server, 10);
      String var = "a";
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(uri, s.getBinding(var));
      Assert.assertEquals(uri.getURI(), s.getURI(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(lit1, s.getBinding(var));
      Assert.assertEquals(lit1, s.getLiteral(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(lit2, s.getBinding(var));
      Assert.assertEquals(lit2, s.getLiteral(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(lit3, s.getBinding(var));
      Assert.assertEquals(lit3, s.getLiteral(var));
      Assert.assertEquals(d, s.getDateTime(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aInt, s.getBinding(var));
      Assert.assertEquals(aInt, s.getLiteral(var));
      Assert.assertEquals(20, s.getInt(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aLong, s.getBinding(var));
      Assert.assertEquals(aLong, s.getLiteral(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aBool, s.getBinding(var));
      Assert.assertEquals(aBool, s.getLiteral(var));
      Assert.assertEquals(true, s.getBoolean(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aFloat, s.getBinding(var));
      Assert.assertEquals(aFloat, s.getLiteral(var));
      Assert.assertTrue(Float.valueOf(aFloat.getLexical()).equals(s.getFloat(var)));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aDouble, s.getBinding(var));
      Assert.assertEquals(aDouble, s.getLiteral(var));
      Assert.assertTrue(Double.valueOf(aDouble.getLexical()).equals(s.getDouble(var)));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(aString, s.getBinding(var));
      Assert.assertEquals(aString, s.getLiteral(var));
      Assert.assertEquals("abcd", s.getString(var));
     
      Assert.assertTrue(s.next());
      Assert.assertEquals(bn, s.getBinding(var));
      Assert.assertEquals(bn, s.getBlankNode(var));
     
      Assert.assertTrue(s.next());
      Assert.assertNull(s.getBinding(var));
      Assert.assertFalse(s.isBound(var));
      Assert.assertNull(s.getNamedNode(var));
      Assert.assertNull(s.getLiteral(var));
      Assert.assertNull(s.getBlankNode(var));
     
      Assert.assertFalse(s.next());
    } finally {
      server.shutdown();
    }
  }
View Full Code Here

Examples of spark.api.Solutions

 
  public static void testQuery() throws Exception {
    DataSource myDS = new ProtocolDataSource("http://DBpedia.org/sparql");
    Connection conn = myDS.getConnection(NoCredentials.INSTANCE);
    Command query = conn.createCommand("SELECT ?p ?o WHERE { <http://dbpedia.org/resource/Terry_Gilliam> ?p ?o }");   
    Solutions solutions = query.executeQuery();
   
    showMetadata(solutions);
    logger.debug("vars = {}", solutions.getVariables());
    int row = 0;
    while(solutions.next()) {
      logger.debug("Row {}: {}", ++row, solutions.getResult());
    }
    solutions.close();
    query.close();
    conn.close();
    myDS.close();
  }
View Full Code Here

Examples of spark.api.Solutions

 
  public static void testQuery2() throws Exception {
    DataSource myDS = new ProtocolDataSource("http://DBpedia.org/sparql");
    Connection conn = myDS.getConnection(NoCredentials.INSTANCE);
    Command query = conn.createCommand("SELECT ?p ?o WHERE { <http://dbpedia.org/resource/Terry_Gilliam> ?p ?o }");   
    Solutions solutions = query.executeQuery();
   
    showMetadata(solutions);
    logger.debug("vars = {}", solutions.getVariables());
    int row = 0;
    for(Map<String, RDFNode> solution : solutions) {
      logger.debug("Row {}: {}", ++row, solution);
    }
    solutions.close();
    query.close();
    conn.close();
    myDS.close();
  }
View Full Code Here

Examples of spark.api.Solutions

      public void run() {
        Connection c = f.getSource().getConnection(NoCredentials.INSTANCE);
        Command cmd = c.createCommand("SELECT ?p ?o WHERE { <http://dbpedia.org/resource/Terry_Gilliam> ?p ?o }");
        cmd.setTimeout(30);
        try {
          Solutions s = cmd.executeQuery();
          Assert.assertNotNull(s);
          try {
            Assert.assertEquals(Arrays.asList("p", "o"), s.getVariables());
            int count = 0;
            while (s.next()) {
              count++;
              Assert.assertNotNull(s.getBinding("p"));
              Assert.assertNotNull(s.getBinding("o"));
            }
            Assert.assertEquals(121, count);
          } finally {
            try {
              s.close();
            } catch (IOException e) {
              throw new RuntimeException("Error closing solutions.", e);
            }
          }
        } finally {
View Full Code Here

Examples of spark.api.Solutions

  }
 
  static void exec(Command cmd) {
    try {
      log("submitting query");
      Solutions s = cmd.executeQuery();
      log("got response");
      try {
        int count = 0;
        while (s.next()) count++;
        log("found " + count + " solutions");
      } finally {
        s.close();
      }
    } catch (Exception e) {
      log("Exception (" + e.getMessage() + ")");
    }
  }
View Full Code Here

Examples of spark.api.Solutions

    final CountDownLatch done2 = new CountDownLatch(1);
    new Thread(new Runnable() {
      public void run() {
        try {
          log("executing query 2");
          Solutions s = c.executeQuery();
          log("query 2 done");
          try {
            query.countDown();
            cancel.await();
            log("getting query 2 result");
            int count = 0;
            while (s.next()) count++;
            log("query 2 found " + count + "results");
          } catch (InterruptedException e) {
            log("interrupted!");
          } finally {
            try {
              s.close();
            } catch (IOException e) {
              log("IOException (" + e + ")");
            }
          }
        } finally {
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.