Package org.sharpsw.crlserver.data

Examples of org.sharpsw.crlserver.data.CRLDownloadAddress


    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
    issuer.setDescription("Secretaria da Receita Federal do Brasil");
   
    CRLDownloadAddressCompositePrimaryKey key1 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url1.com/test.crl");
    CRLDownloadAddress addr1 = new CRLDownloadAddress(key1);
    addr1.setDescription("URL de teste 1");
   
    CRLDownloadAddressCompositePrimaryKey key2 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url2.com/test.crl");
    CRLDownloadAddress addr2 = new CRLDownloadAddress(key2);
    addr2.setDescription("URL de teste 2");
   
    CRLDownloadAddressCompositePrimaryKey key3 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url3.com/test.crl");
    CRLDownloadAddress addr3 = new CRLDownloadAddress(key3);
    addr3.setDescription("URL de teste 3");
   
    CRLDownloadAddressCompositePrimaryKey key4 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url4.com/test.crl");
    CRLDownloadAddress addr4 = new CRLDownloadAddress(key4);
    addr4.setDescription("URL de teste 4");
   
    CRLIssuer issuer2 = new CRLIssuer();
    issuer2.setId("2222222222222222222222222222222222222222");
    issuer2.setName("CN=Autoridade Certificadora Raiz Brasileira v1, OU=Instituto Nacional de Tecnologia da Informacao - ITI, O=ICP-Brasil, C=BR");
    issuer2.setDescription("Autoridade Certificadora Raiz Brasileira v1");
   
    CRLDownloadAddressCompositePrimaryKey key5 = new CRLDownloadAddressCompositePrimaryKey(issuer2, "http://www.url5.com/test.crl");
    CRLDownloadAddress addr5 = new CRLDownloadAddress(key5);
    addr5.setDescription("URL de teste 5");
   
    expected.add(addr1);
    expected.add(addr2);
    expected.add(addr3);
    expected.add(addr4);
View Full Code Here


      }
     
      Query query = this.getSession().createQuery("FROM CRLDownloadAddress");
      List elements = query.list();
      for(Object element : elements) {
        CRLDownloadAddress item = (CRLDownloadAddress) element;
        results.add(item);
      }
      return results;
    } catch (HibernateException exception) {
      StringBuffer message = new StringBuffer();
View Full Code Here

        Set<CRLDownloadAddress> results = new TreeSet<CRLDownloadAddress>();
        Query query = this.getSession().createQuery("FROM CRLDownloadAddress addr WHERE addr.primaryKey.crlIssuer = :issuer");
        query.setParameter("issuer", issuer);
        List elements = query.list();
        for(Object element : elements) {
          CRLDownloadAddress item = (CRLDownloadAddress) element;
          results.add(item);
        }
        return results;       
      } else {
        throw new IllegalArgumentException("The issuer argument cannot be null");
View Full Code Here

      }
     
      if(key != null) {
        Query query = this.getSession().createQuery("FROM CRLDownloadAddress addr WHERE addr.primaryKey = :pk");
        query.setParameter("pk", key);
        CRLDownloadAddress result = (CRLDownloadAddress) query.uniqueResult();
        return result;
      } else {
        throw new IllegalArgumentException("The primary key argument cannot be null");
      }
    } catch (HibernateException exception) {
View Full Code Here

     
      Set<CRLDownloadAddress> results = new TreeSet<CRLDownloadAddress>();
     
      List elements = query.list();
      for(Object element : elements) {
        CRLDownloadAddress item = (CRLDownloadAddress) element;
        results.add(item);
      }
      return results;
    } catch (HibernateException exception) {
      StringBuffer message = new StringBuffer();
View Full Code Here

    Set<CRLDownloadAddress> results = this.service.findCRLDownloadAddressByIssuer(issuer);
    Assert.assertEquals(4, results.size());

    CRLDownloadAddressCompositePrimaryKey key1 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url1.com/test.crl");
    CRLDownloadAddress addr1 = new CRLDownloadAddress(key1);
    addr1.setDescription("URL de teste 1");
   
    CRLDownloadAddressCompositePrimaryKey key2 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url2.com/test.crl");
    CRLDownloadAddress addr2 = new CRLDownloadAddress(key2);
    addr2.setDescription("URL de teste 2");
   
    CRLDownloadAddressCompositePrimaryKey key3 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url3.com/test.crl");
    CRLDownloadAddress addr3 = new CRLDownloadAddress(key3);
    addr3.setDescription("URL de teste 3");
   
    CRLDownloadAddressCompositePrimaryKey key4 = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url4.com/test.crl");
    CRLDownloadAddress addr4 = new CRLDownloadAddress(key4);
    addr4.setDescription("URL de teste 4");

   
    Set<CRLDownloadAddress> expected = new TreeSet<CRLDownloadAddress>();
    expected.add(addr1);
    expected.add(addr2);
View Full Code Here

    Set<CRLDownloadAddress> results = this.service.findCRLDownloadAddressByIssuer(issuer);
    Assert.assertEquals(1, results.size());

    CRLDownloadAddressCompositePrimaryKey key = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url5.com/test.crl");
    CRLDownloadAddress addr1 = new CRLDownloadAddress(key);
    addr1.setDescription("URL de teste 5");
  }
View Full Code Here

    issuer.setId("1111111111111111111111111111111111111111");
    issuer.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
    issuer.setDescription("Secretaria da Receita Federal do Brasil");
   
    CRLDownloadAddressCompositePrimaryKey pk = new CRLDownloadAddressCompositePrimaryKey(issuer, "http://www.url1.com/test.crl");
    CRLDownloadAddress actual = this.service.findCRLDownloadAddressByPrimaryKey(pk);
   
    CRLDownloadAddress expected = new CRLDownloadAddress(pk);
    expected.setDescription("URL de teste 1");
   
    Assert.assertEquals(expected, actual);
  }
View Full Code Here

    issuer2.setId("2222222222222222222222222222222222222222");
    issuer2.setName("CN=Autoridade Certificadora Raiz Brasileira v1, OU=Instituto Nacional de Tecnologia da Informacao - ITI, O=ICP-Brasil, C=BR");
    issuer2.setDescription("Autoridade Certificadora Raiz Brasileira v1");
   
    CRLDownloadAddressCompositePrimaryKey key1 = new CRLDownloadAddressCompositePrimaryKey(issuer1, "http://www.url1.com/test.crl");
    CRLDownloadAddress addr1 = new CRLDownloadAddress(key1);
    addr1.setDescription("URL de teste 1");
   
    CRLDownloadAddressCompositePrimaryKey key2 = new CRLDownloadAddressCompositePrimaryKey(issuer1, "http://www.url2.com/test.crl");
    CRLDownloadAddress addr2 = new CRLDownloadAddress(key2);
    addr2.setDescription("URL de teste 2");
   
    CRLDownloadAddressCompositePrimaryKey key3 = new CRLDownloadAddressCompositePrimaryKey(issuer1, "http://www.url3.com/test.crl");
    CRLDownloadAddress addr3 = new CRLDownloadAddress(key3);
    addr3.setDescription("URL de teste 3");
   
    CRLDownloadAddressCompositePrimaryKey key4 = new CRLDownloadAddressCompositePrimaryKey(issuer1, "http://www.url4.com/test.crl");
    CRLDownloadAddress addr4 = new CRLDownloadAddress(key4);
    addr4.setDescription("URL de teste 4");
   
    CRLDownloadAddressCompositePrimaryKey key5 = new CRLDownloadAddressCompositePrimaryKey(issuer2, "http://www.url5.com/test.crl");
    CRLDownloadAddress addr5 = new CRLDownloadAddress(key5);
    addr5.setDescription("URL de teste 5");
   
    expected.add(addr1);
    expected.add(addr2);
    expected.add(addr3);
    expected.add(addr4);
View Full Code Here

    issuer1.setName("CN=AC Secretaria da Receita Federal do Brasil, O=ICP-Brasil, C=BR");
    issuer1.setDescription("Secretaria da Receita Federal do Brasil");
   
   
    CRLDownloadAddressCompositePrimaryKey key1 = new CRLDownloadAddressCompositePrimaryKey(issuer1, "http://www.url1.com/test.crl");
    CRLDownloadAddress addr1 = new CRLDownloadAddress(key1);
    addr1.setDescription("URL de teste 1");
   
    expected.add(addr1);
   
    Assert.assertEquals(expected, results);
   }
View Full Code Here

TOP

Related Classes of org.sharpsw.crlserver.data.CRLDownloadAddress

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.