[jboss-cvs] JBossAS SVN: r84758 - in projects/jboss-osgi/trunk: eclipse and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Feb 25 13:29:16 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-02-25 13:29:16 -0500 (Wed, 25 Feb 2009)
New Revision: 84758
Added:
projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/resources/log4j.xml
Modified:
projects/jboss-osgi/trunk/eclipse/eclipse.code.style.xml
projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java
projects/jboss-osgi/trunk/pom.xml
projects/jboss-osgi/trunk/testsuite/pom.xml
Log:
Fix test logging
Modified: projects/jboss-osgi/trunk/eclipse/eclipse.code.style.xml
===================================================================
--- projects/jboss-osgi/trunk/eclipse/eclipse.code.style.xml 2009-02-25 18:14:38 UTC (rev 84757)
+++ projects/jboss-osgi/trunk/eclipse/eclipse.code.style.xml 2009-02-25 18:29:16 UTC (rev 84758)
@@ -77,7 +77,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="3"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
@@ -129,7 +129,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/>
+<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="3"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
@@ -231,7 +231,7 @@
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="false"/>
+<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
Modified: projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java
===================================================================
--- projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java 2009-02-25 18:14:38 UTC (rev 84757)
+++ projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/java/org/jboss/test/bundle/metadata/VersionRangeTestCase.java 2009-02-25 18:29:16 UTC (rev 84758)
@@ -1,10 +1,11 @@
-
package org.jboss.test.bundle.metadata;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import junit.framework.Test;
+
+import org.jboss.logging.Logger;
import org.jboss.osgi.plugins.metadata.AbstractVersionRange;
import org.jboss.osgi.spi.metadata.VersionRange;
import org.jboss.test.BaseTestCase;
@@ -18,6 +19,8 @@
*/
public class VersionRangeTestCase extends BaseTestCase
{
+ final Logger log = Logger.getLogger(VersionRangeTestCase.class);
+
public VersionRangeTestCase(String name)
{
super(name);
@@ -31,17 +34,17 @@
public void testRangeSpecRE() throws Exception
{
String rangeSpec = "1.0.0";
- // ( 1 ) (2 (3) (4) ) (5 (6) (7) (8) ) (9 (10) (11) (12) (13) )
+ // ( 1 ) (2 (3) (4) ) (5 (6) (7) (8) ) (9 (10) (11) (12) (13) )
String versionPat = "\\[?(\\d+)|((\\d+).(\\d+))|((\\d+).(\\d+).(\\d+))|((\\d+).(\\d+).(\\d+).(\\p{Alnum}))\\]";
Pattern VERSION_RANGE_RE = Pattern.compile(versionPat);
Matcher matcher = VERSION_RANGE_RE.matcher(rangeSpec);
- if( matcher.matches() == true )
+ if (matcher.matches() == true)
{
- System.out.println("groupCount: "+matcher.groupCount());
- for(int n = 1; n <= matcher.groupCount(); n ++)
+ log.info("groupCount: " + matcher.groupCount());
+ for (int n = 1; n <= matcher.groupCount(); n++)
{
String g = matcher.group(n);
- System.out.println(n+":"+g);
+ log.info(n + ":" + g);
}
}
}
@@ -56,12 +59,12 @@
Version v110ga = new Version("1.1.0.GA");
Version v101ga = new Version("1.0.1.GA");
Version v102 = new Version("1.0.2");
- assertFalse("1.0.0 is in "+v100to110ExclusiveRange, v100to110ExclusiveRange.isInRange(v100));
- assertFalse("1.1.0 is in "+v100to110ExclusiveRange, v100to110ExclusiveRange.isInRange(v110));
- assertFalse("1.0.0.GA is in "+v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v100ga));
- assertFalse("1.1.0.GA is in "+v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v110ga));
- assertTrue("1.0.1.GA is in "+v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v101ga));
- assertTrue("1.0.2 is in "+v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v102));
+ assertFalse("1.0.0 is in " + v100to110ExclusiveRange, v100to110ExclusiveRange.isInRange(v100));
+ assertFalse("1.1.0 is in " + v100to110ExclusiveRange, v100to110ExclusiveRange.isInRange(v110));
+ assertFalse("1.0.0.GA is in " + v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v100ga));
+ assertFalse("1.1.0.GA is in " + v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v110ga));
+ assertTrue("1.0.1.GA is in " + v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v101ga));
+ assertTrue("1.0.2 is in " + v100GAto110GAExclusvieRange, v100GAto110GAExclusvieRange.isInRange(v102));
}
public void testInclusiveRanges() throws Exception
@@ -74,12 +77,12 @@
Version v110ga = new Version("1.1.0.GA");
Version v101ga = new Version("1.0.1.GA");
Version v102 = new Version("1.0.2");
- assertTrue("1.0.0 is in "+v100to110InclusiveRange, v100to110InclusiveRange.isInRange(v100));
- assertTrue("1.1.0 is in "+v100to110InclusiveRange, v100to110InclusiveRange.isInRange(v110));
- assertTrue("1.0.0.GA is in "+v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v100ga));
- assertTrue("1.1.0.GA is in "+v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v110ga));
- assertTrue("1.0.1.GA is in "+v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v101ga));
- assertTrue("1.0.2 is in "+v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v102));
+ assertTrue("1.0.0 is in " + v100to110InclusiveRange, v100to110InclusiveRange.isInRange(v100));
+ assertTrue("1.1.0 is in " + v100to110InclusiveRange, v100to110InclusiveRange.isInRange(v110));
+ assertTrue("1.0.0.GA is in " + v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v100ga));
+ assertTrue("1.1.0.GA is in " + v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v110ga));
+ assertTrue("1.0.1.GA is in " + v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v101ga));
+ assertTrue("1.0.2 is in " + v100GAto110GAInclusiveRange, v100GAto110GAInclusiveRange.isInRange(v102));
}
public void testMixedRanges() throws Exception
@@ -94,29 +97,29 @@
Version v110ga = new Version("1.1.0.GA");
Version v101ga = new Version("1.0.1.GA");
Version v102 = new Version("1.0.2");
- assertTrue("1.0.0 is in "+v100to110InclusiveLowerExclusiveUpperRange, v100to110InclusiveLowerExclusiveUpperRange.isInRange(v100));
- assertFalse("1.0.0 is in "+v100to110ExclusiveLowerInclusiveUpperRange, v100to110ExclusiveLowerInclusiveUpperRange.isInRange(v100));
- assertFalse("1.1.0 is in "+v100to110InclusiveLowerExclusiveUpperRange, v100to110InclusiveLowerExclusiveUpperRange.isInRange(v110));
- assertTrue("1.1.0 is in "+v100to110ExclusiveLowerInclusiveUpperRange, v100to110ExclusiveLowerInclusiveUpperRange.isInRange(v110));
+ assertTrue("1.0.0 is in " + v100to110InclusiveLowerExclusiveUpperRange, v100to110InclusiveLowerExclusiveUpperRange.isInRange(v100));
+ assertFalse("1.0.0 is in " + v100to110ExclusiveLowerInclusiveUpperRange, v100to110ExclusiveLowerInclusiveUpperRange.isInRange(v100));
+ assertFalse("1.1.0 is in " + v100to110InclusiveLowerExclusiveUpperRange, v100to110InclusiveLowerExclusiveUpperRange.isInRange(v110));
+ assertTrue("1.1.0 is in " + v100to110ExclusiveLowerInclusiveUpperRange, v100to110ExclusiveLowerInclusiveUpperRange.isInRange(v110));
- assertTrue("1.0.0.GA is in "+v100GAto110GAInclusiveLowerExclusiveUpperRange, v100GAto110GAInclusiveLowerExclusiveUpperRange.isInRange(v100ga));
- assertFalse("1.1.0.GA is in "+v100GAto110GAInclusiveLowerExclusiveUpperRange, v100GAto110GAInclusiveLowerExclusiveUpperRange.isInRange(v110ga));
- assertFalse("1.0.0.GA is in "+v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v100ga));
- assertTrue("1.1.0.GA is in "+v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v110ga));
- assertTrue("1.0.1.GA is in "+v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v101ga));
- assertTrue("1.0.2 is in "+v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v102));
+ assertTrue("1.0.0.GA is in " + v100GAto110GAInclusiveLowerExclusiveUpperRange, v100GAto110GAInclusiveLowerExclusiveUpperRange.isInRange(v100ga));
+ assertFalse("1.1.0.GA is in " + v100GAto110GAInclusiveLowerExclusiveUpperRange, v100GAto110GAInclusiveLowerExclusiveUpperRange.isInRange(v110ga));
+ assertFalse("1.0.0.GA is in " + v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v100ga));
+ assertTrue("1.1.0.GA is in " + v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v110ga));
+ assertTrue("1.0.1.GA is in " + v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v101ga));
+ assertTrue("1.0.2 is in " + v100GAto110GAExclusiveLowerInclusiveUpperRange, v100GAto110GAExclusiveLowerInclusiveUpperRange.isInRange(v102));
}
public void testSingleRange() throws Exception
{
VersionRange v100Range = AbstractVersionRange.parseRangeSpec("1.0.0");
Version v100 = new Version("1.0.0");
- assertTrue("1.0.0 is in "+v100Range, v100Range.isInRange(v100));
+ assertTrue("1.0.0 is in " + v100Range, v100Range.isInRange(v100));
Version v200 = new Version("2.0.0");
- assertTrue("2.0.0 is in "+v100Range, v100Range.isInRange(v200));
+ assertTrue("2.0.0 is in " + v100Range, v100Range.isInRange(v200));
Version v200ga = new Version("2.0.0.GA");
- assertTrue("2.0.0.GA is in "+v100Range, v100Range.isInRange(v200ga));
+ assertTrue("2.0.0.GA is in " + v100Range, v100Range.isInRange(v200ga));
Version v09beta = new Version("0.9.0.beta");
- assertFalse("0.9.0.beta is in "+v100Range, v100Range.isInRange(v09beta));
+ assertFalse("0.9.0.beta is in " + v100Range, v100Range.isInRange(v09beta));
}
}
Added: projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/resources/log4j.xml
===================================================================
--- projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/resources/log4j.xml (rev 0)
+++ projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/resources/log4j.xml 2009-02-25 18:29:16 UTC (rev 84758)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <appender name="FILE" class="org.apache.log4j.FileAppender">
+ <param name="File" value="${log4j.output.dir}/test.log"/>
+ <param name="Append" value="false"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <param name="Threshold" value="INFO" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.hibernate">
+ <priority value="INFO" />
+ </category>
+
+ <!-- hide optimistic locking failures
+ <category name="org.hibernate.event.def.AbstractFlushingEventListener">
+ <priority value="FATAL" />
+ </category>
+ -->
+
+ <!-- hide proxy narrowing warns -->
+ <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
+ <priority value="ERROR" />
+ </category>
+
+ <!-- show SQL DML statements as they are executed -->
+ <category name="org.hibernate.SQL">
+ <priority value="DEBUG" />
+ </category>
+
+ <!-- show JDBC parameters
+ <category name="org.hibernate.type">
+ <priority value="TRACE" />
+ </category>
+ -->
+
+ <!-- hide httpclient wire dumps -->
+ <category name="httpclient.wire.header">
+ <priority value="INFO" />
+ </category>
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <!--appender-ref ref="CONSOLE"/-->
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: projects/jboss-osgi/trunk/microcontainer/osgi-int/src/test/resources/log4j.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: projects/jboss-osgi/trunk/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/pom.xml 2009-02-25 18:14:38 UTC (rev 84757)
+++ projects/jboss-osgi/trunk/pom.xml 2009-02-25 18:29:16 UTC (rev 84758)
@@ -227,6 +227,12 @@
<configuration>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<failIfNoTests>false</failIfNoTests>
+ <systemProperties>
+ <property>
+ <name>log4j.output.dir</name>
+ <value>${basedir}/target</value>
+ </property>
+ </systemProperties>
</configuration>
</plugin>
</plugins>
Modified: projects/jboss-osgi/trunk/testsuite/pom.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/pom.xml 2009-02-25 18:14:38 UTC (rev 84757)
+++ projects/jboss-osgi/trunk/testsuite/pom.xml 2009-02-25 18:29:16 UTC (rev 84758)
@@ -88,12 +88,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${surefire.security.args}</argLine>
- <systemProperties>
- <property>
- <name>log4j.output.dir</name>
- <value>${basedir}/target</value>
- </property>
- </systemProperties>
<excludes>
<!-- [JBOSGI-36] Bundle classes leak into system classloader -->
<exclude>org/jboss/test/osgi/jbosgi36/junit/JBOSGI36Test.java</exclude>
More information about the jboss-cvs-commits
mailing list