-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved everything to java and new bug with kotlin quarkusio/quarkus#1969
- Loading branch information
1 parent
f12afd1
commit 92ef0e8
Showing
19 changed files
with
308 additions
and
159 deletions.
There are no files selected for viewing
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,8 @@ | ||
target/ | ||
*.iml | ||
.idea/ | ||
.DS_Store | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings/ |
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
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
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,30 @@ | ||
package org.acme.rest; | ||
|
||
import javax.inject.Inject; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Path("/bug") | ||
public class GreetingResource { | ||
|
||
@Inject | ||
GreetingService service; | ||
@Inject | ||
OtherService otherService; | ||
|
||
@GET | ||
@Path("/1575") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String helloBug1575() { | ||
return service.helloBug1575(); | ||
} | ||
|
||
@GET | ||
@Path("/1650") | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public String helloBug1650() { | ||
return otherService.helloBug1650(); | ||
} | ||
} |
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,40 @@ | ||
package org.acme.rest; | ||
|
||
import javax.enterprise.context.Dependent; | ||
import javax.inject.Inject; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
import org.flywaydb.core.Flyway; | ||
|
||
@Dependent | ||
class GreetingService { | ||
|
||
@Inject | ||
@ConfigProperty(name = "quarkus.datasource.url") | ||
String dbURL; | ||
@Inject | ||
@ConfigProperty(name = "quarkus.datasource.username") | ||
String user; | ||
@Inject | ||
@ConfigProperty(name = "quarkus.datasource.password") | ||
String pass; | ||
// INJECTION (repeated) bug #1650 | ||
@Inject | ||
@ConfigProperty(name = "custom.config") | ||
String custom; | ||
|
||
|
||
String helloBug1575() { | ||
var flyway = Flyway.configure() | ||
.dataSource( dbURL, user, pass ) | ||
.baselineOnMigrate( true ) | ||
.load(); | ||
flyway.baseline(); | ||
flyway.migrate(); | ||
return "Hello ITS OK"; | ||
} | ||
|
||
String helloBug1828() { | ||
return "IT WORKS"; | ||
} | ||
} |
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,22 @@ | ||
package org.acme.rest; | ||
|
||
import javax.enterprise.context.Dependent; | ||
import javax.inject.Inject; | ||
|
||
import org.eclipse.microprofile.config.inject.ConfigProperty; | ||
|
||
/** | ||
* @author cristhiank on 2019-03-22 | ||
**/ | ||
@Dependent | ||
class OtherService { | ||
// INJECTION (repeated) bug #1650 | ||
@Inject | ||
@ConfigProperty(name = "custom.config") | ||
String customConfig; | ||
|
||
String helloBug1650() { | ||
System.out.println( "Config=" + customConfig ); | ||
return customConfig; | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/org/acme/rest/panache/EntityRepositoryEndpoint.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 @@ | ||
package org.acme.rest.panache; | ||
|
||
import java.util.UUID; | ||
import javax.inject.Inject; | ||
import javax.ws.rs.Consumes; | ||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
/** | ||
* @author cristhiank on 2019-04-09 | ||
**/ | ||
@Path("/test-entity") | ||
@Consumes(MediaType.APPLICATION_JSON) | ||
@Produces(MediaType.APPLICATION_JSON) | ||
public class EntityRepositoryEndpoint { | ||
@Inject | ||
TestEntityRepository repository; | ||
|
||
@GET | ||
@Path("/{id}") | ||
public TestEntity findById(@PathParam("id") UUID id) { | ||
return repository.findById( id ); | ||
} | ||
} |
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,14 @@ | ||
package org.acme.rest.panache; | ||
|
||
import java.util.UUID; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
|
||
@Entity | ||
public class TestEntity { | ||
@Id | ||
@GeneratedValue | ||
public UUID id; | ||
public String name; | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/org/acme/rest/panache/TestEntityRepository.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,14 @@ | ||
package org.acme.rest.panache; | ||
|
||
import java.util.UUID; | ||
import javax.enterprise.context.Dependent; | ||
|
||
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; | ||
|
||
/** | ||
* @author cristhiank on 2019-04-09 | ||
* | ||
**/ | ||
@Dependent | ||
public class TestEntityRepository implements PanacheRepositoryBase<TestEntity, UUID> { | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.