Skip to content

Commit

Permalink
Test fix from Michael Bien and a comment about running tests in Intel…
Browse files Browse the repository at this point in the history
…liJ.
  • Loading branch information
snoopdave committed Sep 21, 2024
1 parent a566f06 commit 19e8f86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public MediaFileTest() {
@BeforeEach
public void setUp() throws Exception {
TestUtils.setupWeblogger();
// allow media uploads for this test
Map<String, RuntimeConfigProperty> config = WebloggerFactory.getWeblogger().getPropertiesManager().getProperties();
config.get("uploads.enabled").setValue("true");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;

/**
* Test parsing and running of SQL scripts
Expand Down Expand Up @@ -64,7 +63,7 @@ public void testParseOnly() throws Exception {
String scriptPath = System.getProperty("project.build.directory")
+ "/test-classes/WEB-INF/dbscripts/dummydb/createdb-"+dbname+".sql";
SQLScriptRunner runner = new SQLScriptRunner(scriptPath);
assertTrue(runner.getCommandCount() == 5);
assertEquals(5, runner.getCommandCount());
}

@Test
Expand All @@ -79,10 +78,12 @@ public void testSimpleRun() throws Exception {
// but some folks test against MySQL
dbname = "mysql";
}


// if you are running the tests in IntelliJ, then you will need to add something like this to your VM options:
// -Dproject.build.directory=/Users/dave/src/apache-roller/app/target

// run script to create tables
SQLScriptRunner create =
new SQLScriptRunner(System.getProperty("project.build.directory")
SQLScriptRunner create = new SQLScriptRunner(System.getProperty("project.build.directory")
+ "/test-classes/WEB-INF/dbscripts/dummydb/createdb-"+dbname+".sql");
create.runScript(con, true);

Expand Down

0 comments on commit 19e8f86

Please sign in to comment.