-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
quarkus.hibernate-orm.database.generation values should be enumerated.
- Fixes redhat-developer/vscode-quarkus#317 - Add testcase Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
- Loading branch information
1 parent
727b4f1
commit 497c13f
Showing
4 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...st/src/main/java/com/redhat/microprofile/jdt/quarkus/QuarkusHibernateORMPropertyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.microprofile.jdt.quarkus; | ||
|
||
|
||
import static org.eclipse.lsp4mp.jdt.internal.core.MicroProfileAssert.assertProperties; | ||
import static org.eclipse.lsp4mp.jdt.internal.core.MicroProfileAssert.assertPropertiesDuplicate; | ||
import static org.eclipse.lsp4mp.jdt.internal.core.MicroProfileAssert.p; | ||
|
||
import org.eclipse.lsp4mp.commons.MicroProfileProjectInfo; | ||
import org.eclipse.lsp4mp.commons.MicroProfilePropertiesScope; | ||
import org.eclipse.lsp4mp.jdt.core.BasePropertiesManagerTest; | ||
import org.junit.Test; | ||
|
||
|
||
/** | ||
* Test the availability of the Quarkus Hibernate ORM properties | ||
* | ||
* @author Angelo ZERR | ||
* | ||
*/ | ||
public class QuarkusHibernateORMPropertyTest extends BasePropertiesManagerTest { | ||
|
||
@Test | ||
public void quarkusContainerImages() throws Exception { | ||
|
||
MicroProfileProjectInfo infoFromClasspath = getMicroProfileProjectInfoFromMavenProject( | ||
MavenProjectName.hibernate_orm_resteasy, MicroProfilePropertiesScope.SOURCES_AND_DEPENDENCIES); | ||
|
||
assertProperties(infoFromClasspath, | ||
|
||
p("quarkus-hibernate-orm", "quarkus.hibernate-orm.database.generation", "java.lang.String", | ||
"Select whether the database schema is generated or not." | ||
+ "\n\n`drop-and-create` is awesome in development mode." | ||
+ "\n\nAccepted values: `none`, `create`, `drop-and-create`, `drop`, `update`.", true, | ||
"io.quarkus.hibernate.orm.deployment.HibernateOrmConfig.HibernateOrmConfigDatabase", "generation", null, 1, | ||
"none")); | ||
|
||
assertPropertiesDuplicate(infoFromClasspath); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...a/com/redhat/microprofile/jdt/internal/quarkus/providers/QuarkusHibernateORMProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.microprofile.jdt.internal.quarkus.providers; | ||
|
||
/** | ||
* Properties provider that provides static Quarkus Hibernate ORM properties | ||
* | ||
* @author Angelo ZERR | ||
* | ||
* @see https://github.com/eclipse/microprofile-health/blob/master/spec/src/main/asciidoc/protocol-wireformat.adoc | ||
* | ||
*/ | ||
public class QuarkusHibernateORMProvider extends AbstractStaticQuarkusPropertiesProvider { | ||
|
||
public QuarkusHibernateORMProvider() { | ||
super("/static-properties/quarkus-hibernate-orm-metadata.json"); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...com.redhat.microprofile.jdt.quarkus/static-properties/quarkus-hibernate-orm-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"hints": [ | ||
{ | ||
"values": [ | ||
{ | ||
"value": "none", | ||
"description": "Disable DDL handling." | ||
}, | ||
{ | ||
"value": "create", | ||
"description": "Create the schema and destroy previous data." | ||
}, | ||
{ | ||
"value": "drop-and-create", | ||
"description": "Drop and create the database at startup." | ||
}, | ||
{ | ||
"value": "drop", | ||
"description": "Drop the database." | ||
}, | ||
{ | ||
"value": "update", | ||
"description": "Update the schema if necessary." | ||
} | ||
], | ||
"name": "quarkus.hibernate-orm.database.generation" | ||
} | ||
] | ||
} |