mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Split Postgres platform into Postgres10 & Postgres9 (DDL - generated by default as identity) (#1921)
* Split Postgres platform into Postgres10 & Postgres9 - Use "generated by default as identity" for Postgres10 identity columns * Add postgres9 migrationtest resources * Set default back to h2 * Add postgres10 migration test resources
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package io.ebeaninternal.api;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class PlatformMatchTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void match() {
|
||||
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "h2"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "mysql,h2"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "mysql,h2,"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "mysql , h2 ,"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "mysql , h2, oracle"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.H2, "mysql , h2, oracle"));
|
||||
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER, "sqlserver"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER17, "sqlserver"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER16, "sqlserver"));
|
||||
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.POSTGRES, "postgres"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.POSTGRES9, "postgres"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.POSTGRES10, "postgres"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void match_sqlserver17_matchAlsoToGenericName() {
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER17, "sqlserver"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER17, "sqlserver17"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchPlatform_sqlserver16_matchAlsoToGenericName() {
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER16, "sqlserver"));
|
||||
assertTrue(PlatformMatch.matchPlatform(Platform.SQLSERVER16, "sqlserver16"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void matchPlatform_sqlserver_nonMatch() {
|
||||
assertFalse(PlatformMatch.matchPlatform(Platform.SQLSERVER16, "sqlserver17"));
|
||||
assertFalse(PlatformMatch.matchPlatform(Platform.SQLSERVER17, "sqlserver16"));
|
||||
assertFalse(PlatformMatch.matchPlatform(Platform.SQLSERVER, "sqlserver16"));
|
||||
assertFalse(PlatformMatch.matchPlatform(Platform.SQLSERVER, "sqlserver17"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user