FC-283 - Remove property files from quickstart doc
diff --git a/README-QUICKSTART-DOCKER-APACHEDS.md b/README-QUICKSTART-DOCKER-APACHEDS.md
index 42d1308..722c91a 100644
--- a/README-QUICKSTART-DOCKER-APACHEDS.md
+++ b/README-QUICKSTART-DOCKER-APACHEDS.md
@@ -47,137 +47,127 @@
1. Download the package:
a. from git:
- ```
- git clone --branch 2.0.5 https://gitbox.apache.org/repos/asf/directory-fortress-core.git
- cd directory-fortress-core
- ```
+```
+git clone --branch 2.0.5 https://gitbox.apache.org/repos/asf/directory-fortress-core.git
+cd directory-fortress-core
+```
- b. or download package:
- ```
- wget http://www.apache.org/dist/directory/fortress/dist/2.0.5/fortress-core-2.0.5-source-release.zip
- unzip fortress-core-2.0.5-source-release.zip
- cd fortress-core-2.0.5
- ```
+b. or download package:
+```
+wget http://www.apache.org/dist/directory/fortress/dist/2.0.5/fortress-core-2.0.5-source-release.zip
+unzip fortress-core-2.0.5-source-release.zip
+cd fortress-core-2.0.5
+```
2. Now build the apache directory fortress docker image (trailing dot matters):
- ```
- docker build -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
- ```
+```
+docker build -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
+```
Or just pull the prebuilt image:
- ```
- docker pull apachedirectory/apacheds-for-apache-fortress-tests
- ```
+```
+docker pull apachedirectory/apacheds-for-apache-fortress-tests
+```
3. Run the docker container:
- ```
- CONTAINER_ID=$(docker run -d -P apachedirectory/apacheds-for-apache-fortress-tests)
- CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "10389/tcp") 0).HostPort}}' $CONTAINER_ID)
- echo $CONTAINER_PORT
- ```
+```
+CONTAINER_ID=$(docker run -d -P apachedirectory/apacheds-for-apache-fortress-tests)
+CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "10389/tcp") 0).HostPort}}' $CONTAINER_ID)
+echo $CONTAINER_PORT
+```
*note: make note of the port as it's needed later
*depending on your docker setup may need to run as root or sudo priv's.
-4. Prepare fortress to use the apacheds running inside docker container:
+4. Prepare your terminal for execution of maven commands.
- ```
- cp build.properties.example build.properties
- ```
+```
+#!/bin/sh
+export M2_HOME=...
+export JAVA_HOME=...
+export PATH=$PATH:$M2_HOME/bin
+export MAVEN_OPTS="
+ -Dfortress.admin.user=uid=admin,ou=system
+ -Dfortress.admin.pw=secret
+ -Dfortress.suffix=dc=example,dc=com
+ -Dfortress.config.realm=default
+ -Dfortress.ldap.server.type=apacheds
+ -Dfortress.port=32768"
+```
-5. Edit the *build.properties* file:
+ More about 'MAVEN_OPTS':
+ * Provides the coordinates to the ldap server running inside Docker container.
+ * replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
- ```
- vi build.properties
- ```
+5. Run the maven install to build fortress:
-6. Update the *ldap.port* prop:
-
- ```
- ldap.port= port from earlier step
- ```
-
-7. Save and exit
-
-8. Prepare your terminal for execution of maven commands.
-
- ```
- #!/bin/sh
- export M2_HOME=...
- export JAVA_HOME=...
- export PATH=$PATH:$M2_HOME/bin
- ```
-
-9. Run the maven install to build fortress lib and prepare its configuration (fortress.properties):
-
- ```
- mvn clean install
- ```
-
+```
+mvn clean install
+```
___________________________________________________________________________________
## SECTION 3. Apache Fortress Core Integration Test
1. From fortress core base folder, enter the following commands:
- ```
- mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml
- ```
+```
+mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml
+```
*These will build the Directory Information Tree (DIT), create the config and data policies needed for the integration test to follow.*
2. Next, enter the following command:
- ```
- mvn -Dtest=FortressJUnitTest test
- ```
+```
+mvn -Dtest=FortressJUnitTest test
+```
*Tests the APIs against your LDAP server.*
3. Verify the tests worked:
- ```
- Tests run: Failures: 0, Errors: 0, Skipped: 0
- Results :
+```
+Tests run: Failures: 0, Errors: 0, Skipped: 0
+Results :
- Tests run: Failures: 0, Errors: 0, Skipped: 0
+Tests run: Failures: 0, Errors: 0, Skipped: 0
- [INFO]
- [INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
- [INFO] Executing tasks
+[INFO]
+[INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
+[INFO] Executing tasks
- fortress-load:
- [INFO] Executed tasks
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- ```
+fortress-load:
+[INFO] Executed tasks
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+```
4. Rerun the tests to verify teardown APIs work:
- ```
- mvn -Dtest=FortressJUnitTest test
- ```
+```
+mvn -Dtest=FortressJUnitTest test
+```
5. Verify that worked also:
- ```
- Results :
+```
+Results :
- Tests run: Failures: 0, Errors: 0, Skipped: 0
+Tests run: Failures: 0, Errors: 0, Skipped: 0
- [INFO]
- [INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
- [INFO] Executing tasks
+[INFO]
+[INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
+[INFO] Executing tasks
- fortress-load:
- [INFO] Executed tasks
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- [INFO] ------------------------------------------------------------------------
- ```
- Notice more tests ran this time vs the first time, due to teardown.
+fortress-load:
+[INFO] Executed tasks
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+```
+ * More tests ran this time vs the first time, due to teardown.
Test Notes:
* If tests complete without errors Apache Fortress works with your ApacheDS server (in Docker).
@@ -198,44 +188,44 @@
#### Build image
- ```
- docker build -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
- ```
+```
+docker build -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
+```
* trailing dot matters
Or just to be sure don't use cached layers:
- ```
- docker build --no-cache=true -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
- ```
+```
+docker build --no-cache=true -t apachedirectory/apacheds-for-apache-fortress-tests -f src/docker/apacheds-for-apache-fortress-tests/Dockerfile .
+```
#### Run container
- ```
- CONTAINER_ID=$(docker run -d -P apachedirectory/apacheds-for-apache-fortress-tests)
- CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "10389/tcp") 0).HostPort}}' $CONTAINER_ID)
- echo $CONTAINER_PORT
- ```
+```
+CONTAINER_ID=$(docker run -d -P apachedirectory/apacheds-for-apache-fortress-tests)
+CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "10389/tcp") 0).HostPort}}' $CONTAINER_ID)
+echo $CONTAINER_PORT
+```
#### Go into the container
- ```
- docker exec -it $CONTAINER_ID bash
- ```
+```
+docker exec -it $CONTAINER_ID bash
+```
#### Restart container
- ```
- docker restart $CONTAINER_ID
- ```
+```
+docker restart $CONTAINER_ID
+```
#### Stop and delete container
- ```
- docker stop $CONTAINER_ID
- docker rm $CONTAINER_ID
- ```
+```
+docker stop $CONTAINER_ID
+docker rm $CONTAINER_ID
+```
____________________________________________________________________________________
#### END OF README-QUICKSTART-DOCKER-APACHEDS
diff --git a/README-QUICKSTART-DOCKER-SLAPD.md b/README-QUICKSTART-DOCKER-SLAPD.md
index b5a7c89..1aee377 100644
--- a/README-QUICKSTART-DOCKER-SLAPD.md
+++ b/README-QUICKSTART-DOCKER-SLAPD.md
@@ -74,121 +74,111 @@
3. Run the docker container:
```
- CONTAINER_ID=$(docker run -d -P apachedirectory/openldap-for-apache-fortress-tests)
- CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "389/tcp") 0).HostPort}}' $CONTAINER_ID)
- echo $CONTAINER_PORT
+CONTAINER_ID=$(docker run -d -P apachedirectory/openldap-for-apache-fortress-tests)
+CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "389/tcp") 0).HostPort}}' $CONTAINER_ID)
+echo $CONTAINER_PORT
```
*note: make note of the port as it's needed later
*depending on your docker setup may need to run as root or sudo priv's.
-4. Prepare fortress to use the slapd running inside docker container:
+4. Prepare your terminal for execution of maven commands.
- ```
- cp build.properties.example build.properties
- cp slapd.properties.example slapd.properties
- ```
+```
+#!/bin/sh
+export M2_HOME=...
+export JAVA_HOME=...
+export PATH=$PATH:$M2_HOME/bin
+export MAVEN_OPTS="
+ -Dfortress.admin.user=uid=admin,ou=system
+ -Dfortress.admin.pw=secret
+ -Dfortress.suffix=dc=example,dc=com
+ -Dfortress.config.realm=default
+ -Dfortress.ldap.server.type=apacheds
+ -Dfortress.port=32768"
+```
-5. Edit the *slapd.properties* file:
+ More about 'MAVEN_OPTS':
+ * Provides the coordinates to the ldap server running inside Docker container.
+ * replace the 'fortress.port' value with result from ```echo $CONTAINER_PORT```.
- ```
- vi slapd.properties
- ```
+5. Run the maven install to build fortress:
-6. Update the *ldap.port* prop:
-
- ```
- ldap.port= port from earlier step
- ```
-
-7. Save and exit
-
-8. Prepare your terminal for execution of maven commands.
-
- ```
- #!/bin/sh
- export M2_HOME=...
- export JAVA_HOME=...
- export PATH=$PATH:$M2_HOME/bin
- ```
-
-9. Run the maven install to build fortress lib and prepare its configuration (fortress.properties):
-
- ```
- mvn clean install
- ```
+```
+mvn clean install
+```
___________________________________________________________________________________
## SECTION 3. Apache Fortress Core Integration Test
1. From fortress core base folder, enter the following commands:
- ```
- mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml
- ```
+```
+mvn install -Dload.file=./ldap/setup/refreshLDAPData.xml
+```
*These will build the Directory Information Tree (DIT), create the config and data policies needed for the integration test to follow.*
2. Next, enter the following command:
- ```
- mvn -Dtest=FortressJUnitTest test
- ```
+```
+mvn -Dtest=FortressJUnitTest test
+```
*Tests the APIs against your LDAP server.*
3. Verify the tests worked:
- ```
- Tests run: Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 196 sec - in org.apache.directory.fortress.core.impl.FortressJUnitTest
+```
+Tests run: Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 196 sec - in org.apache.directory.fortress.core.impl.FortressJUnitTest
- Results :
+Results :
- Tests run: Failures: 0, Errors: 0, Skipped: 0
+Tests run: Failures: 0, Errors: 0, Skipped: 0
- [INFO]
- [INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
- [INFO] Executing tasks
+[INFO]
+[INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
+[INFO] Executing tasks
- fortress-load:
- [INFO] Executed tasks
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 03:19 min
- [INFO] Finished at: 2016-01-07T09:28:18-06:00
- [INFO] Final Memory: 27M/532M
- [INFO] ------------------------------------------------------------------------
- ```
+fortress-load:
+[INFO] Executed tasks
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 03:19 min
+[INFO] Finished at: 2016-01-07T09:28:18-06:00
+[INFO] Final Memory: 27M/532M
+[INFO] ------------------------------------------------------------------------
+```
4. Rerun the tests to verify teardown APIs work:
- ```
- mvn -Dtest=FortressJUnitTest test
- ```
+```
+mvn -Dtest=FortressJUnitTest test
+```
5. Verify that worked also:
- ```
- Tests run: Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 207.081 sec - in org.apache.directory.fortress.core.impl.FortressJUnitTest
+```
+Tests run: Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 207.081 sec - in org.apache.directory.fortress.core.impl.FortressJUnitTest
- Results :
+Results :
- Tests run: Failures: 0, Errors: 0, Skipped: 0
+Tests run: Failures: 0, Errors: 0, Skipped: 0
- [INFO]
- [INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
- [INFO] Executing tasks
+[INFO]
+[INFO] --- maven-antrun-plugin:1.8:run (default) @ fortress-core ---
+[INFO] Executing tasks
- fortress-load:
- [INFO] Executed tasks
- [INFO] ------------------------------------------------------------------------
- [INFO] BUILD SUCCESS
- [INFO] ------------------------------------------------------------------------
- [INFO] Total time: 03:30 min
- [INFO] Finished at: 2016-01-07T09:33:11-06:00
- [INFO] Final Memory: 27M/531M
- [INFO] ------------------------------------------------------------------------
- ```
+fortress-load:
+[INFO] Executed tasks
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESS
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 03:30 min
+[INFO] Finished at: 2016-01-07T09:33:11-06:00
+[INFO] Final Memory: 27M/531M
+[INFO] ------------------------------------------------------------------------
+```
Notice more tests ran this time vs the first time, due to teardown
Test Notes:
@@ -208,44 +198,44 @@
#### Build image
- ```
- docker build -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
- ```
+```
+docker build -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
+```
* trailing dot matters
Or just to be sure don't use cached layers:
- ```
- docker build --no-cache=true -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
- ```
+```
+docker build --no-cache=true -t apachedirectory/openldap-for-apache-fortress-tests -f src/docker/openldap-for-apache-fortress-tests/Dockerfile .
+```
#### Run container
- ```
- CONTAINER_ID=$(docker run -d -P apachedirectory/openldap-for-apache-fortress-tests)
- CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "389/tcp") 0).HostPort}}' $CONTAINER_ID)
- echo $CONTAINER_PORT
- ```
+```
+CONTAINER_ID=$(docker run -d -P apachedirectory/openldap-for-apache-fortress-tests)
+CONTAINER_PORT=$(docker inspect --format='{{(index (index .NetworkSettings.Ports "389/tcp") 0).HostPort}}' $CONTAINER_ID)
+echo $CONTAINER_PORT
+```
#### Go into the container
- ```
- docker exec -it $CONTAINER_ID bash
- ```
+```
+docker exec -it $CONTAINER_ID bash
+```
#### Restart container
- ```
- docker restart $CONTAINER_ID
- ```
+```
+docker restart $CONTAINER_ID
+```
#### Stop and delete container
- ```
- docker stop $CONTAINER_ID
- docker rm $CONTAINER_ID
- ```
+```
+docker stop $CONTAINER_ID
+docker rm $CONTAINER_ID
+```
____________________________________________________________________________________
#### END OF README-QUICKSTART-DOCKER-SLAPD
diff --git a/pom.xml b/pom.xml
index dd576ca..83ae4fd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -529,16 +529,12 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>-Xmx1024m</argLine>
- <systemProperties>
- <systemProperty>
- <key>version</key>
- <value>${project.version}</value>
- </systemProperty>
- <systemProperty>
- <key>tenant</key>
- <value>${tenant}</value>
- </systemProperty>
- </systemProperties>
+
+ <systemPropertyVariables>
+ <version>${project.version}</version>
+ <tenant>${tenant}</tenant>
+ </systemPropertyVariables>
+
<excludes>
<exclude>${exclude.tests}</exclude>
</excludes>
@@ -712,9 +708,10 @@
<execution>
<phase>test</phase>
<configuration>
+ <!--<target name="stop-slapd-win-if-present" depends="slapd.dir.check" if="slapd.dir.exists">-->
<target name="fortress-load" if="load.file" description="Loads fortress policy into ldap">
<echo message="############### Run Fortress Ant script to load policy ###############" />
- <java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true" dir="${basedir}" timeout="4000000" taskname="startAnt">
+ <java classname="org.apache.tools.ant.launch.Launcher" fork="true" clonevm="true" failonerror="true" dir="${basedir}" timeout="120000" taskname="startAnt">
<classpath>
<!-- use config/bootstrap folder for config because the config ldap node isn't (might not be) inserted: -->
<pathelement location="./config/bootstrap/" />
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
index dd2cefc..8db1272 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/ConfigDAO.java
@@ -331,7 +331,7 @@
Configuration configuration = new Configuration();
LdapConnection ld = null;
String dn = getDn( name );
- LOG.debug( "getConfig dn [{}]", dn );
+ LOG.info( "getConfig dn [{}]", dn );
try
{
ld = getAdminConnection();
diff --git a/src/main/java/org/apache/directory/fortress/core/util/Config.java b/src/main/java/org/apache/directory/fortress/core/util/Config.java
index 8b96bf9..bd5a0f6 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/Config.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/Config.java
@@ -76,6 +76,7 @@
private static final String EXT_TRUST_STORE_ONCLASSPATH = "fortress.trust.store.onclasspath";
private static final String EXT_CONFIG_REALM = "fortress.config.realm";
private static final String EXT_CONFIG_ROOT_DN = "fortress.config.root";
+ private static final String EXT_CONFIG_SUFFIX = "fortress.suffix";
private static final String EXT_SERVER_TYPE = "fortress.ldap.server.type";
private static final String EXT_IS_ARBAC02 = "fortress.is.arbac02";
@@ -677,6 +678,15 @@
LOG.info( PREFIX, GlobalIds.TRUST_STORE_ON_CLASSPATH, szValue );
}
+ // Check to see if the suffix has been overridden by a system property:
+ szValue = System.getProperty( EXT_CONFIG_SUFFIX );
+ if( StringUtils.isNotEmpty( szValue ))
+ {
+ config.setProperty( GlobalIds.SUFFIX, szValue );
+ LOG.info( PREFIX, GlobalIds.SUFFIX, szValue );
+
+ }
+
// Check to see if the config realm name has been overridden by a system property:
szValue = System.getProperty( EXT_CONFIG_REALM );
if( StringUtils.isNotEmpty( szValue ))
@@ -685,12 +695,13 @@
LOG.info( PREFIX, GlobalIds.CONFIG_REALM, szValue );
}
- // Check to see if the config realm name has been overridden by a system property:
+ // Check to see if the config node dn has been overridden by a system property:
szValue = System.getProperty( EXT_CONFIG_ROOT_DN );
if( StringUtils.isNotEmpty( szValue ))
{
config.setProperty( GlobalIds.CONFIG_ROOT_PARAM, szValue );
LOG.info( PREFIX, GlobalIds.CONFIG_ROOT_PARAM, szValue );
+
}
// Check to see if the ldap server type has been overridden by a system property:
@@ -703,8 +714,6 @@
// Check to see if ARBAC02 checking enforced in service layer:
szValue = System.getProperty( EXT_IS_ARBAC02 );
- LOG.info( PREFIX, GlobalIds.IS_ARBAC02, szValue );
-
if( StringUtils.isNotEmpty( szValue ))
{
Boolean isArbac02 = new Boolean(szValue);