Hi,

 

First let me thank you for taking the time to look at my code and my problem. It runs now though I have just a few and comments that I will attach to your messages. I do have my students write code to rebuild their databases and I have them put it in a separate class so it is usable for reasons other than testing. Your database seeding code is far superior to what I have my students do and I will now insist that they adopt this approach.

 

If I may be so bold, I have two more questions. The first is about this message I get when I run the tests:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

SLF4J: Defaulting to no-operation (NOP) logger implementation

SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Any idea how to satisfy SLF4J or should I just ignore them.

 

Second, when the test runs I get an unusual stack trace

INFO: Illegal access: this web application instance has been stopped already.  Could not load com.mysql.jdbc.ProfilerEventHandlerFactory.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.

java.lang.IllegalStateException

       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1588)

       at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)

       . . .

 

My students worry about stack traces as do I. Should I just ignore this complaint about the mysql profiler?

 

Again thank you and should you ever find yourself in Montreal there is now a standing invitation to join my wife and I for a meal.

 

Regards,

 

Ken

 

 

 

From: Bartosz Majsak [mailto:notifications@github.com] 
Sent: February 22, 2014 3:45 PM
To: omniprof/ArquillianDemo01
Subject: Re: [ArquillianDemo01] Fixed test and project setup. (#1)

 

In ArquillianDemo01/src/test/java/com/kenfogel/test/FishActionBeanTest.java:

> +    @Before
> +    public void seedDatabase() {
> +        final String seedDataScript = loadAsString("createFishMySQL.sql");
> +        try (Connection connection = ds.getConnection()) {
> +            for (String statement : splitStatements(new StringReader(seedDataScript), ";")) {
> +                connection.prepareStatement(statement).execute();
> +            }
> +        } catch (SQLException e) {
> +            throw new RuntimeException("Failed seeding database", e);
> +        }
> +    }
> +
> +    @Test
> +    public void should_find_all_fish() throws Exception {
> +        List<FishData> lfd = fab.getAll();
> +        assertThat(lfd).hasSize(200);

Highly recommended assertion library. It just reads easier :)

—
Reply to this email directly or view it on GitHub <https://github.com/omniprof/ArquillianDemo01/pull/1/files#r9972930> .  <https://github.com/notifications/beacon/4064849__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwODYzNDcxOCwiZGF0YSI6eyJpZCI6MjYyNDE0MjF9fQ==--5a66791043d287c003331d0685a2b2de80246d99.gif>