You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by dk...@apache.org on 2008/12/18 17:46:22 UTC

svn commit: r727760 - in /webservices/wss4j/trunk: pom.xml src/log4j.properties src/org/apache/ws/security/util/WSSecurityUtil.java test/log4j.properties test/wssec/TestWSSecurityUTDK.java

Author: dkulp
Date: Thu Dec 18 08:46:22 2008
New Revision: 727760

URL: http://svn.apache.org/viewvc?rev=727760&view=rev
Log:
Get unit tests working from Maven
Cleanup pom a little bit

Added:
    webservices/wss4j/trunk/test/log4j.properties   (props changed)
      - copied unchanged from r727472, webservices/wss4j/trunk/src/log4j.properties
Removed:
    webservices/wss4j/trunk/src/log4j.properties
Modified:
    webservices/wss4j/trunk/pom.xml
    webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java
    webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java

Modified: webservices/wss4j/trunk/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/pom.xml?rev=727760&r1=727759&r2=727760&view=diff
==============================================================================
--- webservices/wss4j/trunk/pom.xml (original)
+++ webservices/wss4j/trunk/pom.xml Thu Dec 18 08:46:22 2008
@@ -106,8 +106,11 @@
         <url>http://www.apache.org/</url>
     </organization>
     
+
+
     <build>
         <sourceDirectory>src</sourceDirectory>
+        <testSourceDirectory>test</testSourceDirectory>
         <resources>
             <resource>
                 <directory>src</directory>
@@ -117,6 +120,14 @@
                 <filtering>false</filtering>
             </resource>
         </resources>
+        <testResources>
+            <testResource>
+                <directory>test</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </testResource>
+        </testResources>
 
         <plugins>
             <plugin>
@@ -145,86 +156,22 @@
                 </executions>
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-one-plugin</artifactId>
-                <version>1.2</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>install-maven-one-repository</goal>
-                            <goal>deploy-maven-one-repository</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <remoteRepositoryId>apache</remoteRepositoryId>
-                    <remoteRepositoryUrl>
-                        scpexe://people.apache.org/www/people.apache.org/repo/m1-snapshot-repository
-                    </remoteRepositoryUrl>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-release-plugin</artifactId>
-                <configuration>
-                    <tagBase>
-                        https://svn.apache.org/repos/asf/webservices/wss4j/tags/
-                    </tagBase>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.0.2</version>
-                <configuration>
-                    <source>1.3</source>
-                    <target>1.3</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.1</version>
-                <configuration>
-                    <descriptors>
-                        <descriptor>assembly/bin.xml</descriptor>
-                        <descriptor>assembly/src.xml</descriptor>
-                    </descriptors>
-                    <tarLongFileMode>gnu</tarLongFileMode>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>2.0.4</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <attach>true</attach>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.felix</groupId>
-                  <artifactId>maven-bundle-plugin</artifactId>
-                  <version>1.4.0</version>
-                  <extensions>true</extensions>
-                  <configuration>
-                      <instructions>
-                          <Bundle-Version>1.0.0</Bundle-Version>
-                          <Bundle-Name>org.apache.ws.security</Bundle-Name>
-                          <Bundle-Vendor>Apache Software Foundation</Bundle-Vendor>
-                          <Bundle-Description>${pom.artifactId}</Bundle-Description>
-                          <Bundle-SymbolicName>org.apache.ws.security</Bundle-SymbolicName>
-                          <Export-Package>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <version>1.4.0</version>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-Version>1.0.0</Bundle-Version>
+                        <Bundle-Name>org.apache.ws.security</Bundle-Name>
+                        <Bundle-Vendor>Apache Software Foundation</Bundle-Vendor>
+                        <Bundle-Description>${pom.artifactId}</Bundle-Description>
+                        <Bundle-SymbolicName>org.apache.ws.security</Bundle-SymbolicName>
+                        <Export-Package>
                               org.apache.ws.security.*; version=1.5.4,
-                              org.apache.ws.axis.security.*; version=1.5.4,                             
-                          </Export-Package>
-                          <Import-Package>
+                              org.apache.ws.axis.security.*; version=1.5.4,
+                        </Export-Package>
+                        <Import-Package>
                               !org.apache.ws.security.*,
                               !org.apache.ws.axis.security.*,
                               javax.xml.crypto.*,
@@ -232,14 +179,96 @@
                               org.jcp.xml.dsig.internal.*,
                               org.opensaml.*,
                               *;resolution:=optional
-                          </Import-Package>
-                          <DynamicImport-Package>*</DynamicImport-Package>
-                      </instructions>
-                  </configuration>
-              </plugin>
+                        </Import-Package>
+                        <DynamicImport-Package>*</DynamicImport-Package>
+                    </instructions>
+                </configuration>
+            </plugin>
         </plugins>
+
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <configuration>
+                        <reportFormat>brief</reportFormat>
+                        <useFile>false</useFile>
+                        <childDelegation>false</childDelegation>
+                        <includes>
+                            <include>**/PackageTests.java</include>
+                        </includes>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-release-plugin</artifactId>
+                    <configuration>
+                        <tagBase>
+                            https://svn.apache.org/repos/asf/webservices/wss4j/tags/
+                        </tagBase>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>2.0.2</version>
+                    <configuration>
+                        <source>1.3</source>
+                        <target>1.3</target>
+                        <testExcludes>
+                            <exclude>interop/**/*</exclude>
+                        </testExcludes>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-source-plugin</artifactId>
+                    <version>2.0.4</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <attach>true</attach>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-javadoc-plugin</artifactId>
+                    <version>2.5</version>
+                    <executions>
+                        <execution>
+                            <goals>
+                                <goal>jar</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                    <configuration>
+                        <attach>true</attach>
+                    </configuration>
+                </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-assembly-plugin</artifactId>
+                    <version>2.1</version>
+                    <configuration>
+                        <descriptors>
+                            <descriptor>assembly/bin.xml</descriptor>
+                            <descriptor>assembly/src.xml</descriptor>
+                        </descriptors>
+                        <tarLongFileMode>gnu</tarLongFileMode>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
     </build>
     
+
+
     <profiles>
         <profile>
             <id>release</id>
@@ -255,16 +284,29 @@
                         <groupId>org.apache.maven.plugins</groupId>
                         <artifactId>maven-javadoc-plugin</artifactId>
                         <version>2.5</version>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>jar</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <attach>true</attach>
-                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <version>2.0.4</version>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>deploy</id>
+            <activation>
+                <property>
+                    <name>deploy</name>
+                    <value></value>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-source-plugin</artifactId>
+                        <version>2.0.4</version>
                     </plugin>
                 </plugins>
             </build>
@@ -298,6 +340,8 @@
         </profile>
     </profiles>
     
+
+
     <properties>
         <xmlsec.version>1.4.2</xmlsec.version>
         <opensaml.version>1.1</opensaml.version>
@@ -311,6 +355,8 @@
         <junit.version>3.8.1</junit.version>
     </properties>
     
+
+
     <dependencies>
         <dependency>
             <groupId>commons-logging</groupId>
@@ -318,6 +364,18 @@
             <version>${commons.logging.version}</version>
         </dependency>
         <dependency>
+            <groupId>commons-discovery</groupId>
+            <artifactId>commons-discovery</artifactId>
+            <version>0.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.santuario</groupId>
             <artifactId>xmlsec</artifactId>
             <version>${xmlsec.version}</version>
@@ -346,6 +404,7 @@
             <groupId>org.opensaml</groupId>
             <artifactId>opensaml</artifactId>
             <version>${opensaml.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.axis</groupId>
@@ -428,6 +487,8 @@
         </plugins>
     </reporting>
     
+
+
     <distributionManagement>
         <repository>
             <id>apache-repo</id>

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java?rev=727760&r1=727759&r2=727760&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java Thu Dec 18 08:46:22 2008
@@ -66,6 +66,7 @@
      * overhead.
      */
     private static SecureRandom random = null;
+    private static String randomAlgorithm = null;
     
     /**
      * Returns the first WS-Security header element for a given actor. Only one
@@ -1007,8 +1008,9 @@
     resolveSecureRandom(
         final String algorithm
     ) throws NoSuchAlgorithmException {
-        if (random == null) {
+        if (random == null || !algorithm.equals(randomAlgorithm)) {
             random = SecureRandom.getInstance(algorithm);
+            randomAlgorithm = algorithm;
             random.setSeed(System.currentTimeMillis());
         }
         return random;

Propchange: webservices/wss4j/trunk/test/log4j.properties
------------------------------------------------------------------------------
    cvs2svn:cvs-rev = 1.4

Propchange: webservices/wss4j/trunk/test/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: webservices/wss4j/trunk/test/log4j.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: webservices/wss4j/trunk/test/log4j.properties
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java?rev=727760&r1=727759&r2=727760&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityUTDK.java Thu Dec 18 08:46:22 2008
@@ -360,7 +360,7 @@
             WSSecurityUtil.fetchActionResult(results, WSConstants.SIGN);
         java.security.Principal principal = 
             (java.security.Principal) actionResult.get(WSSecurityEngineResult.TAG_PRINCIPAL);
-        System.out.println(principal.getName());
+        //System.out.println(principal.getName());
         assertTrue(principal.getName().indexOf("derivedKey") != -1);
     }
     



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org