mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1123 - 11.1.1 API change - moved PersistBatch, Platform, TxIsolation and TxType to io.ebean.annotation package
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.util.StringHelper;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.runner.notification.RunNotifier;
|
||||
import org.junit.runners.BlockJUnit4ClassRunner;
|
||||
import org.junit.runners.model.FrameworkMethod;
|
||||
import org.junit.runners.model.InitializationError;
|
||||
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
|
||||
/**
|
||||
* This testrunner checks for an {@link IgnorePlatform} annotation and ignores the test.
|
||||
*
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
||||
@@ -26,7 +26,7 @@ public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IgnorePlatform ignore = method.getAnnotation(IgnorePlatform.class);
|
||||
|
||||
if (ignore == null || !platformMath(ignore.value())) {
|
||||
@@ -34,7 +34,7 @@ public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
||||
} else {
|
||||
notifier.fireTestIgnored(describeChild(method));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
private boolean platformMath(Platform[] platforms) {
|
||||
Platform current = Ebean.getDefaultServer().getPluginApi().getDatabasePlatform().getPlatform();
|
||||
@@ -45,4 +45,4 @@ public class ConditionalTestRunner extends BlockJUnit4ClassRunner {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.basic.EBasicVer;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.PrimaryServer;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
public class PrimaryServerTest extends BaseTestCase {
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.TxScope;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package io.ebean;
|
||||
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Country;
|
||||
import org.tests.model.basic.Customer;
|
||||
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import io.ebean.Platform;
|
||||
/**
|
||||
* Annotation to run a test for a certain platform.
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import io.ebean.Platform;
|
||||
/**
|
||||
* Annotation to ignore a test for a certain platform.
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.ebean.config;
|
||||
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package io.ebean.config;
|
||||
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package io.ebean.config.dbplatform;
|
||||
|
||||
import io.ebean.config.DbTypeConfig;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.MatchingNamingConvention;
|
||||
import io.ebean.config.ServerConfig;
|
||||
import io.ebean.config.dbplatform.h2.H2Platform;
|
||||
|
||||
@@ -2,7 +2,7 @@ package io.ebean.dbmigration;
|
||||
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.EbeanServerFactory;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.ServerConfig;
|
||||
|
||||
import org.junit.*;
|
||||
@@ -31,7 +31,7 @@ public class DbMigrationGenerateTest {
|
||||
public void invokeTest() throws IOException {
|
||||
main(null);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
|
||||
logger.info("start");
|
||||
@@ -39,7 +39,7 @@ public class DbMigrationGenerateTest {
|
||||
DbMigration migration = new DbMigration();
|
||||
|
||||
// We use src/test/resources as output directory (so we see in GIT if files will change)
|
||||
|
||||
|
||||
migration.setPathToResources("src/test/resources");
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class DbMigrationGenerateTest {
|
||||
config.setRegister(false);
|
||||
config.setDefaultServer(false);
|
||||
|
||||
|
||||
|
||||
config.setPackages(Arrays.asList("misc.migration.v1_0"));
|
||||
EbeanServer server = EbeanServerFactory.create(config);
|
||||
migration.setServer(server);
|
||||
@@ -74,29 +74,29 @@ public class DbMigrationGenerateTest {
|
||||
assertThat(migration.generateMigration()).isEqualTo("1.0__initial");
|
||||
// and we check repeatative calls
|
||||
assertThat(migration.generateMigration()).isNull();
|
||||
|
||||
|
||||
// and now for v1_1
|
||||
config.setPackages(Arrays.asList("misc.migration.v1_1"));
|
||||
server = EbeanServerFactory.create(config);
|
||||
migration.setServer(server);
|
||||
assertThat(migration.generateMigration()).isEqualTo("1.1");
|
||||
assertThat(migration.generateMigration()).isNull(); // subsequent call
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
System.setProperty("ddl.migration.pendingDropsFor", "1.1");
|
||||
assertThat(migration.generateMigration()).isEqualTo("1.2__dropsFor_1.1");
|
||||
System.clearProperty("ddl.migration.pendingDropsFor");
|
||||
assertThat(migration.generateMigration()).isNull(); // subsequent call
|
||||
|
||||
// and now for v1_2 with
|
||||
|
||||
// and now for v1_2 with
|
||||
config.setPackages(Arrays.asList("misc.migration.v1_2"));
|
||||
server = EbeanServerFactory.create(config);
|
||||
migration.setServer(server);
|
||||
assertThat(migration.generateMigration()).isEqualTo("1.3");
|
||||
assertThat(migration.generateMigration()).isNull(); // subsequent call
|
||||
|
||||
|
||||
|
||||
System.setProperty("ddl.migration.pendingDropsFor", "1.3");
|
||||
assertThat(migration.generateMigration()).isEqualTo("1.4__dropsFor_1.3");
|
||||
System.clearProperty("ddl.migration.pendingDropsFor");
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import io.ebean.*;
|
||||
import io.ebean.annotation.TxIsolation;
|
||||
import io.ebean.bean.BeanCollection;
|
||||
import io.ebean.bean.CallStack;
|
||||
import io.ebean.bean.EntityBeanIntercept;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class EBasic {
|
||||
|
||||
@EnumValue("I")
|
||||
INACTIVE,
|
||||
|
||||
|
||||
@EnumValue("?")
|
||||
DONT_KNOW,
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class EBasic {
|
||||
@EnumValue("2")
|
||||
END
|
||||
}
|
||||
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class EBasic {
|
||||
@Index(unique = true)
|
||||
String name;
|
||||
|
||||
|
||||
|
||||
@DbMigration(preAlter = "-- rename all collisions")
|
||||
@Column(unique = true)
|
||||
String description;
|
||||
@@ -61,7 +61,7 @@ public class EBasic {
|
||||
@NotNull
|
||||
@DbDefault("2000-01-01T00:00:00")
|
||||
Timestamp someDate;
|
||||
|
||||
|
||||
@NotNull
|
||||
@DbDefault("foo'bar")
|
||||
String newStringField;
|
||||
@@ -74,35 +74,35 @@ public class EBasic {
|
||||
@NotNull
|
||||
@DbDefault("true")
|
||||
boolean newBooleanField2;
|
||||
|
||||
|
||||
String indextest1;
|
||||
|
||||
|
||||
String indextest2;
|
||||
|
||||
|
||||
@Index
|
||||
String indextest3;
|
||||
|
||||
|
||||
@Index(unique = true)
|
||||
String indextest4;
|
||||
|
||||
|
||||
@Index(unique = true)
|
||||
String indextest5;
|
||||
|
||||
|
||||
@Index(unique = false)
|
||||
String indextest6;
|
||||
|
||||
|
||||
@NotNull
|
||||
@DbDefault("0")
|
||||
Progress progress;
|
||||
|
||||
|
||||
@DbDefault("42")
|
||||
int newInteger;
|
||||
|
||||
|
||||
@NotNull
|
||||
@ManyToOne
|
||||
@DbMigration(preAlter= "insert into migtest_e_user (id) select distinct user_id from migtest_e_basic") // ensure all users exist
|
||||
EUser user;
|
||||
|
||||
|
||||
public EBasic() {
|
||||
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public class EBasic {
|
||||
public String getNewStringField() {
|
||||
return newStringField;
|
||||
}
|
||||
|
||||
|
||||
public void setNewStringField(String newStringField) {
|
||||
this.newStringField = newStringField;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.DbComment;
|
||||
import io.ebean.annotation.DbMigration;
|
||||
import io.ebean.annotation.History;
|
||||
@@ -15,10 +15,10 @@ import io.ebean.annotation.History;
|
||||
@History
|
||||
@DbComment("We have history now")
|
||||
public class EHistory {
|
||||
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
|
||||
@DbComment("Column altered to long now")
|
||||
@DbMigration(platforms = Platform.POSTGRES,
|
||||
preAlter = "alter table ${table} alter column ${column} TYPE bigint USING (${column}::integer)")
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.tests.basic;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.annotation.Where;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.deploy.BeanProperty;
|
||||
import io.ebeaninternal.server.deploy.parse.AnnotationBase;
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.tests.basic;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import org.tests.model.basic.Address;
|
||||
import org.tests.model.basic.metaannotation.SizeMedium;
|
||||
@@ -66,7 +66,7 @@ public class TestMetaAnnotation extends BaseTestCase {
|
||||
* This test writes 101 spaces to "line1" which is meta-annotated with {@link SizeMedium}.
|
||||
*/
|
||||
@Test
|
||||
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL})
|
||||
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL})
|
||||
public void testWrite101SpacesToLine2() {
|
||||
|
||||
Address address = new Address();
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.ebean.AcquireLockException;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
|
||||
@@ -2,17 +2,17 @@ package org.tests.basic.encrypt;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.SqlQuery;
|
||||
import io.ebean.SqlRow;
|
||||
import io.ebean.Update;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.DbEncrypt;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.tests.model.basic.EBasicEncrypt;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.EBasicEncrypt;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -5,8 +5,9 @@ import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.EBasicVer;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.TSDetail;
|
||||
@@ -70,6 +71,38 @@ public class TestBatchInsertFlush extends BaseTestCase {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional(batch = PersistBatch.ALL, flushOnQuery = false)
|
||||
public void transactional_flushOnQueryFalse() {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
Ebean.save(new EBasicVer("b1"));
|
||||
Ebean.save(new EBasicVer("b2"));
|
||||
|
||||
// does not trigger JDBC batch with flushOnQuery = false
|
||||
Ebean.find(Customer.class).findCount();
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
assertThat(sql.get(0)).contains("select count(*)");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional(batch = PersistBatch.ALL)
|
||||
public void transactional_flushOnQuery() {
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
Ebean.save(new EBasicVer("b1"));
|
||||
Ebean.save(new EBasicVer("b2"));
|
||||
|
||||
// by default triggers flush of JDBC batch
|
||||
Ebean.find(Customer.class).findCount();
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
assertThat(sql.get(0)).contains("insert into e_basicver");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional(batch = PersistBatch.ALL)
|
||||
public void transactional_flushOnGetId() {
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.basic.UTDetail;
|
||||
import org.tests.model.basic.UTMaster;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.batchinsert;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.basic.OCachedBean;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.batchinsert;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebeaninternal.api.SpiTransaction;
|
||||
import io.ebeaninternal.server.persist.BatchControl;
|
||||
import org.tests.model.basic.EBasicWithUniqueCon;
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.basic.Contact;
|
||||
import org.tests.model.basic.EBasicVer;
|
||||
import org.tests.model.converstation.Group;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.tests.idkeys;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.ForPlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.dbplatform.IdType;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import org.junit.Test;
|
||||
@@ -14,7 +14,9 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class TestGeneratedKeys extends BaseTestCase {
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ package org.tests.model.basic.xtra;
|
||||
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.TxType;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.TxType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.model.basic.xtra;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.model.basic.xtra;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.model.basic.xtra;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package org.tests.model.m2o;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -23,9 +23,9 @@ public class TestManyToOneAsOne extends BaseTestCase {
|
||||
runInserts();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void runInserts() {
|
||||
|
||||
|
||||
Addr junk = new Addr();
|
||||
junk.setName("junk");
|
||||
Ebean.save(junk);
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.query.sqlquery;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.plugin.SpiServer;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
|
||||
@@ -4,14 +4,13 @@ import io.ebean.BaseTestCase;
|
||||
import io.ebean.BeanState;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
import org.tests.model.basic.Customer;
|
||||
import org.tests.model.basic.Order;
|
||||
import org.tests.model.basic.ResetBasicData;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.softdelete;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.softdelete.ESoftDelMid;
|
||||
import org.tests.model.softdelete.ESoftDelTop;
|
||||
import org.tests.model.softdelete.ESoftDelUp;
|
||||
|
||||
@@ -4,7 +4,7 @@ import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.PersistBatch;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.basic.UTDetail;
|
||||
import org.tests.model.basic.UTMaster;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.transaction;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.TxIsolation;
|
||||
import io.ebean.annotation.TxIsolation;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.persistence.PersistenceException;
|
||||
|
||||
@@ -3,14 +3,14 @@ package org.tests.transaction;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.EbeanServer;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import org.tests.model.m2m.MnyB;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.tests.model.m2m.MnyB;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
@@ -23,7 +23,7 @@ public class TestCommitAndContinue extends BaseTestCase {
|
||||
@Transactional
|
||||
@IgnorePlatform({Platform.SQLSERVER, Platform.HSQLDB}) // they will dead lock
|
||||
public void transactional_partialSuccess() {
|
||||
|
||||
|
||||
MnyB a = new MnyB("a100");
|
||||
MnyB b = new MnyB("b200");
|
||||
|
||||
@@ -103,7 +103,7 @@ public class TestCommitAndContinue extends BaseTestCase {
|
||||
@Transactional
|
||||
@IgnorePlatform({Platform.SQLSERVER, Platform.HSQLDB}) // they will dead lock
|
||||
public void transactional_partialSuccess_secondTransactionInsert() {
|
||||
|
||||
|
||||
MnyB a = new MnyB("a100");
|
||||
MnyB b = new MnyB("b200");
|
||||
MnyB c = new MnyB("c300");
|
||||
@@ -143,7 +143,7 @@ public class TestCommitAndContinue extends BaseTestCase {
|
||||
|
||||
// insert failed after commitAndContinue
|
||||
assertNull(server.find(MnyB.class, b.getId(), txnForAssert));
|
||||
|
||||
|
||||
// successful insert using txn2
|
||||
assertNotNull(server.find(MnyB.class, c.getId(), txnForAssert));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package org.tests.transaction;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.TxType;
|
||||
import io.ebean.annotation.TxType;
|
||||
import io.ebean.annotation.Transactional;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -3,10 +3,9 @@ package org.tests.transaction;
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.DuplicateKeyException;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Platform;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.IgnorePlatform;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
Reference in New Issue
Block a user