src/plugins/oslc/packaging/install/plugin-oslc -text
src/plugins/oslc/packaging/links/plugin-oslc -text
src/plugins/oslc/post-testdata.xml -text svneol=unset#text/xml
+src/plugins/oslc/tests/func/sureFireReportTest.php -text
+src/plugins/oslc/tests/run-provider-tests.sh -text
+src/plugins/oslc/tests/setup-provider-test.sh -text
src/plugins/oslc/translations/en.po -text
src/plugins/oslc/translations/gforge.pot -text
src/plugins/oslc/utils/manage-translations.sh -text svneol=unset#text/x-sh
--- /dev/null
+<?php
+
+require_once dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))).'/tests/func/Testing/SeleniumGforge.php';
+
+// This will analize the HTML report generated out of the OSLC
+// provider JUnit test suite by the Maven Surefire plugin to detect if
+// tests are passed as before (non-regression)
+
+class SureFireReports extends FForge_SeleniumTestCase
+{
+
+ // Test the ServiceProviderCatalogTests results
+ public function testServiceProviderCatalogTestsResults()
+ {
+
+ // Make sure there's a project with a tracker
+ $this->populateStandardTemplate('trackers');
+ $this->init();
+
+ // start the OSLC test suite
+ echo "\nStarting OSLC test suite\n";
+ $directory = dirname(dirname(__FILE__));
+ echo "Executing " . $directory . "/run-provider-tests.sh\n";
+ system('cd '. $directory . '; ./run-provider-tests.sh');
+ echo "OSLC test suite executed\n\n";
+
+ // Check the results in the generated HTML report
+ $this->open("/plugins/oslc/surefire/surefire-report.html");
+ $this->click("link=net.openservices.provider.test.oslcv1tests");
+
+ $this->assertEquals("net.openservices.provider.test.oslcv1tests", $this->getText("//div[@id='contentBox']/div[3]/div/h3"));
+
+ $this->assertEquals("ServiceProviderCatalogTests", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[2]"));
+
+ // Tests
+ $this->assertEquals("56", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[3]"));
+ // Errors
+ $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[4]"));
+ // Failures
+ $this->assertEquals("8", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[5]"));
+ // Skipped
+ $this->assertEquals("0", $this->getText("//div[@id='contentBox']/div[3]/div/h3[contains(.,'net.openservices.provider.test.oslcv1tests')]/../table/tbody/tr[2]/td[6]"));
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+#! /bin/sh
+
+cd provider-test
+
+baseUri=`grep baseUri config/fusionforge/ffsandbox.properties | sed 's/^.*=//g'`
+
+echo
+echo "Starting the OSLC provider test suite on $baseUri."
+echo
+
+# Run the tests and build the "site" which contains the HTML test suite reports
+mvn -Dtest=DynamicSuiteBuilder -DargLine="-Dprops=config/fusionforge/ffsandbox.properties" site
--- /dev/null
+#! /bin/sh
+
+# This should setup an OSLC Provider test suite environment
+
+# Fist, make sure the plugin is installed
+aptitude install fusionforge-plugin-oslc
+
+# Dependencies : installed Maven 2 and JDK (aptitude install maven2 default-jdk)
+
+# We don't embedd a copy of the test suite and instead refer to the latest version on SF.net
+if [ ! -d provider-test ] ; then
+ svn checkout https://oslc-tools.svn.sourceforge.net/svnroot/oslc-tools/provider-test
+fi
+
+cd provider-test
+svn update
+
+# The tests config is in the properties file
+if [ ! -f config/fusionforge/ffsandbox.properties ]; then
+ cat <<EOF >config/fusionforge/ffsandbox.properties
+##GENERAL PROPERTIES##
+#The location of the top level ServiceProviderCatalog or Service Description Document
+baseUri=https://forge.local/plugins/oslc/cm/oslc-services/
+#Implementation name (for identification purposes)
+implName=FusionForge
+#The authentication style (currently supports only BASIC, not FORM)
+authMethod=BASIC
+#formUri=https://quagmire.rtp.raleigh.ibm.com:9443/ccm/authenticated/j_security_check
+#The authentication credentials
+userId=oslctest
+pw=oslctest
+
+# Values: http://open-services.net/xmlns/cm/1.0/ | http://open-services.net/ns/cm# | both
+testVersions=http://open-services.net/xmlns/cm/1.0/
+
+##QUERY PROPERTIES##
+#The query parameter that should be used to test equality
+queryEqualityProperty=dc:title
+#The parameter value used with the parameter to test equality (record with this value should exist in the system)
+queryEqualityValue=another ticket
+#The query parameter that should be used to test equality
+queryComparisonProperty=dc:modified
+#The parameter value used with the parameter to test comparisons (should split the results into two non-empty sets)
+queryComparisonValue=2010-08-16T20:16:03.578Z
+#Additional non-OSLC parameters that need to be included to run queries
+queryAdditionalParameters=
+#A value to test full text search against (should return a non-empty record list)
+fullTextSearchTerm=templatedDefect
+
+##CREATION AND UPDATION PROPERTIES##
+#Location of properly formatted xml which will be used to create a record.
+createTemplateXmlFile=config/rtc/rtc-template.xml
+#Location of properly formatted json which will be used to create a record.
+createTemplateJsonFile=config/rtc/rtc-json-template.json
+#Location of properly formatted xml which will be used to update a record.
+updateTemplateXmlFile=config/rtc/rtc-update.xml
+#Location of properly formatted json which will be used to update a record.
+updateTemplateJsonFile=config/rtc/rtc-json-update.json
+
+##OAUTH PROPERTIES##
+#The URL corresponding to issuing request tokens
+#OAuthRequestTokenUrl=https://localhost:9443/jazz/oauth-request-token
+#The URL corresponding to OAuth user authorization
+#OAuthAuthorizationUrl=https://localhost:9443/jazz/oauth-authorize
+#Parameters to be POSTed to the authorization URL along with the acquired request token
+#OAuthAuthorizationParameters=oauth_callback=&authorize=true
+#The URL corresponding to issuing access tokens
+#OAuthAccessTokenUrl=https://localhost:9443/jazz/oauth-access-token
+#The consumer token and secret used to make the OAuth accesses
+#OAuthConsumerToken=7bcf944e7f224096b448a17fdd1da57e
+#OAuthConsumerSecret=secret
+EOF
+
+fi
+
+mvn clean
+
$suite->addTestFiles(glob("func/PluginsBlocks/*Test.php"));
$suite->addTestFiles(glob("func/RBAC/*Test.php"));
+ // Run any func tests available in the plugins
+ $suite->addTestFiles(glob("../src/plugins/*/tests/func/*Test.php"));
+
return $suite;
}
}
$this->open( ROOT );
$this->click("link=Log In");
$this->waitForPageToLoad("30000");
+
+ // Check that current URL's base is the same as ROOT
+ // If the forge redirects to other URL than the one
+ // used to access it, then logout doesn't work (bug or
+ // feature ?)
+ $location=$this->getLocation();
+ $url_regexp = str_replace('.', '\.', HOST);
+ $url_regexp = '/https?:\/\/'. $url_regexp .'\//';
+ $this->assertRegExp($url_regexp, $location,
+ "You may need to set 'HOST' setting in test suite's config file to something compatible with 'web_host' defined in ini file");
+
$this->type("form_loginname", "admin");
$this->type("form_pw", "myadmin");
$this->click("login");
$this->assertTrue($this->isTextPresent("Forge Admin"));
$this->assertTrue($this->isTextPresent("Log Out"));
$this->logout();
-
+ // Verify that logout is succesfull
+ $this->assertTrue($this->isTextPresent("Log In"));
+
// Test with an empty password.
$this->open( ROOT );
$this->click("link=Log In");
#! /bin/sh
+echo "Cleaning up the database"
invoke-rc.d apache2 stop
+
invoke-rc.d postgresql restart
-su - postgres -c "dropdb gforge"
+su - postgres -c "dropdb -e gforge"
+echo "Executing: pg_restore -C -d template1 < /root/dump"
su - postgres -c "pg_restore -C -d template1" < /root/dump
+
invoke-rc.d apache2 start
phpunit --verbose $i
done
fi
-
-# If available, run the JUnit OSLC provider test suite
-if [ -d /root/fusionforge/src/plugins/oslc/tests ]; then
- cd /root/fusionforge/src/plugins/oslc/tests
- ./setup-provider-test.sh
- ./run-provider-tests.sh
-fi
git pull
fi
-
+# If available, install the JUnit OSLC provider test suite
+if [ -d src/plugins/oslc/tests ]; then
+ cd /root/fusionforge/src/plugins/oslc/tests
+ ./setup-provider-test.sh
+fi