mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Fix issues with test ordering
This commit is contained in:
+2
-2
@@ -24,8 +24,8 @@ public class DefaultServer_getReferenceTest extends BaseTestCase {
|
||||
ResetBasicData.reset();
|
||||
|
||||
DB.execute(() -> {
|
||||
Customer loaded = DB.find(Customer.class, 1);
|
||||
Customer reference = DB.reference(Customer.class, 1);
|
||||
Customer loaded = DB.find(Customer.class).where().eq("name", "Rob").findOne();
|
||||
Customer reference = DB.reference(Customer.class, loaded.getId());
|
||||
assertThat(loaded).isSameAs(reference);
|
||||
});
|
||||
}
|
||||
|
||||
+7
-4
@@ -1,6 +1,7 @@
|
||||
package io.ebeaninternal.server.deploy;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.bean.EntityBean;
|
||||
import io.ebean.common.BeanList;
|
||||
@@ -66,11 +67,13 @@ public class BeanPropertyAssocManyTest extends BaseTestCase {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
List<Object> customerIds = new ArrayList<>();
|
||||
customerIds.add(1L);
|
||||
customerIds.add(2L);
|
||||
List<Long> ids = DB.find(Customer.class).orderBy("id").setMaxRows(2).findIds();
|
||||
|
||||
List<Object> contactIdsForOne = contacts().findIdsByParentId(1L, null, null, null, true);
|
||||
List<Object> customerIds = new ArrayList<>();
|
||||
customerIds.add(ids.get(0));
|
||||
customerIds.add(ids.get(1));
|
||||
|
||||
List<Object> contactIdsForOne = contacts().findIdsByParentId(ids.get(0), null, null, null, true);
|
||||
|
||||
List<Object> contactIdsForMultiple = contacts().findIdsByParentId(null, customerIds, null, null, true);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
@@ -22,6 +23,7 @@ public class TestBatchSaveWithGetBeanId extends BaseTestCase {
|
||||
@Test
|
||||
@IgnorePlatform(Platform.HANA) // HANA doesn't support insert batching
|
||||
public void test() {
|
||||
ResetBasicData.reset();
|
||||
|
||||
Database server = DB.getDefault();
|
||||
Customer model = new Customer();
|
||||
|
||||
@@ -2,8 +2,10 @@ package org.tests.insert;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -12,9 +14,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestInsertCollection extends BaseTestCase {
|
||||
|
||||
@BeforeAll
|
||||
static void before() {
|
||||
ResetBasicData.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
Customer cust1 = new Customer();
|
||||
cust1.setName("jim");
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class TestQuerySingleAttribute extends BaseTestCase {
|
||||
|
||||
Query<Customer> query = DB.find(Customer.class)
|
||||
.select("name")
|
||||
.where().eq("id", 1).query();
|
||||
.where().eq("name", "Rob").query();
|
||||
|
||||
String name = query.findSingleAttribute();
|
||||
|
||||
@@ -248,7 +248,7 @@ public class TestQuerySingleAttribute extends BaseTestCase {
|
||||
|
||||
String name = DB.find(Customer.class)
|
||||
.select("name")
|
||||
.where().eq("id", 1)
|
||||
.where().eq("name", "Rob")
|
||||
.findSingleAttribute();
|
||||
|
||||
assertThat(name).isNotNull();
|
||||
@@ -646,7 +646,7 @@ public class TestQuerySingleAttribute extends BaseTestCase {
|
||||
.findSingleAttributeList();
|
||||
assertThat(list1.get(0)).isInstanceOf(CountedValue.class);
|
||||
//assertThat(list1.toString()).isEqualTo("[1: Tracy, 3: Jim1, 1: Jack, 3: Fred1, 1: Fiona, 3: Bugs1]");
|
||||
|
||||
|
||||
query = DB.find(Contact.class).select("firstName");
|
||||
list1 = query
|
||||
.setCountDistinct(CountDistinctOrder.NO_ORDERING)
|
||||
|
||||
@@ -3,11 +3,13 @@ package org.tests.update;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.TransactionalTestCase;
|
||||
import io.ebean.test.LoggedSql;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Contact;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.EBasic;
|
||||
import org.tests.model.basic.EBasic.Status;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import javax.persistence.EntityNotFoundException;
|
||||
import java.util.*;
|
||||
@@ -17,6 +19,11 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestStatelessUpdate extends TransactionalTestCase {
|
||||
|
||||
@BeforeAll
|
||||
static void before() {
|
||||
ResetBasicData.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
|
||||
@@ -3,14 +3,21 @@ package org.tests.update;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.DB;
|
||||
import io.ebean.SqlRow;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class TestUpdatePartial extends BaseTestCase {
|
||||
|
||||
@BeforeAll
|
||||
static void before() {
|
||||
ResetBasicData.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user