directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1510434 - in /directory/escimo/trunk/tests: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/scim/ src/test/ src/test/java/ src/test/java/o...
Date Mon, 05 Aug 2013 11:33:32 GMT
Author: kayyagari
Date: Mon Aug  5 11:33:31 2013
New Revision: 1510434

URL: http://svn.apache.org/r1510434
Log:
module for integration tests

Added:
    directory/escimo/trunk/tests/
    directory/escimo/trunk/tests/pom.xml
    directory/escimo/trunk/tests/src/
    directory/escimo/trunk/tests/src/main/
    directory/escimo/trunk/tests/src/main/java/
    directory/escimo/trunk/tests/src/main/java/org/
    directory/escimo/trunk/tests/src/main/java/org/apache/
    directory/escimo/trunk/tests/src/main/java/org/apache/directory/
    directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/
    directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/JettyServer.java
    directory/escimo/trunk/tests/src/test/
    directory/escimo/trunk/tests/src/test/java/
    directory/escimo/trunk/tests/src/test/java/org/
    directory/escimo/trunk/tests/src/test/java/org/apache/
    directory/escimo/trunk/tests/src/test/java/org/apache/directory/
    directory/escimo/trunk/tests/src/test/java/org/apache/directory/scim/

Added: directory/escimo/trunk/tests/pom.xml
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/tests/pom.xml?rev=1510434&view=auto
==============================================================================
--- directory/escimo/trunk/tests/pom.xml (added)
+++ directory/escimo/trunk/tests/pom.xml Mon Aug  5 11:33:31 2013
@@ -0,0 +1,129 @@
+<?xml version="1.0"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.directory.scim</groupId>
+    <artifactId>escimo</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>escimo-tests</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>eSCIMo Tests</name>
+
+  <properties>
+    <ldap.api.version>1.0.0-M19</ldap.api.version>
+    <apacheds.version>2.0.0-M14</apacheds.version>
+    <slf4j.api.version>1.7.5</slf4j.api.version>
+    <slf4j.log4j12.version>1.7.5</slf4j.log4j12.version>
+    <log4j.version>1.2.17</log4j.version>
+    <jetty.version>7.5.0.v20110901</jetty.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>escimo-server</artifactId>
+      <version>${project.version}</version>
+      <type>war</type>
+    </dependency>
+
+    <dependency>
+      <groupId>${project.groupId}</groupId>
+      <artifactId>escimo-ldap</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-server</artifactId>
+      <version>${jetty.version}</version>
+    </dependency>
+        
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-webapp</artifactId>
+      <version>${jetty.version}</version>
+    </dependency>
+    
+   <!-- <dependency>
+      <groupId>org.apache.directory.api</groupId>
+      <artifactId>api-ldap-client-api</artifactId>
+      <version>${ldap.api.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.api</groupId>
+      <artifactId>api-ldap-codec-standalone</artifactId>
+      <version>${ldap.api.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>${slf4j.api.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <version>${slf4j.log4j12.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>${log4j.version}</version>
+    </dependency> -->
+
+    <!-- testing dependencies -->
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.10</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-annotations</artifactId>
+      <version>${apacheds.version}</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-server-annotations</artifactId>
+      <version>${apacheds.version}</version>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-test-framework</artifactId>
+      <version>${apacheds.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+     <plugins>
+       <plugin>
+         <groupId>org.apache.felix</groupId>
+         <artifactId>maven-bundle-plugin</artifactId>
+         <version>2.3.7</version>
+        <inherited>true</inherited>
+        <extensions>true</extensions>         
+       </plugin>
+       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <systemPropertyVariables>
+            <escimo.test.version>${project.version}</escimo.test.version>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+     </plugins>       
+  </build>
+</project>

Added: directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/JettyServer.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/JettyServer.java?rev=1510434&view=auto
==============================================================================
--- directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/JettyServer.java
(added)
+++ directory/escimo/trunk/tests/src/main/java/org/apache/directory/scim/JettyServer.java
Mon Aug  5 11:33:31 2013
@@ -0,0 +1,115 @@
+package org.apache.directory.scim;
+
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+
+/**
+ * Hello world!
+ *
+ */
+public class JettyServer
+{
+    private static Server server;
+
+
+    public static void start() throws Exception
+    {
+        if ( ( server != null ) && server.isRunning() )
+        {
+            return;
+        }
+        
+        WebAppContext webapp = new WebAppContext();
+        webapp.setContextPath( "/" );
+        webapp.setWar( getEscimoWar().getAbsolutePath() );
+        webapp.setParentLoaderPriority( true );
+        String cpath = System.getProperty("java.class.path");
+        cpath = cpath.replaceAll( ":", ";" );
+//        webapp.setExtraClasspath( cpath );
+
+        server = new Server( 8080 );
+        server.setHandler( webapp );
+        server.start();
+        server.join();
+    }
+
+
+    public static void stop()
+    {
+        if ( server != null )
+        {
+            try
+            {
+                server.stop();
+            }
+            catch( Exception e )
+            {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    private static File getEscimoWar()
+    {
+        String msg = "No escimo-server war file found, please build escimo-server project
first and  then either set the escimo.test.version property or run the test from 'tests' folder";
+
+        FilenameFilter ff = new FilenameFilter()
+        {
+
+            @Override
+            public boolean accept( File dir, String name )
+            {
+                return ( name.startsWith( "escimo" ) && name.endsWith( ".war" ) );
+            }
+        };
+
+        String testVersion = System.getProperty( "escimo.test.version" );
+
+        if ( testVersion == null )
+        {
+            String pwd = System.getProperty( "user.dir" );
+            File file = new File( pwd );
+
+            File serverFolder = new File( file.getParentFile(), "server/target" );
+
+            if ( serverFolder.exists() )
+            {
+                File[] files = serverFolder.listFiles( ff );
+
+                if ( files.length == 1 )
+                {
+                    return files[0];
+                }
+            }
+            else
+            {
+                throw new RuntimeException( msg );
+            }
+        }
+
+        String m2repoLoc = System.getProperty( "user.home" )
+            + "/.m2/repository/org/apache/directory/scim/escimo-server/" + testVersion;
+        String war = m2repoLoc + "/escimo-server-" + testVersion + ".war";
+        File warFile = new File( war );
+
+        if ( !warFile.exists() )
+        {
+            throw new RuntimeException( msg );
+        }
+
+        return warFile;
+    }
+
+
+    public static void main( String[] args ) throws Exception
+    {
+        System.out.println( getEscimoWar() );
+        start();
+    }
+}



Mime
View raw message