Codota Logo
ListAssert.onProperty
Code IndexAdd Codota to your IDE (free)

How to use
onProperty
method
in
org.fest.assertions.ListAssert

Best Java code snippets using org.fest.assertions.ListAssert.onProperty (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-ogm

@Test
public void canUseQueriesWithEnumAsParameterForInQuery() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.genre IN (:genre)", Movie.class )
    .setParameter( "genre", EnumSet.of( Genre.DRAMA, Genre.COMEDY ) )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "To thatch a roof", "Barnie" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseDateParameterForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.releaseDate = :releaseDate", Movie.class )
    .setParameter( "releaseDate", new GregorianCalendar( 1958, 3, 2 ).getTime() )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "South by Southeast" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseByteAsParameterForInComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.viewerRating IN (:viewerRating)", Movie.class )
    .setParameter( "viewerRating", Arrays.asList( (byte) 8, (byte) 9 ) )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "To thatch a roof", "South by Southeast" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseBooleanAsParameterForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.suitableForKids = :suitable", Movie.class )
    .setParameter( "suitable", Boolean.FALSE )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "Front Door", "Barnie" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseEnumAsParameterForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.genre = :genre", Movie.class )
    .setParameter( "genre", Genre.THRILLER )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "South by Southeast", "Front Door" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseByteForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.viewerRating = 8", Movie.class )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "To thatch a roof" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
public void canUseByteAsParameterForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.viewerRating = :viewerRating", Movie.class )
    .setParameter( "viewerRating", (byte) 8 )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "To thatch a roof" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
@Ignore("TODO HQLPARSER-59")
public void canUseDateLiteralForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.releaseDate = '02 April 1958'", Movie.class )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "South by Southeast" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
@Ignore("TODO HQLPARSER-59")
public void canUseBooleanLiteralForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.suitableForKids = FALSE", Movie.class )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "Front Door", "Barnie" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

@Test
@Ignore("TODO HQLPARSER-59")
public void canUseEnumLiteralForSimpleComparison() {
  EntityManager entityManager = getFactory().createEntityManager();
  entityManager.getTransaction().begin();
  List<Movie> thrillers = entityManager.createQuery( "SELECT m FROM Movie m WHERE m.genre = org.hibernate.ogm.backendtck.queries.enums.Genre.THRILLER", Movie.class )
    .getResultList();
  assertThat( thrillers ).onProperty( "title" ).containsOnly( "South by Southeast", "Front Door" );
  entityManager.getTransaction().commit();
  entityManager.close();
}
origin: hibernate/hibernate-ogm

assertThat( hypothesis ).onProperty( "author" ).containsOnly( alma );
assertThat( hypothesis ).onProperty( "author" ).containsOnly( alma );
assertThat( hypothesis ).onProperty( "author" ).containsOnly( alfred );
assertThat( hypothesis ).onProperty( "id" ).containsExactly( "13", "15", "14", "16" );
origin: hibernate/hibernate-ogm

assertThat( hypothesis ).onProperty( "author" ).containsOnly( alma, alfred );
origin: hibernate/hibernate-ogm

assertThat( bob.getAttendedTournaments() ).onProperty( "name" ).contains( "British Open", "Player's Championship" );
loadedParticipant.getAttendedTournaments().remove( session.get( Tournament.class, britishOpen.getId() ) );
transaction.commit();
assertThat( bob.getAttendedTournaments() ).onProperty( "name" ).contains( "Player's Championship" );
origin: hibernate/hibernate-ogm

@Test
@TestForIssue(jiraKey = "OGM-917")
public void canRetrieveListOfEntityWithSingleColumnEmbeddableId() throws Exception {
  Session session = openSession();
  Transaction transaction = session.beginTransaction();
  // given
  session.persist( new SingleBoardComputer( new SingleBoardComputerPk( "sbc-1" ), "Raspberry Pi" ) );
  session.persist( new SingleBoardComputer( new SingleBoardComputerPk( "sbc-2" ), "BeagleBone" ) );
  transaction.commit();
  session.clear();
  transaction = session.beginTransaction();
  // when
  @SuppressWarnings("unchecked")
  List<SingleBoardComputer> computers = session.createQuery( "From SingleBoardComputer" ).list();
  // then
  assertThat( computers ).onProperty( "name" ).containsOnly( "Raspberry Pi", "BeagleBone" );
  for ( SingleBoardComputer sbc : computers ) {
    session.delete( sbc );
  }
  transaction.commit();
  session.close();
}
origin: hibernate/hibernate-ogm

@Test
public void testUpdateToElementOfOrderedListIsApplied() throws Exception {
  // insert entity with embedded collection
  inTransaction( session -> {
    grandMother.getGrandChildren().add( new GrandChild( "Luke" ) );
    grandMother.getGrandChildren().add( new GrandChild( "Leia" ) );
    session.persist( grandMother );
  } );
  // do an update to one of the elements
  inTransaction( session -> {
    GrandMother nana = (GrandMother) session.get( GrandMother.class, grandMother.getId() );
    assertThat( nana.getGrandChildren() ).onProperty( "name" ).containsExactly( "Luke", "Leia" );
    nana.getGrandChildren().get( 0 ).setName( "Lisa" );
  } );
  inTransaction( session -> {
    // assert update has been propagated
    GrandMother nana = (GrandMother) session.get( GrandMother.class, grandMother.getId() );
    assertThat( nana.getGrandChildren() ).onProperty( "name" ).containsExactly( "Lisa", "Leia" );
  } );
}
origin: hibernate/hibernate-ogm

@Test
public void testRemovalOfElementFromOrderedListIsApplied() throws Exception {
  // insert entity with embedded collection
  inTransaction( session -> {
    grandMother.getGrandChildren().add( new GrandChild( "Luke" ) );
    grandMother.getGrandChildren().add( new GrandChild( "Leia" ) );
    session.persist( grandMother );
  } );
  // remove one of the elements
  inTransaction( session -> {
    GrandMother nana = (GrandMother) session.get( GrandMother.class, grandMother.getId() );
    nana.getGrandChildren().remove( 0 );
  } );
  // assert removal has been propagated
  inTransaction( session -> {
    grandMother = (GrandMother) session.get( GrandMother.class, grandMother.getId() );
    assertThat( grandMother.getGrandChildren() ).onProperty( "name" ).containsExactly( "Leia" );
  } );
}
origin: hibernate/hibernate-ogm

assertThat( basket.getId() ).isEqualTo( basket.getId() );
assertThat( basket.getProducts() )
  .onProperty( "name" ).containsOnly( beer.getName(), pretzel.getName() );
tx.commit();
origin: hibernate/hibernate-ogm

MultiAddressAccount loadedAccount = (MultiAddressAccount) session.get( MultiAddressAccount.class, account.getLogin() );
assertThat( loadedAccount ).as( "Cannot load persisted object" ).isNotNull();
assertThat( loadedAccount.getAddresses() ).onProperty( "city" ).containsOnly( "Paris", "Rome" );
assertThat( loadedAccount.getAddresses() ).onProperty( "zipCode" ).containsOnly( "75007", "00184" );
assertThat( loadedAccount.getAddresses() ).onProperty( "country" ).containsOnly( "France", "Italy" );
assertThat( loadedAccount.getAddresses() ).onProperty( "street2" ).containsOnly( null, null );
assertThat( loadedAccount.getAddresses() ).onProperty( "type" ).containsOnly( new AddressType( "primary" ), null );
assertThat( secondLoadedAccount.getAddresses() ).onProperty( "city" ).contains( "Paris", "Rome" );
assertThat( secondLoadedAccount.getAddresses() ).onProperty( "country" ).contains( "USA", "Germany" );
session.delete( secondLoadedAccount );
transaction.commit();
origin: hibernate/hibernate-ogm

assertThat( grandMother.getGrandChildren() ).onProperty( "name" ).containsExactly( "Leia" );
org.fest.assertionsListAssertonProperty

Popular methods of ListAssert

  • hasSize
  • isEmpty
  • isEqualTo
  • containsExactly
  • as
  • containsOnly
  • isNotNull
  • contains
  • isNotEmpty
  • isNull
  • containsSequence
  • excludes
  • containsSequence,
  • excludes,
  • isNullOrEmpty,
  • overridingErrorMessage,
  • isSameAs

Popular in Java

  • Reading from database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • String (java.lang)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • JComboBox (javax.swing)
  • JOptionPane (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now