Skip to content

Conversation

freemabd1
Copy link
Contributor

No description provided.

calbach and others added 4 commits April 16, 2018 15:03
* New "select boxes"

* Stylin

* Stub in ethnicity

* Tests & linting

* Small bugfix, more linting
* Adding non-standard columns to observation table in CDM schema

* Updating comment

* Updated README
* Refactor detail tab pages to use single page

* Add tab name
Copy link
Contributor

@danqrodney danqrodney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

@SpringBootTest(classes = {TestWebMvcConfig.class})
public class ApplicationTest {

@Autowired
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to list all these out here? Is it possible for us to programatically detect all bindings for services / controllers / etc. and test them? (We are likely to forget to add new stuff here.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 It would be nice to not have to update this for all new controllers/services/etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it seems that Spring doesn't have a handy way to get beans with certain annotations like @service or @configuration. There is a way to get all bean definitions and iterate them. I'm working on a solution for this. It won't completely erase the need to manage this test but it will definitely minimized the affects when beans are added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test now loads: @NoRepositoryBean, @service, @controller, @component and @configuration classes

@@ -0,0 +1,5 @@
insert into config (config_id, configuration) values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment describing how this gets used / where it's referenced from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. There's no direct reference to these files in ApplicationTest... can you describe the mechanism that causes them to get loaded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,16 @@
create table config (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment describing how this gets used / where it's referenced from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

calbach and others added 14 commits April 17, 2018 10:07
* Add ability to run just the tests

* Remove unused options
* Not Found Page

* Fix spacing

* PR Comments

* Move to better not found pattern.

* Fix linting?
* Fix sidebar, cohort-review wrapper, persistent scrollbar

* Add comment about height
* Remove imports, get rid of one getme call

* Make loc public
…ialization. (#744)

* Start

* Fixes

* Removing imports

* PR comments

* Removing log
@Test
public void contextLoads() throws Exception {
//This loads all dao's that implement JPA repositories
Map<String, Object> repoBeans = context.getBeansWithAnnotation(NoRepositoryBean.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you could make an array with NoRepositoryBean.class and Component.class and loop over it below, rather than repeating the logic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

//This loads all dao's that implement JPA repositories
Map<String, Object> repoBeans = context.getBeansWithAnnotation(NoRepositoryBean.class);
for (Map.Entry<String, Object> entry : repoBeans.entrySet()) {
System.out.println(entry.getKey());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove System.out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -0,0 +1,5 @@
insert into config (config_id, configuration) values
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. There's no direct reference to these files in ApplicationTest... can you describe the mechanism that causes them to get loaded?

Copy link
Contributor

@rushtong rushtong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@freemabd1 freemabd1 merged commit 5468c4a into master Apr 19, 2018
@freemabd1 freemabd1 deleted the freemabd1/RW-391 branch April 19, 2018 17:33
SrushtiGangireddy pushed a commit that referenced this pull request May 30, 2018
* RW-391 created applicaiton test.

* RW-391 attempt at getting @SpringBootTest working.

* RW-391 more experimentation.

* RW-391 successfuly SpringBootTest!

* RW-391 removed unused properties.

* RW-391 moved test case to integration.

* RW-391 replace with master copy.

* Tweak deploy docs and logging (#731)

* Js/demo form update (#728)

* New "select boxes"

* Stylin

* Stub in ethnicity

* Tests & linting

* Small bugfix, more linting

* Adding non-standard columns to observation table in CDM schema (#729)

* Adding non-standard columns to observation table in CDM schema

* Updating comment

* Updated README

* Refactor detail tab pages to use single page (#733)

* Refactor detail tab pages to use single page

* Add tab name

* Fix "Google Bucket" link (#736)

* RW-391 finding a way to programmatically test all beans.

* Add ability to run just the tests (#735)

* Add ability to run just the tests

* Remove unused options

* fix for new notebook button being truncated (#738)

* Blrubenstein/not found page (#734)

* Not Found Page

* Fix spacing

* PR Comments

* Move to better not found pattern.

* Fix linting?

* Fix sidebar, cohort-review wrapper, persistent scrollbar (#737)

* Fix sidebar, cohort-review wrapper, persistent scrollbar

* Add comment about height

* Clean up PR (#740)

* RW-391

* Remove imports, get rid of one getme call (#741)

* Remove imports, get rid of one getme call

* Make loc public

* Add BSD 3-clause LICENSE (#743)

* [RW-514] Joining to tables after LIMIT where possible in cohort materialization. (#744)

* Start

* Fixes

* Removing imports

* PR comments

* Removing log

* RW-391 added comments to data.sql and schema.sql and programmtically load beans were interested in testing.

* RW-391 cleanup of unused imports.

* RW-391 removed unused inserts.

* RW-391 removed println.

* RW-391 added comment about initializing the database.

* RW-391 added maps to list for iteration.

* RW-391 created applicaiton test.

* RW-391 attempt at getting @SpringBootTest working.

* RW-391 more experimentation.

* RW-391 successfuly SpringBootTest!

* RW-391 removed unused properties.

* RW-391 moved test case to integration.

* RW-391 replace with master copy.

* RW-391 finding a way to programmatically test all beans.

* RW-391

* RW-391 added comments to data.sql and schema.sql and programmtically load beans were interested in testing.

* RW-391 cleanup of unused imports.

* RW-391 removed unused inserts.

* RW-391 removed println.

* RW-391 added comment about initializing the database.

* RW-391 added maps to list for iteration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants