rename null classes to dummy classes
This commit is contained in:
@@ -8,11 +8,10 @@ import jef.model.annotations.Id;
|
||||
import jef.model.constraints.ForeignKeyConstraint;
|
||||
import jef.model.constraints.PrimaryKeyConstraint;
|
||||
import jef.model.migration.operation.AddForeignKeyOperation;
|
||||
import jef.model.migration.operation.AddPrimaryKeyOperation;
|
||||
import jef.model.migration.operation.AddTableOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.model.migration.operation.DropTableOperation;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -31,7 +30,7 @@ public class MigrationCreatorAddEntityTest extends MigrationCreatorTestBase {
|
||||
ent.field("addedField", int.class.getName());
|
||||
to.getEntity("AddedEntity").setPrimaryKey(new PrimaryKeyConstraint(to.getEntity("AddedEntity"), List.of(to.getEntity("AddedEntity").getField("id"))));
|
||||
to.getEntity("AddedEntity").addForeignKey(new ForeignKeyConstraint(to.getEntity("AddedEntity"), List.of(to.getEntity("AddedEntity").getField("addedField")), to.getEntity("AddedEntity"), List.of(to.getEntity("AddedEntity").getField("id")), ForeignKeyConstraint.Action.CASCADE, ForeignKeyConstraint.Action.CASCADE));
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -10,8 +10,7 @@ import jef.model.migration.operation.AddFieldOperation;
|
||||
import jef.model.migration.operation.AddForeignKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.model.migration.operation.DropFieldOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -28,7 +27,7 @@ public class MigrationCreatorAddFieldTest extends MigrationCreatorTestBase {
|
||||
var ent = to.getEntity(TestClass2.class);
|
||||
ent.getOrCreateField("addedField", int.class.getName());
|
||||
ent.addForeignKey(new ForeignKeyConstraint(ent, List.of(ent.getField("addedField")), ent, List.of(ent.getField("i")), ForeignKeyConstraint.Action.CASCADE, ForeignKeyConstraint.Action.CASCADE));
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -8,8 +8,7 @@ import jef.model.annotations.Id;
|
||||
import jef.model.constraints.ForeignKeyConstraint;
|
||||
import jef.model.migration.operation.AddForeignKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -25,7 +24,7 @@ public class MigrationCreatorAddForeignKeyTest extends MigrationCreatorTestBase
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.getEntity(TestClass.class);
|
||||
ent.addForeignKey(new ForeignKeyConstraint(ent, List.of(ent.getField("i2")), ent, List.of(ent.getField("i")), ForeignKeyConstraint.Action.CASCADE, ForeignKeyConstraint.Action.CASCADE));
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -7,8 +7,7 @@ import jef.model.annotations.Clazz;
|
||||
import jef.model.annotations.Id;
|
||||
import jef.model.migration.operation.AddIndexOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -24,7 +23,7 @@ public class MigrationCreatorAddIndexTest extends MigrationCreatorTestBase {
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.entity(TestClass.class);
|
||||
ent.field("d", double.class.getName()).isIndex(true);
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -7,8 +7,7 @@ import jef.model.annotations.Clazz;
|
||||
import jef.model.annotations.Id;
|
||||
import jef.model.migration.operation.AddKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -24,7 +23,7 @@ public class MigrationCreatorAddKeyTest extends MigrationCreatorTestBase {
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.entity(TestClass.class);
|
||||
ent.field("d", double.class.getName()).isKey(true);
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -7,8 +7,7 @@ import jef.model.annotations.Clazz;
|
||||
import jef.model.annotations.Id;
|
||||
import jef.model.migration.operation.AddUniqueKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -24,7 +23,7 @@ public class MigrationCreatorAddUniqueTest extends MigrationCreatorTestBase {
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.entity(TestClass.class);
|
||||
ent.field("d", double.class.getName()).isUnique(true);
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -8,8 +8,7 @@ import jef.model.annotations.Id;
|
||||
import jef.model.annotations.Index;
|
||||
import jef.model.annotations.Key;
|
||||
import jef.model.annotations.Unique;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -23,7 +22,7 @@ public class MigrationCreatorEmptyTest extends MigrationCreatorTestBase {
|
||||
public void test() {
|
||||
var from = ModelBuilder.from(Ctx.class);
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "EmptyMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -9,7 +9,7 @@ import jef.model.migration.operation.AddForeignKeyOperation;
|
||||
import jef.model.migration.operation.AddTableOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.model.migration.operation.DropTableOperation;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -23,7 +23,7 @@ public class MigrationCreatorInitialMigrationTest extends MigrationCreatorTestBa
|
||||
public void test() {
|
||||
var from = new ModelBuilder(List.of());
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "InitialMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -9,8 +9,7 @@ import jef.model.migration.operation.AddForeignKeyOperation;
|
||||
import jef.model.migration.operation.AddPrimaryKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.model.migration.operation.RenameTableOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -26,7 +25,7 @@ public class MigrationCreatorRenameEntityTest extends MigrationCreatorTestBase {
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.entity(TestClass.class);
|
||||
ent.name("d2");
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -16,8 +16,7 @@ import jef.model.migration.operation.AddPrimaryKeyOperation;
|
||||
import jef.model.migration.operation.AddUniqueKeyOperation;
|
||||
import jef.model.migration.operation.DropConstraintOperation;
|
||||
import jef.model.migration.operation.RenameFieldOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -32,7 +31,7 @@ public class MigrationCreatorRenameFieldConstraintsTest extends MigrationCreator
|
||||
var from = ModelBuilder.from(Ctx.class);
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
to.getEntity(TestClass.class).getField("i").setName("i2");
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
@@ -6,8 +6,7 @@ import jef.model.ModelBuilder;
|
||||
import jef.model.annotations.Clazz;
|
||||
import jef.model.annotations.Id;
|
||||
import jef.model.migration.operation.RenameFieldOperation;
|
||||
import jef.platform.base.SqlTypeMapper;
|
||||
import jef.platform.nul.NullPlatform;
|
||||
import jef.platform.dummy.DummyPlatform;
|
||||
import jef.serializable.SerializableObject;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -23,7 +22,7 @@ public class MigrationCreatorRenameFieldTest extends MigrationCreatorTestBase {
|
||||
var to = ModelBuilder.from(Ctx.class);
|
||||
var ent = to.entity(TestClass.class);
|
||||
ent.field("d", double.class.getName()).name("d2");
|
||||
var platform = new NullPlatform();
|
||||
var platform = new DummyPlatform();
|
||||
var mc = new MigrationCreator(platform, from, to, "SomeMigration", "test",
|
||||
new ModelBuilderGenerator(from, "Current", "test", platform.getTypeMapper()).generate().getJava());
|
||||
var res = mc.createMigration();
|
||||
|
||||
Reference in New Issue
Block a user