Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1007299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:35:50+00:00 2026-05-16T08:35:50+00:00

I am trying to get some basic unit tests up and running on the

  • 0

I am trying to get some basic unit tests up and running on the Play! framework using the Siena persistence library with GAE as the intended deployment target.

I have the project configured properly and can deploy the app to GAE. I created a basic domain object:

public class User extends Model {

    @Id(Generator.AUTO_INCREMENT)
    public Long id;

    @Column("first_name")
    public String firstName;

    @Column("last_name")
    public String lastName;

    @Column("email")
    public String email;

    public User(String firstName, String lastName, String email) {
        this.firstName = firstName;
        this.lastName = lastName;
        this.email = email;
    }

    public static Query<User> all() {
        return Model.all(User.class);
    }

}

and a basic unit test:

public class BasicTest extends UnitTest {

    @Before
    public void setup() {
        Fixtures.deleteAll();
    }


    @Test
    public void canCreateUser() {
        new User("Jason","Miesionczek","atmospherian@gmail.com").insert();

        User user = User.all().fetch().get(0);

        assertNotNull(user);
        assertEquals(1,User.all().count());
    }

}

I understand that in Play! 1.0.3, Fixtures support for Siena is not there yet, which should be fixed in 1.1, but in the mean time, what should i use instead of Fixtures.deleteAll() to clear the test db before each test?

Right now my second assertion fails because the database retains the previously inserted records.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:35:51+00:00Added an answer on May 16, 2026 at 8:35 am

    You would need to do a delete per table. E.g:

    Model.all(User.class).delete();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to get into some basic JavaFX game development and I'm getting confused
I am trying to get some XML data with LINQ, but running into a
I am trying to get some xpath from xsl variable using xsl ver 1.0
I am trying to get some accurate runtime comparisons of PHP vs Python (and
Hi I'm trying to get some practice with Linked Lists. I Defined an Object
I'm trying to get some code working that a previous developer has written. Yep,
I am trying to get some JavaScript to programmatically adjust a HTML img tag's
I'm trying to get some ideas about how to develop a web login screen.
Ok, so I'm trying to get some UDP code working and I'm barely green
I'm trying to get the label of some network resources mapped as drives. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.