Package com.github.jmkgreen.morphia.testutil

Examples of com.github.jmkgreen.morphia.testutil.AssertedFailure


  @Test
  public void testEmptyCollectionAcceptance() throws Exception {
    Query<E> q = ds.createQuery(E.class);
    final FieldEnd<?> e = q.field("_id");
   
    new AssertedFailure() {
      public void thisMustFail() throws Throwable {
        e.hasAllOf(Collections.EMPTY_LIST);
      }
    };
   
    new AssertedFailure() {
      public void thisMustFail() throws Throwable {
        e.hasNoneOf(Collections.EMPTY_LIST);
      }
    };
   
View Full Code Here


    morphia.map(NameValuePairContainer.class);
    final NameValuePairContainer container = new NameValuePairContainer();
    container.pair = new NameValuePair<Name, Double>(Name.FOO, Double.valueOf(1.2d));
    ds.save(container);
   
    new AssertedFailure() {
      @Override
      public void thisMustFail() throws Throwable {
        // FIXME : shouldn't fail
        ds.get(container);
       
View Full Code Here

  public static class R {
  }
 
  @Test
  public void testCheck() {
    new AssertedFailure(ConstraintViolationException.class) {
      public void thisMustFail() throws Throwable {
        morphia.map(E.class);
      }
    };
  }
View Full Code Here

    E2 e2 = new E2();
    e.e2 = e2;
   
    ds.save(e); // does not fail due to preinited Ids

    new AssertedFailure(MappingException.class) {
      @Override
      protected void thisMustFail() throws Throwable {
        ds.createQuery(E.class).asList();
      }
    };
View Full Code Here

    long v1;
  }
 
  @Test
  public void testCheck() {
    new AssertedFailure(ConstraintViolationException.class) {
      public void thisMustFail() throws Throwable {
        morphia.map(Fail1.class);
      }
    };
    morphia.map(OK1.class);
View Full Code Here

    E2 e2 = new E2();
    e.e2 = e2;
   
    ds.save(e); // does not fail due to preinited Ids
   
    new AssertedFailure(MappingException.class) {
      @Override
      protected void thisMustFail() throws Throwable {
        ds.createQuery(ELazy.class).asList();
      }
    };
View Full Code Here

   
    ds.save(e); // does not fail due to preinited Ids
    Iterator<ELazyIgnoreMissing> i = ds.createQuery(ELazyIgnoreMissing.class).iterator();
    final ELazyIgnoreMissing x = i.next();

    new AssertedFailure() {
      @Override
      protected void thisMustFail() throws Throwable {
        // reference must be resolved for this
        x.e2.foo();
      }
View Full Code Here

 
  @Test
  public void testCheck() {
    morphia.map(Map1.class);
   
    new AssertedFailure() {
      public void thisMustFail() throws Throwable {
        morphia.map(Map2.class);
      }
    };
   
    new AssertedFailure() {
      public void thisMustFail() throws Throwable {
        morphia.map(Map3.class);
      }
    };
  }
View Full Code Here

    morphia.map(Valid.class);
  }
 
  @Test
  public void testInValidInnerClass() throws Exception {
    new AssertedFailure(MappingException.class) {
      @Override
      protected void thisMustFail() throws Throwable {
        morphia.map(InValid.class);
      }
    };
View Full Code Here

    E e = new E();
    ds.save(e);
   
    Assert.assertTrue(e.document.contains("myFunkyR"));
   
    new AssertedFailure(ConstraintViolationException.class) {
      public void thisMustFail() throws Throwable {
        morphia.map(E2.class);
      }
    };
  }
View Full Code Here

TOP

Related Classes of com.github.jmkgreen.morphia.testutil.AssertedFailure

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.