Examples of compare()


Examples of netscape.ldap.LDAPConnection.compare()

        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        // comparison success
        LDAPAttribute attribute = new LDAPAttribute( "uid", "akarasuluref" );
        assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );

        // comparison failure
        attribute = new LDAPAttribute( "uid", "elecharny" );
        assertFalse( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
View Full Code Here

Examples of no.priv.garshol.duke.Processor.compare()

      List<GeneticConfiguration> configs = population.getConfigs();
      boolean[] believers = new boolean[configs.size()];
      for (int ix = 0; ix < configs.size(); ix++) {
        Configuration config = configs.get(ix).getConfiguration();
        Processor proc = new Processor(config, database);
        believers[ix] = proc.compare(r1, r2) > config.getThreshold();
      }
      return believers;
    }
  }
View Full Code Here

Examples of no.priv.garshol.duke.comparators.WeightedLevenshtein.compare()

  }

  @Test
  public void testComparator() {
    WeightedLevenshtein comp = new WeightedLevenshtein();
    assertEquals(0.0, comp.compare("1", ""));
  }
}
View Full Code Here

Examples of ns.foundation.NSTimestamp.compare()

    NSTimestamp firstTime = new NSTimestamp();
    Date date = new Date(firstTime.getTime() + 1000);
    NSTimestamp nextTime = new NSTimestamp(date);
    assertEquals(-1, firstTime.compare(nextTime));
    assertEquals(0, firstTime.compare(firstTime));
    assertEquals(1, nextTime.compare(firstTime));
  }

  @SuppressWarnings("deprecation")
  private static Date jan1() {
    Date d = new Date(108, 0, 1, 0, 0, 0);
View Full Code Here

Examples of org.acegisecurity.ldap.LdapTemplate.compare()

        }

        String encodedPassword = passwordEncoder.encodePassword(password, null);
        byte[] passwordBytes = LdapUtils.getUtf8Bytes(encodedPassword);

        if (!ldapTemplate.compare(user.getDn(), passwordAttributeName, passwordBytes)) {
            throw new BadCredentialsException(messages.getMessage("PasswordComparisonAuthenticator.badCredentials",
                    "Bad credentials"));
        }

        return user;
View Full Code Here

Examples of org.apache.accumulo.core.security.ColumnVisibility.NodeComparator.compare()

  @Test
  public void testEmptyParseTreesAreEqual() {
    Comparator<Node> comparator = new NodeComparator(new byte[] {});
    Node empty = new ColumnVisibility().getParseTree();
    assertEquals(0, comparator.compare(empty, parse("")));
  }

  @Test
  public void testParseTreesOrdering() {
    byte[] expression = "(b&c&d)|((a|m)&y&z)|(e&f)".getBytes(Constants.UTF8);
View Full Code Here

Examples of org.apache.ace.client.repository.stateful.impl.LogEventComparator.compare()

    public void testLogEvents() {
      LogEventComparator c = new LogEventComparator();
      LogEvent left = new LogEvent("t", 1, 1, -1000000000000000000L, 0, null);
      LogEvent right = new LogEvent("t", 1, 1, 1, 0, null);
      Assert.assertTrue((left.getTime() - right.getTime()) < 0L);
      Assert.assertTrue(c.compare(left, right) < 0L);
    }
}
View Full Code Here

Examples of org.apache.axiom.om.impl.llom.util.XMLComparator.compare()

        XMLComparator comparator = new XMLComparator();

        OMElement inputOM = createOMElement(inputXml);
        Mediator mediator = mediatorFactory.createMediator(inputOM);
        OMElement resultOM = mediatorSerializer.serializeMediator(null, mediator);
        return comparator.compare(resultOM, inputOM);
    }

    private OMElement createOMElement(String xml) {
        try {
View Full Code Here

Examples of org.apache.axiom.testutils.stax.XMLStreamReaderComparator.compare()

        XMLStreamReader expected = StAXUtils.createXMLStreamReader(
                getTestResource(TestConstants.MTOM_MESSAGE_INLINED));
        XMLStreamReader actual = getXOPDecodingStreamReader();
        XMLStreamReaderComparator comparator = new XMLStreamReaderComparator(expected, actual);
        comparator.addPrefix("xop");
        comparator.compare();
        expected.close();
        actual.close();
    }
   
    public void testGetElementText() throws Exception {
View Full Code Here

Examples of org.apache.axis2.XMLComparatorInterop.compare()

                    XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(stream);
                    OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
                    SOAPEnvelope refEnv = (SOAPEnvelope) builder.getDocumentElement();
                    //OMElement refNode = (OMElement) resEnv.getBody().getFirstElement();
                    XMLComparatorInterop comparator = new XMLComparatorInterop();
                    ok = comparator.compare(retEnv, refEnv);
                } else
                    return false;
            } else
                return false;
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.