Author: rhauch
Date: 2008-04-22 16:42:49 -0400 (Tue, 22 Apr 2008)
New Revision: 104
Added:
trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18nTest.java
trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleProgressMonitor.java
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentA.java
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentB.java
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleProgressMonitorTest.java
trunk/dna-common/src/test/java/org/jboss/dna/common/stats/HistogramTest.java
trunk/dna-common/src/test/java/org/jboss/dna/common/util/LogContextTest.java
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitBasicFunctionTest.java
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitDerbyStressTest.java
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerA.java
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerB.java
Log:
Removed the 'passthrough' I18n instance in CommonI18n, and moved it to MockI18n
class that is useful for testing.
Modified: trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java
===================================================================
--- trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-04-22
17:35:34 UTC (rev 103)
+++ trunk/dna-common/src/main/java/org/jboss/dna/common/CommonI18n.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -47,7 +47,7 @@
public static I18n i18nReplaceArgumentMismatchedParameters;
public static I18n i18nReplaceArgumentsMismatchedParameters;
public static I18n i18nClassInterface;
- public static I18n i18nClassNotPublic;
+ public static I18n i18nClassNotPublic;
public static I18n i18nFieldFinal;
public static I18n i18nFieldInvalidType;
public static I18n i18nFieldNotPublic;
@@ -62,6 +62,7 @@
public static I18n componentNotConfigured;
public static I18n progressMonitorBeginTask;
public static I18n progressMonitorStatus;
+ public static I18n initialProgressMonitorTaskName;
public static I18n argumentMayNotBeNegative;
public static I18n argumentMayNotBePositive;
@@ -89,7 +90,4 @@
public static I18n pathIsNotAbsolute;
public static I18n pathIsNotRelative;
public static I18n pathCannotBeNormalized;
-
- public static I18n passthrough;
- public static I18n empty;
}
Modified:
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleProgressMonitor.java
===================================================================
---
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleProgressMonitor.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/main/java/org/jboss/dna/common/monitor/SimpleProgressMonitor.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -54,7 +54,7 @@
public SimpleProgressMonitor( String activityName ) {
this.activityName = activityName != null ? activityName.trim() : "";
- this.taskName = CommonI18n.empty;
+ this.taskName = CommonI18n.initialProgressMonitorTaskName;
}
/**
Modified: trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties
===================================================================
---
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/main/resources/org/jboss/dna/common/CommonI18n.properties 2008-04-22
20:42:49 UTC (rev 104)
@@ -23,6 +23,7 @@
componentNotConfigured = The component {0} was not configured and will not be used
progressMonitorBeginTask = Beginning {0} ({1})
progressMonitorStatus = {0}
+initialProgressMonitorTaskName =
argumentMayNotBeNegative = The {0} argument value, {1}, may not be negative
argumentMayNotBePositive = The {0} argument value, {1}, may not be positive
@@ -50,6 +51,3 @@
pathCannotBeNormalized = The path {0} is invalid and cannot be normalized
dateParsingFailure = Unable to parse the date "{0}" using the standard ISO 8601
format
-
-passthrough = {0}
-empty =
Modified:
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentA.java
===================================================================
---
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentA.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentA.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -24,7 +24,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import net.jcip.annotations.ThreadSafe;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.monitor.ProgressMonitor;
/**
@@ -49,7 +49,7 @@
*/
public void doSomething( ProgressMonitor progressMonitor ) {
try {
- progressMonitor.beginTask(1, CommonI18n.passthrough, "Incrementing
counter");
+ progressMonitor.beginTask(1, MockI18n.passthrough, "Incrementing
counter");
// increment the counter and record the progress ...
this.counter.incrementAndGet();
progressMonitor.worked(1);
Modified:
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentB.java
===================================================================
---
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentB.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/test/java/org/jboss/dna/common/component/MockComponentB.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -24,7 +24,7 @@
import java.util.concurrent.atomic.AtomicInteger;
import net.jcip.annotations.ThreadSafe;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.monitor.ProgressMonitor;
/**
@@ -49,7 +49,7 @@
*/
public void doSomething( ProgressMonitor progressMonitor ) {
try {
- progressMonitor.beginTask(1, CommonI18n.passthrough, "Incrementing
counter");
+ progressMonitor.beginTask(1, MockI18n.passthrough, "Incrementing
counter");
// increment the counter and record the progress ...
this.counter.incrementAndGet();
progressMonitor.worked(1);
Added: trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
(rev 0)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.common.i18n;
+
+/**
+ * @author Randall Hauch
+ */
+public class MockI18n {
+
+ static {
+ try {
+ I18n.initialize(MockI18n.class);
+ } catch (final Exception err) {
+ System.err.println(err);
+ }
+ }
+
+ public static I18n passthrough;
+}
Property changes on:
trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18n.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18nTest.java
===================================================================
--- trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18nTest.java
(rev 0)
+++ trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18nTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.dna.common.i18n;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+
+/**
+ * @author Randall Hauch
+ */
+public class MockI18nTest {
+
+ @Test
+ public void shouldPassthroughText() {
+ String str = "This is some string to be passed through";
+ assertThat(MockI18n.passthrough.text(str), is(str));
+ }
+
+ @Test
+ public void shouldPassthroughTextWithoutReplacingParameters() {
+ String str = "This is some string to be passed through with {1}
parameters";
+ assertThat(MockI18n.passthrough.text(str), is(str));
+ }
+
+}
Property changes on:
trunk/dna-common/src/test/java/org/jboss/dna/common/i18n/MockI18nTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleProgressMonitorTest.java
===================================================================
---
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleProgressMonitorTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/test/java/org/jboss/dna/common/monitor/SimpleProgressMonitorTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -22,13 +22,13 @@
package org.jboss.dna.common.monitor;
+import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.core.IsSame.sameInstance;
-import static org.hamcrest.core.Is.is;
import static org.hamcrest.number.IsCloseTo.closeTo;
import static org.junit.Assert.assertThat;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.junit.Before;
import org.junit.Test;
@@ -64,7 +64,7 @@
@Test
public void shouldHaveProgressOfZeroPercentUponBeginningTask() {
- this.monitor.beginTask(100, CommonI18n.passthrough, validTaskName);
+ this.monitor.beginTask(100, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
@@ -74,7 +74,7 @@
@Test
public void shouldShowProperProgress() {
- this.monitor.beginTask(1000, CommonI18n.passthrough, validTaskName);
+ this.monitor.beginTask(1000, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
@@ -102,7 +102,7 @@
@Test
public void shouldShowProperProgressUsingSubtasks() {
- monitor.beginTask(1000, CommonI18n.passthrough, validTaskName);
+ monitor.beginTask(1000, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
@@ -117,7 +117,7 @@
assertThat(((SubProgressMonitor)subtask).getParent(),
is(sameInstance(monitor)));
String subtaskName = "Subtask " + i;
- subtask.beginTask(10, CommonI18n.passthrough, subtaskName); // note the
different total work for the subtask
+ subtask.beginTask(10, MockI18n.passthrough, subtaskName); // note the
different total work for the subtask
for (int j = 1; j <= 10; ++j) {
// Work the subtask
subtask.worked(1);
@@ -155,7 +155,7 @@
@Test
public void shouldAllowDoneToBeCalledEvenAfterFinished() {
- monitor.beginTask(1000, CommonI18n.passthrough, validTaskName);
+ monitor.beginTask(1000, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
@@ -184,7 +184,7 @@
@Test
public void shouldAllowCancelToBeRejected() {
- monitor.beginTask(1000, CommonI18n.passthrough, validTaskName);
+ monitor.beginTask(1000, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
@@ -218,7 +218,7 @@
@Test
public void shouldContinueToRecordWorkEvenWhenCancelled() {
- monitor.beginTask(1000, CommonI18n.passthrough, validTaskName);
+ monitor.beginTask(1000, MockI18n.passthrough, validTaskName);
ProgressStatus status = monitor.getStatus();
assertThat(status, is(notNullValue()));
assertThat(status.getActivityName(),
is(sameInstance(monitor.getActivityName())));
Modified: trunk/dna-common/src/test/java/org/jboss/dna/common/stats/HistogramTest.java
===================================================================
---
trunk/dna-common/src/test/java/org/jboss/dna/common/stats/HistogramTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/test/java/org/jboss/dna/common/stats/HistogramTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -21,15 +21,17 @@
*/
package org.jboss.dna.common.stats;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Random;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.math.FloatOperations;
import org.jboss.dna.common.math.MathOperations;
-import org.jboss.dna.common.stats.Histogram;
import org.jboss.dna.common.text.Inflector;
import org.jboss.dna.common.util.Logger;
import org.junit.Before;
@@ -55,7 +57,7 @@
}
public static <T extends Number> void writeHistogramToLog( Logger logger,
Histogram<T> histogram, int barLength, String description ) {
- logger.info(CommonI18n.passthrough, description != null ? description :
"Histogram:");
+ logger.info(MockI18n.passthrough, description != null ? description :
"Histogram:");
List<String> barGraph = histogram.getTextGraph(barLength);
for (String line : barGraph) {
logger.debug(" " + line);
Modified: trunk/dna-common/src/test/java/org/jboss/dna/common/util/LogContextTest.java
===================================================================
---
trunk/dna-common/src/test/java/org/jboss/dna/common/util/LogContextTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-common/src/test/java/org/jboss/dna/common/util/LogContextTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -22,9 +22,7 @@
package org.jboss.dna.common.util;
-import org.jboss.dna.common.CommonI18n;
-import org.jboss.dna.common.util.LogContext;
-import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.common.i18n.MockI18n;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -46,8 +44,8 @@
@Test
public void shouldAcceptValidKeys() {
LogContext.set("username", "jsmith");
- logger.info(CommonI18n.passthrough, "tracking activity for username");
- logger.info(CommonI18n.passthrough, "A second log message");
+ logger.info(MockI18n.passthrough, "tracking activity for username");
+ logger.info(MockI18n.passthrough, "A second log message");
}
}
Added: trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
===================================================================
--- trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
(rev 0)
+++
trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties 2008-04-22
20:42:49 UTC (rev 104)
@@ -0,0 +1 @@
+passthrough = {0}
Property changes on:
trunk/dna-common/src/test/resources/org/jboss/dna/common/i18n/MockI18n.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitBasicFunctionTest.java
===================================================================
---
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitBasicFunctionTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitBasicFunctionTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -31,7 +31,7 @@
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.apache.jackrabbit.core.TransientRepository;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.util.FileUtil;
import org.jboss.dna.common.util.Logger;
import org.junit.After;
@@ -76,7 +76,7 @@
assertNotNull(session);
String username = session.getUserID();
String name = repository.getDescriptor(Repository.REP_NAME_DESC);
- logger.info(CommonI18n.passthrough, "Logged in as " + username +
" to a " + name + " repository");
+ logger.info(MockI18n.passthrough, "Logged in as " + username +
" to a " + name + " repository");
} finally {
if (session != null) session.logout();
}
@@ -91,7 +91,7 @@
assertNotNull(session);
String username = session.getUserID();
String name = repository.getDescriptor(Repository.REP_NAME_DESC);
- logger.info(CommonI18n.passthrough, "Logged in as " + username +
" to a " + name + " repository");
+ logger.info(MockI18n.passthrough, "Logged in as " + username +
" to a " + name + " repository");
} finally {
if (session != null) session.logout();
}
@@ -106,7 +106,7 @@
Session session = this.repository.login(creds);
assertNotNull(session);
sessions.add(session);
- logger.info(CommonI18n.passthrough, "Logged in as " +
session.getUserID());
+ logger.info(MockI18n.passthrough, "Logged in as " +
session.getUserID());
}
} finally {
while (!sessions.isEmpty()) {
@@ -150,8 +150,8 @@
// Retrieve content ...
Node node = root.getNode("hello/world");
- this.logger.info(CommonI18n.passthrough, "Node 'hello/world' has
path: " + node.getPath());
- this.logger.info(CommonI18n.passthrough, "Node 'hello/world' has
'message' property: " + node.getProperty("message").getString());
+ this.logger.info(MockI18n.passthrough, "Node 'hello/world' has
path: " + node.getPath());
+ this.logger.info(MockI18n.passthrough, "Node 'hello/world' has
'message' property: " + node.getProperty("message").getString());
} finally {
if (session != null) session.logout();
}
@@ -163,11 +163,11 @@
// Retrieve content
Node node = root.getNode("hello/world");
- this.logger.info(CommonI18n.passthrough, "Node 'hello/world' has
path: " + node.getPath());
- this.logger.info(CommonI18n.passthrough, "Node 'hello/world' has
'message' property: " + node.getProperty("message").getString());
+ this.logger.info(MockI18n.passthrough, "Node 'hello/world' has
path: " + node.getPath());
+ this.logger.info(MockI18n.passthrough, "Node 'hello/world' has
'message' property: " + node.getProperty("message").getString());
// Remove content
- this.logger.info(CommonI18n.passthrough, "Node 'hello' is being
removed");
+ this.logger.info(MockI18n.passthrough, "Node 'hello' is being
removed");
root.getNode("hello").remove();
session.save();
} finally {
Modified:
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitDerbyStressTest.java
===================================================================
---
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitDerbyStressTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitDerbyStressTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -27,7 +27,7 @@
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.apache.jackrabbit.core.TransientRepository;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.stats.HistogramTest;
import org.jboss.dna.common.stats.Stopwatch;
import org.jboss.dna.common.util.FileUtil;
@@ -65,7 +65,7 @@
logger = Logger.getLogger(JackrabbitDerbyStressTest.class);
// Set up the transient repository ...
- logger.info(CommonI18n.passthrough, "Creating test repository for stress
test and logging in with user " + USERNAME);
+ logger.info(MockI18n.passthrough, "Creating test repository for stress test
and logging in with user " + USERNAME);
this.repository = new TransientRepository(REPOSITORY_CONFIG_PATH,
REPOSITORY_DIRECTORY_PATH);
SimpleCredentials creds = new SimpleCredentials(USERNAME, PASSWORD);
@@ -95,7 +95,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
stopwatch.getHistogram(3).setBucketCount(50), 80, "create 100 nodes with no children
and no properties");
- this.logger.info(CommonI18n.passthrough, stopwatch.toString());
+ this.logger.info(MockI18n.passthrough, stopwatch.toString());
}
@Test
@@ -109,7 +109,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
stopwatch.getHistogram(1).setBucketCount(50), 80, "create 1000 nodes with no children
and no properties");
- this.logger.info(CommonI18n.passthrough, stopwatch.toString());
+ this.logger.info(MockI18n.passthrough, stopwatch.toString());
}
@Test
@@ -123,7 +123,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
stopwatch.getHistogram(1).setBucketCount(50), 80, "create 5000 nodes with no children
and no properties");
- this.logger.info(CommonI18n.passthrough, stopwatch.toString());
+ this.logger.info(MockI18n.passthrough, stopwatch.toString());
}
@Test
@@ -137,7 +137,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
stopwatch.getHistogram(1).setBucketCount(50), 80, "create 10000 nodes with no
children and no properties");
- this.logger.info(CommonI18n.passthrough, stopwatch.toString());
+ this.logger.info(MockI18n.passthrough, stopwatch.toString());
}
@Test
@@ -153,7 +153,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
stopwatch.getHistogram(3).setBucketCount(50), 80, "create 100 nodes with no children
and several properties");
- this.logger.info(CommonI18n.passthrough, stopwatch.toString());
+ this.logger.info(MockI18n.passthrough, stopwatch.toString());
}
//
// @Test
Modified:
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java
===================================================================
---
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-integration-tests/src/test/java/org/jboss/dna/tests/integration/jackrabbit/JackrabbitInMemoryTest.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -27,7 +27,7 @@
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import org.apache.jackrabbit.core.TransientRepository;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.stats.HistogramTest;
import org.jboss.dna.common.stats.Stopwatch;
import org.jboss.dna.common.util.FileUtil;
@@ -64,7 +64,7 @@
logger = Logger.getLogger(JackrabbitInMemoryTest.class);
// Set up the transient repository ...
- logger.info(CommonI18n.passthrough, "Creating test repository for stress
test and logging in with user " + USERNAME);
+ logger.info(MockI18n.passthrough, "Creating test repository for stress test
and logging in with user " + USERNAME);
this.repository = new TransientRepository(REPOSITORY_CONFIG_PATH,
REPOSITORY_DIRECTORY_PATH);
SimpleCredentials creds = new SimpleCredentials(USERNAME, PASSWORD);
@@ -119,7 +119,7 @@
}
rootNode.save();
HistogramTest.writeHistogramToLog(logger,
nodeStopwatch.getHistogram(3).setBucketCount(50), 80, "create 100 nodes with no
children and no properties");
- this.logger.info(CommonI18n.passthrough, nodeStopwatch.toString());
+ this.logger.info(MockI18n.passthrough, nodeStopwatch.toString());
}
@Test
@@ -133,8 +133,8 @@
HistogramTest.writeHistogramToLog(logger,
nodeStopwatch.getHistogram(3).setBucketCount(50), 80, "create tree of " +
numNodes + " nodes (2 deep, 10 children at every node)");
HistogramTest.writeHistogramToLog(logger,
saveStopwatch.getHistogram(3).setBucketCount(50), 80, "1 save of 2x10 tree of "
+ numNodes + " nodes");
- this.logger.info(CommonI18n.passthrough, "Node operation times: " +
nodeStopwatch.toString());
- this.logger.info(CommonI18n.passthrough, "Save times: " +
saveStopwatch.toString());
+ this.logger.info(MockI18n.passthrough, "Node operation times: " +
nodeStopwatch.toString());
+ this.logger.info(MockI18n.passthrough, "Save times: " +
saveStopwatch.toString());
}
@Test
Modified:
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerA.java
===================================================================
---
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerA.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerA.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -28,11 +28,9 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.jcr.Node;
import net.jcip.annotations.ThreadSafe;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.monitor.ProgressMonitor;
import org.jboss.dna.repository.observation.NodeChange;
-import org.jboss.dna.repository.sequencers.Sequencer;
-import org.jboss.dna.repository.sequencers.SequencerConfig;
import org.jboss.dna.repository.util.ExecutionContext;
import org.jboss.dna.repository.util.RepositoryNodePath;
@@ -67,7 +65,7 @@
*/
public void execute( Node input, String sequencedPropertyName, NodeChange changes,
Set<RepositoryNodePath> outputPaths, ExecutionContext context, ProgressMonitor
progress ) {
try {
- progress.beginTask(1, CommonI18n.passthrough, "Incrementing
counter");
+ progress.beginTask(1, MockI18n.passthrough, "Incrementing
counter");
// increment the counter and record the progress ...
this.counter.incrementAndGet();
this.latch.countDown();
Modified:
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerB.java
===================================================================
---
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerB.java 2008-04-22
17:35:34 UTC (rev 103)
+++
trunk/dna-repository/src/test/java/org/jboss/dna/repository/sequencers/MockSequencerB.java 2008-04-22
20:42:49 UTC (rev 104)
@@ -28,11 +28,9 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.jcr.Node;
import net.jcip.annotations.ThreadSafe;
-import org.jboss.dna.common.CommonI18n;
+import org.jboss.dna.common.i18n.MockI18n;
import org.jboss.dna.common.monitor.ProgressMonitor;
import org.jboss.dna.repository.observation.NodeChange;
-import org.jboss.dna.repository.sequencers.Sequencer;
-import org.jboss.dna.repository.sequencers.SequencerConfig;
import org.jboss.dna.repository.util.ExecutionContext;
import org.jboss.dna.repository.util.RepositoryNodePath;
@@ -67,7 +65,7 @@
*/
public void execute( Node input, String sequencedPropertyName, NodeChange changes,
Set<RepositoryNodePath> outputPaths, ExecutionContext context, ProgressMonitor
progress ) {
try {
- progress.beginTask(1, CommonI18n.passthrough, "Incrementing
counter");
+ progress.beginTask(1, MockI18n.passthrough, "Incrementing
counter");
// increment the counter and record the progress ...
this.counter.incrementAndGet();
this.latch.countDown();