Added: incubator/openmeetings/branches/confluence-plugin/src/test/java/it/AbstractIntegrationTestCase.java URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/confluence-plugin/src/test/java/it/AbstractIntegrationTestCase.java?rev=1298811&view=auto ============================================================================== --- incubator/openmeetings/branches/confluence-plugin/src/test/java/it/AbstractIntegrationTestCase.java (added) +++ incubator/openmeetings/branches/confluence-plugin/src/test/java/it/AbstractIntegrationTestCase.java Fri Mar 9 12:42:56 2012 @@ -0,0 +1,56 @@ +package it; + +import com.atlassian.confluence.plugin.functest.AbstractConfluencePluginWebTestCase; +import com.atlassian.confluence.plugin.functest.JWebUnitConfluenceWebTester; +import com.atlassian.confluence.plugin.functest.TesterConfiguration; +import junit.framework.Assert; + +import java.io.IOException; +import java.util.Properties; + +import org.junit.Test; + +public class AbstractIntegrationTestCase extends AbstractConfluencePluginWebTestCase +{ + @Override + protected JWebUnitConfluenceWebTester createConfluenceWebTester() + { + Properties props = new Properties(); + props.put("confluence.webapp.protocol", "http"); + props.put("confluence.webapp.host", "localhost"); + + // this is deceiving: the func test library checks for the system properties + // *before* checking in this properties file for these values, so these + // properties are technically ignored + props.put("confluence.webapp.port", Integer.parseInt(System.getProperty("http.port"))); + props.put("confluence.webapp.context.path", System.getProperty("context.path")); + + props.put("confluence.auth.admin.username", "admin"); + props.put("confluence.auth.admin.password", "admin"); + + TesterConfiguration conf; + try + { + conf = new TesterConfiguration(props); + } + catch (IOException ioe) + { + Assert.fail("Unable to create tester: " + ioe.getMessage()); + return null; + } + + JWebUnitConfluenceWebTester tester = new JWebUnitConfluenceWebTester(conf); + + tester.getTestContext().setBaseUrl(tester.getBaseUrl()); + tester.setScriptingEnabled(false); + + return tester; + } + + @Test + public void testSomthing(){ + + JWebUnitConfluenceWebTester test = createConfluenceWebTester(); + test.gotoRootWindow(); + } +}
Added: incubator/openmeetings/branches/confluence-plugin/src/test/java/it/IntegrationTestMyPlugin.java URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/confluence-plugin/src/test/java/it/IntegrationTestMyPlugin.java?rev=1298811&view=auto ============================================================================== --- incubator/openmeetings/branches/confluence-plugin/src/test/java/it/IntegrationTestMyPlugin.java (added) +++ incubator/openmeetings/branches/confluence-plugin/src/test/java/it/IntegrationTestMyPlugin.java Fri Mar 9 12:42:56 2012 @@ -0,0 +1,10 @@ +package it; + +public class IntegrationTestMyPlugin extends AbstractIntegrationTestCase +{ + public void testSomething() + { + gotoPage(""); + assertTextPresent("Welcome"); + } +} Added: incubator/openmeetings/branches/confluence-plugin/src/test/resources/log4j.properties URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/confluence-plugin/src/test/resources/log4j.properties?rev=1298811&view=auto ============================================================================== --- incubator/openmeetings/branches/confluence-plugin/src/test/resources/log4j.properties (added) +++ incubator/openmeetings/branches/confluence-plugin/src/test/resources/log4j.properties Fri Mar 9 12:42:56 2012 @@ -0,0 +1,9 @@ +log4j.rootLogger = INFO, console + +log4j.appender.console = org.apache.log4j.ConsoleAppender +log4j.appender.console.layout = org.apache.log4j.PatternLayout +log4j.appender.console.layout.ConversionPattern = %5p - %60.60c - %m%n + +# (1) +log4j.logger.net.java.ao.sql = DEBUG, console +log4j.additivity.net.java.ao.sql = false \ No newline at end of file Propchange: incubator/openmeetings/branches/confluence-plugin/target/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Fri Mar 9 12:42:56 2012 @@ -0,0 +1,5 @@ +confluence +container +dependency-maven-plugin-markers +maven-archiver +surefire-reports Added: incubator/openmeetings/branches/confluence-plugin/target/openmeetingsconfluence-1.0-SNAPSHOT.jar URL: http://svn.apache.org/viewvc/incubator/openmeetings/branches/confluence-plugin/target/openmeetingsconfluence-1.0-SNAPSHOT.jar?rev=1298811&view=auto ============================================================================== Binary file - no diff available. Propchange: incubator/openmeetings/branches/confluence-plugin/target/openmeetingsconfluence-1.0-SNAPSHOT.jar ------------------------------------------------------------------------------ svn:mime-type = application/octet-stream
