Examples of unwrap()


Examples of javax.security.sasl.SaslClient.unwrap()

        CallbackHandler cbH = new cbHandN();
        SaslClient saslC = Sasl.createSaslClient(new String[] { "NAME-2" },
                null, "protocol", null, null, cbH);
        assertNotNull("Null result", saslC);
        try {
            saslC.unwrap(null, 1, 1);
            fail("SaslException sould be thrown");
        } catch (SaslException e) {
        }
        assertFalse("Incorrect isComplete() result", saslC.isComplete());
        // try to create client for wrong mechanism
View Full Code Here

Examples of javax.security.sasl.SaslServer.unwrap()

        CallbackHandler cbH = new Sasl3Test.cbHandN();
        SaslServer saslS = Sasl.createSaslServer("MECH-2", "protocol", null,
                null, cbH);
        assertNotNull("Null result", saslS);
        try {
            saslS.unwrap(null, 1, 1);
            fail("SaslException sould be thrown");
        } catch (SaslException e) {
        }
        assertFalse("Incorrect isComplete() result", saslS.isComplete());
        // try to create Server for wrong mechanism
View Full Code Here

Examples of javax.validation.ConstraintValidatorContext.unwrap()

  }

  @Test(expectedExceptions = ValidationException.class)
  public void testUnwrapToImplementationCausesValidationException() {
    ConstraintValidatorContext context = createEmptyConstraintValidatorContextImpl();
    context.unwrap( ConstraintValidatorContextImpl.class );
  }

  @Test
  public void testUnwrapToPublicTypesSucceeds() {
    ConstraintValidatorContext context = createEmptyConstraintValidatorContextImpl();
View Full Code Here

Examples of javax.validation.MessageInterpolator.Context.unwrap()

  }

  @Test(expectedExceptions = ValidationException.class)
  public void testUnwrapToImplementationCausesValidationException() {
    Context context = new MessageInterpolatorContext( null, null, null, Collections.<String, Object>emptyMap() );
    context.unwrap( MessageInterpolatorContext.class );
  }

  @Test
  public void testUnwrapToInterfaceTypesSucceeds() {
    Context context = new MessageInterpolatorContext( null, null, null, Collections.<String, Object>emptyMap() );
View Full Code Here

Examples of javax.validation.Validator.unwrap()

        return new TestSuite(MethodValidatorImplTest.class);
    }

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
View Full Code Here

Examples of javax.validation.Validator.unwrap()

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
View Full Code Here

Examples of javax.validation.Validator.unwrap()

    public void testUnwrap() {
        Validator v = getValidator();
        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
        assertTrue(mv == mv.unwrap(ClassValidator.class));
View Full Code Here

Examples of javax.validation.Validator.unwrap()

        ClassValidator cv = v.unwrap(ClassValidator.class);
        assertTrue(v == cv);
        assertTrue(v == v.unwrap(Validator.class));
        MethodValidatorImpl mvi = v.unwrap(MethodValidatorImpl.class);
        assertNotNull(mvi);
        MethodValidator mv = v.unwrap(MethodValidator.class);
        assertNotNull(mv);
        assertTrue(mv == mv.unwrap(MethodValidatorImpl.class));
        assertTrue(mv == mv.unwrap(ClassValidator.class));
    }
View Full Code Here

Examples of javax.validation.Validator.unwrap()

     */
    public Object invoke(MethodInvocation invocation) throws Throwable {
        Validate validate = invocation.getMethod().getAnnotation(Validate.class);

        Validator validator = this.validatorProvider.get();
        MethodValidator methodValidator = validator.unwrap(MethodValidator.class);

        Set<ConstraintViolation<?>> constraintViolations = new HashSet<ConstraintViolation<?>>();
        Class<?> clazz = invocation.getMethod().getDeclaringClass();
        Method method = invocation.getMethod();
        Object[] arguments = invocation.getArguments();
View Full Code Here

Examples of javax.validation.ValidatorFactory.unwrap()

  public void testFailFastSetOnValidatorFactory() {
    final HibernateValidatorConfiguration configuration = ValidatorUtil.getConfiguration( HibernateValidator.class );
    final ValidatorFactory factory = configuration.buildValidatorFactory();

    final Validator validator =
        factory.unwrap( HibernateValidatorFactory.class )
            .usingContext()
            .failFast( true )
            .getValidator();
    Set<ConstraintViolation<A>> constraintViolations = validator.validate( testInstance );
    assertNumberOfViolations( constraintViolations, 1 );
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.