exo-jcr SVN: r2148 - in jcr/trunk/exo.jcr.component.ext/src: main/java/org/exoplatform/services/jcr/ext/backup/impl and 2 other directories.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2010-03-26 04:01:55 -0400 (Fri, 26 Mar 2010)
New Revision: 2148
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/RepositoryBackupChainImpl.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestBackupManager.java
jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
Log:
EXOJCR-549 : The implementation backup/restore whole repository in HTTPBackupAgent.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-03-26 07:52:01 UTC (rev 2147)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-03-26 08:01:55 UTC (rev 2148)
@@ -97,7 +97,47 @@
writer.flush();
}
+
+ public synchronized void write(RepositoryBackupConfig config, String fullBackupType, String incrementalBackupType)
+ throws XMLStreamException
+ {
+ writer.writeStartElement("repositoy-backup-config");
+ writer.writeStartElement("full-backup-type");
+ writer.writeCharacters(fullBackupType);
+ writer.writeEndElement();
+
+ writer.writeStartElement("incremental-backup-type");
+ writer.writeCharacters(incrementalBackupType);
+ writer.writeEndElement();
+
+ if (config.getBackupDir() != null)
+ {
+ writer.writeStartElement("backup-dir");
+ writer.writeCharacters(config.getBackupDir().getAbsolutePath());
+ writer.writeEndElement();
+ }
+
+ if (config.getRepository() != null)
+ {
+ writer.writeStartElement("repository");
+ writer.writeCharacters(config.getRepository());
+ writer.writeEndElement();
+ }
+
+ writer.writeStartElement("incremental-job-period");
+ writer.writeCharacters(Long.toString(config.getIncrementalJobPeriod()));
+ writer.writeEndElement();
+
+ writer.writeStartElement("incremental-job-number");
+ writer.writeCharacters(Integer.toString(config.getIncrementalJobNumber()));
+ writer.writeEndElement();
+
+ writer.writeEndElement();
+
+ writer.flush();
+ }
+
public synchronized void writeEndLog()
{
try
@@ -132,8 +172,6 @@
public LogReader(File logFile) throws FileNotFoundException, XMLStreamException, FactoryConfigurationError
{
this.logFile = logFile;
- jobEntries = new ArrayList<JobEntryInfo>();
-
reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(logFile));
}
@@ -150,6 +188,9 @@
case StartElement.START_ELEMENT :
String name = reader.getLocalName();
+ if (name.equals("repository-backup-config"))
+ config = readBackupConfig();
+
if (name.equals("system-workspace"))
workspaceSystem = readContent();
@@ -179,16 +220,6 @@
return config;
}
- public Calendar getBeginTime()
- {
- return jobEntries.get(0).getDate();
- }
-
- public Calendar getEndTime()
- {
- return jobEntries.get(jobEntries.size() - 1).getDate();
- }
-
public List<JobEntryInfo> getJobEntryInfoNormalizeList()
{
return jobEntriesNormalize;
@@ -225,7 +256,57 @@
return wsBackupInfo;
}
+
+ private BackupConfig readBackupConfig() throws XMLStreamException
+ {
+ BackupConfig conf = new BackupConfig();
+ boolean endBackupConfig = false;
+
+ while (!endBackupConfig)
+ {
+ int eventCode = reader.next();
+ switch (eventCode)
+ {
+
+ case StartElement.START_ELEMENT :
+ String name = reader.getLocalName();
+
+ if (name.equals("backup-dir"))
+ conf.setBackupDir(new File(readContent()));
+
+ if (name.equals("repository"))
+ conf.setRepository(readContent());
+
+ if (name.equals("workspace"))
+ conf.setWorkspace(readContent());
+
+ if (name.equals("incremental-job-period"))
+ conf.setIncrementalJobPeriod(Long.valueOf(readContent()).longValue());
+
+ if (name.equals("incremental-job-number"))
+ conf.setIncrementalJobNumber(Integer.valueOf(readContent()).intValue());
+
+ if (name.equals("full-backup-type"))
+ fullBackupType = readContent();
+
+ if (name.equals("full-backup-type"))
+ fullBackupType = readContent();
+
+ break;
+
+ case StartElement.END_ELEMENT :
+ String tagName = reader.getLocalName();
+
+ if (tagName.equals("repository-backup-config"))
+ endBackupConfig = true;
+ break;
+ }
+ }
+
+ return conf;
+ }
+
private String readContent() throws XMLStreamException
{
String content = null;
@@ -310,66 +391,6 @@
return type;
}
-
- public BackupConfig readBackupConfig() throws XMLStreamException
- {
- BackupConfig conf = new BackupConfig();
-
- boolean endBackupConfig = false;
-
- while (!endBackupConfig)
- {
- int eventCode = reader.next();
- switch (eventCode)
- {
-
- case StartElement.START_ELEMENT :
- String name = reader.getLocalName();
-
- if (name.equals("backup-dir"))
- conf.setBackupDir(new File(readContent()));
-
- if (name.equals("repository"))
- conf.setRepository(readContent());
-
- if (name.equals("incremental-job-period"))
- conf.setIncrementalJobPeriod(Long.valueOf(readContent()).longValue());
-
- if (name.equals("incremental-job-number"))
- conf.setIncrementalJobNumber(Integer.valueOf(readContent()).intValue());
-
- break;
-
- case StartElement.END_ELEMENT :
- String tagName = reader.getLocalName();
-
- if (tagName.equals("repository-backup-cain-log"))
- endBackupConfig = true;
- break;
- }
- }
-
- return conf;
- }
-
- public void jobEntrysNormalize()
- {
- jobEntriesNormalize = new ArrayList<JobEntryInfo>();
-
- for (int i = 0; i < jobEntries.size(); i++)
- {
- JobEntryInfo entryInfo = jobEntries.get(i);
-
- boolean alreadyExist = false;
-
- for (int j = 0; j < jobEntriesNormalize.size(); j++)
- if (jobEntriesNormalize.get(j).getURL().toString().equals(entryInfo.getURL().toString()))
- alreadyExist = true;
-
- if (!alreadyExist)
- jobEntriesNormalize.add(entryInfo);
- }
- }
}
protected static Log logger = ExoLogger.getLogger("ext.BackupChainLog");
@@ -386,8 +407,6 @@
private RepositoryBackupConfig config;
- private List<JobEntryInfo> jobEntries;
-
private String backupId;
private Calendar startedTime;
@@ -400,6 +419,10 @@
private String workspaceSystem;
+ private String fullBackupType;
+
+ private String increnetalBackupType;
+
/**
* @param logDirectory
* @param config
@@ -409,8 +432,14 @@
* @param startTime
* @throws BackupOperationException
*/
- public RepositoryBackupChainLog(File logDirectory, RepositoryBackupConfig config, String systemWorkspace,
- List<String> wsLogFilePathList, String backupId, Calendar startTime) throws BackupOperationException
+ public RepositoryBackupChainLog(File logDirectory,
+ RepositoryBackupConfig config,
+ String fullBackupType,
+ String incrementalBackupType,
+ String systemWorkspace,
+ List<String> wsLogFilePathList,
+ String backupId,
+ Calendar startTime) throws BackupOperationException
{
try
{
@@ -420,9 +449,11 @@
this.backupId = backupId;
this.config = config;
this.startedTime = Calendar.getInstance();
- this.jobEntries = new ArrayList<JobEntryInfo>();
+ this.fullBackupType = fullBackupType;
+ this.increnetalBackupType = incrementalBackupType;
logWriter = new LogWriter(log);
+ logWriter.write(config, fullBackupType, incrementalBackupType);
logWriter.writeSystemWorkspaceName(systemWorkspace);
logWriter.writeBackupsPath(wsLogFilePathList);
@@ -456,21 +487,6 @@
{
logReader = new LogReader(log);
logReader.readLogFile();
- logReader.jobEntrysNormalize();
-
- this.config = logReader.getBackupConfig();
- this.startedTime = logReader.getBeginTime();
- this.finishedTime = logReader.getEndTime();
- this.jobEntries = logReader.getJobEntryInfoNormalizeList();
-
- for (JobEntryInfo info : jobEntries)
- {
- if (info.getType() == BackupJob.INCREMENTAL)
- {
- config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
- break;
- }
- }
}
catch (FileNotFoundException e)
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/RepositoryBackupChainImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/RepositoryBackupChainImpl.java 2010-03-26 07:52:01 UTC (rev 2147)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/RepositoryBackupChainImpl.java 2010-03-26 08:01:55 UTC (rev 2148)
@@ -96,7 +96,14 @@
workspaceBackups.add(bchain);
}
- this.repositoryChainLog = new RepositoryBackupChainLog(logDirectory, this.config, repository.getConfiguration().getSystemWorkspaceName(), wsLogFilePathList, this.repositoryBackupId, startTime);
+ this.repositoryChainLog = new RepositoryBackupChainLog(logDirectory,
+ this.config,
+ fullBackupType,
+ incrementalBackupType,
+ repository.getConfiguration().getSystemWorkspaceName(),
+ wsLogFilePathList,
+ this.repositoryBackupId,
+ startTime);
state = INITIALIZED;
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestBackupManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestBackupManager.java 2010-03-26 07:52:01 UTC (rev 2147)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/TestBackupManager.java 2010-03-26 08:01:55 UTC (rev 2148)
@@ -844,7 +844,7 @@
RepositoryEntry re = (RepositoryEntry)ws1Session.getContainer().getComponentInstanceOfType(RepositoryEntry.class);
String newRepositoryName = "repo_restored_2";
- RepositoryEntry newRepositoryEntry = makeRepositoryEntry(newRepositoryName, re, "jdbcjcr_to_repository_restore_1", null);
+ RepositoryEntry newRepositoryEntry = makeRepositoryEntry(newRepositoryName, re, "jdbcjcr_to_repository_restore_2", null);
File backLog = new File(bch.getLogFilePath());
if (backLog.exists())
@@ -926,7 +926,7 @@
RepositoryEntry re = (RepositoryEntry)ws1Session.getContainer().getComponentInstanceOfType(RepositoryEntry.class);
String newRepositoryName = "repo_restored_3";
- RepositoryEntry newRepositoryEntry = makeRepositoryEntry(newRepositoryName, re, "jdbcjcr_to_repository_restore_1", null);
+ RepositoryEntry newRepositoryEntry = makeRepositoryEntry(newRepositoryName, re, "jdbcjcr_to_repository_restore_3", null);
// create workspace mappingS
Map<String, String> workspaceMapping = new HashedMap();
Modified: jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2010-03-26 07:52:01 UTC (rev 2147)
+++ jcr/trunk/exo.jcr.component.ext/src/test/resources/conf/standalone/test-configuration.xml 2010-03-26 08:01:55 UTC (rev 2148)
@@ -1912,6 +1912,60 @@
</properties-param>
</init-params>
</component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr_to_repository_restore_2</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr_to_repository_restore_2" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>bind.datasource</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.naming.BindReferencePlugin</type>
+ <init-params>
+ <value-param>
+ <name>bind-name</name>
+ <value>jdbcjcr_to_repository_restore_3</value>
+ </value-param>
+ <value-param>
+ <name>class-name</name>
+ <value>javax.sql.DataSource</value>
+ </value-param>
+ <value-param>
+ <name>factory</name>
+ <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
+ </value-param>
+ <properties-param>
+ <name>ref-addresses</name>
+ <description>ref-addresses</description>
+ <property name="driverClassName" value="org.hsqldb.jdbcDriver" />
+ <property name="url" value="jdbc:hsqldb:file:target/temp/data/jdbcjcr_to_repository_restore_3" />
+ <property name="username" value="sa" />
+ <property name="password" value="" />
+ </properties-param>
+ </init-params>
+ </component-plugin>
</external-component-plugins>
</configuration>
14 years, 2 months
exo-jcr SVN: r2147 - in jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr: api/core/query and 21 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-26 03:52:01 -0400 (Fri, 26 Mar 2010)
New Revision: 2147
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/MainTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/ConcurrentQueryTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/AbstractImportTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestDocumentViewImport.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImport.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewCollision.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewImport.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestInitRepository.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestSaveConfiguration.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TransientNodesManagerUtil.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNodeTypeRegistration.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNtAutorcreating.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestSuperTypeChanges.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/BaseQueryTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestFuzzyQuery.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestIndexingConfig.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestMultiNodeTypes.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestOrderByCaseSensitive.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestPermission.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestRemove.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/lucene/TestRemapping.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedCacheMultithread.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCWDCTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/TreeGenerator.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/ValueSsh1Comparator.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/generator/RandomValueNodeGenerator.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/TestStringConverter.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/integration/JCRAPITest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQuery.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQueryWithModes.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadPredictableIndexerQuery.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestJira282.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestSameUserLogin.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/thread/UserThread.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestLimitAndOffset.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/common/AddNodeAmongSessionsTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java
Log:
EXOJCR-605: jcr.core tests clases - Loggers updated
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -59,7 +59,7 @@
public abstract class BaseStandaloneTest extends TestCase
{
- protected static Log log = ExoLogger.getLogger("jcr.JCRTest");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.JCRTest");
protected static String TEMP_PATH = "./temp/fsroot";
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/MainTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/MainTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/MainTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -32,7 +32,7 @@
public class MainTest extends TestCase
{
- private Log log = ExoLogger.getLogger("jcr.Test");
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.MainTest");
public static void main(String args[])
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/ConcurrentQueryTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/ConcurrentQueryTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/core/query/ConcurrentQueryTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -250,7 +250,7 @@
/**
* The logger instance for this class
*/
- private static final Log log = ExoLogger.getLogger(QueryWorker.class);
+ private static final Log log = ExoLogger.getLogger("exo.jcr.component.core.QueryWorker");
QueryWorker(Session s, String query, List<RepositoryException> exceptions, PrintWriter log)
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/AbstractImportTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/AbstractImportTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/AbstractImportTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -74,7 +74,7 @@
/**
* Logger.
*/
- private Log log = ExoLogger.getLogger("jcr.BaseImportTest");
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.BaseImportTest");
private final Random random = new Random();
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestDocumentViewImport.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestDocumentViewImport.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestDocumentViewImport.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -53,7 +53,7 @@
*/
public class TestDocumentViewImport extends AbstractImportTest
{
- private static Log log = ExoLogger.getLogger("jcr.TestDocumentViewImport");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.TestDocumentViewImport");
private final String docView =
"<exo:test xmlns:nt=\"http://www.jcp.org/jcr/nt/1.0\" "
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImport.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImport.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestImport.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -69,7 +69,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestImport");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestImport");
private final Random random;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewCollision.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewCollision.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewCollision.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -54,7 +54,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestSystemViewCollisionTest");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestSystemViewCollisionTest");
public void testUuidBehaviourIMPORT_UUID_COLLISION_THROW() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewImport.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewImport.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/importing/TestSystemViewImport.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -59,7 +59,7 @@
static protected final String BIN_STRING = "222222222222222222<=Any binary=>22222222222222222222";
- private static Log log = ExoLogger.getLogger("jcr.TestSystemViewImport");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.TestSystemViewImport");
private Node sysview;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestInitRepository.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestInitRepository.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestInitRepository.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -42,7 +42,7 @@
public class TestInitRepository extends JcrImplBaseTest
{
- protected static Log log = ExoLogger.getLogger("jcr.JCRTest");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.JCRTest");
public void _testRepositoryServiceRegistration() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestSaveConfiguration.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestSaveConfiguration.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestSaveConfiguration.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -32,7 +32,7 @@
*/
public class TestSaveConfiguration extends JcrImplBaseTest
{
- protected static Log log = ExoLogger.getLogger("jcr.SessionDataManager");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.SessionDataManager");
private final TestRepositoryManagement rpm = new TestRepositoryManagement();
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestWorkspaceRestore.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -50,7 +50,7 @@
private static boolean isDefaultWsCreated = false;
- private final Log log = ExoLogger.getLogger("jcr.TestWorkspaceRestore");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestWorkspaceRestore");
private final ConfigurationHelper helper = ConfigurationHelper.getInstence();
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TransientNodesManagerUtil.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TransientNodesManagerUtil.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TransientNodesManagerUtil.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -33,7 +33,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.SessionDatamenagerUtil");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.SessionDatamenagerUtil");
public static SessionChangesLog getChangesLog(SessionDataManager dataManager)
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNodeTypeRegistration.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNodeTypeRegistration.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNodeTypeRegistration.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -50,7 +50,7 @@
/**
* Class logger.
*/
- private static final Log LOG = ExoLogger.getLogger(TestNodeTypeRegistration.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TestNodeTypeRegistration");
private NodeTypeValue testNodeTypeValue = null;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNtAutorcreating.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNtAutorcreating.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestNtAutorcreating.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -42,7 +42,7 @@
*/
private static boolean registred = false;
- private static final Log LOG = ExoLogger.getLogger(TestNtAutorcreating.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TestNtAutorcreating");
public void testAutocreate() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestSuperTypeChanges.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestSuperTypeChanges.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/nodetype/TestSuperTypeChanges.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -43,7 +43,7 @@
/**
* Class logger.
*/
- private static final Log LOG = ExoLogger.getLogger(TestSuperTypeChanges.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TestSuperTypeChanges");
/**
* @throws Exception
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/BaseQueryTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/BaseQueryTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/BaseQueryTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -43,7 +43,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.BaseQueryTest");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.BaseQueryTest");
protected SearchManager defaultSearchManager;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestFuzzyQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestFuzzyQuery.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestFuzzyQuery.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -37,7 +37,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestFuzzyQuery");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestFuzzyQuery");
public void testFuzziness() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestIndexingConfig.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestIndexingConfig.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestIndexingConfig.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -73,7 +73,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestIndexingConfig");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestIndexingConfig");
private SearchManager searchManager;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestMultiNodeTypes.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestMultiNodeTypes.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestMultiNodeTypes.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -37,7 +37,7 @@
/**
* Class logger.
*/
- private static final Log LOG = ExoLogger.getLogger(TestMultiNodeTypes.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TestMultiNodeTypes");
public void testSelect2NtSQL() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestOrderByCaseSensitive.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestOrderByCaseSensitive.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestOrderByCaseSensitive.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -38,7 +38,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestOrderByCaseSensitive");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestOrderByCaseSensitive");
@Override
public void setUp() throws Exception
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestPermission.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestPermission.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestPermission.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.access.PermissionType;
import org.exoplatform.services.jcr.core.CredentialsImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
-import org.exoplatform.services.jcr.impl.core.query.lucene.TestRemapping;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -45,7 +44,7 @@
public class TestPermission extends JcrImplBaseTest
{
- public static final Log logger = ExoLogger.getLogger(TestRemapping.class);
+ public static final Log logger = ExoLogger.getLogger("exo.jcr.component.core.TestRemapping");
public final String TEST_NAME = "test_name";
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestQueryUsecases.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -49,7 +49,7 @@
public class TestQueryUsecases extends BaseQueryTest
{
- private final Log log = ExoLogger.getLogger(TestQueryUsecases.class.getName());
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestQueryUsecases");
/**
* Get all nodes from repository.
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestRemove.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestRemove.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestRemove.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -37,7 +37,7 @@
/**
* Class logger.
*/
- private static final Log LOG = ExoLogger.getLogger(TestRemove.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TestRemove");
public void testRemoveProperty() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/TestTwoWayRangeIterator.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -41,7 +41,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestScoreNodeIterator");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestScoreNodeIterator");
private Random random = new Random();
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/lucene/TestRemapping.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/lucene/TestRemapping.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/query/lucene/TestRemapping.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -39,7 +39,7 @@
public class TestRemapping extends JcrImplBaseTest
{
- public static final Log logger = ExoLogger.getLogger(TestRemapping.class);
+ public static final Log logger = ExoLogger.getLogger("exo.jcr.component.core.TestRemapping");
public final String ORIGINAL_PREFIX = "test_remap";
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedCacheMultithread.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedCacheMultithread.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestLinkedCacheMultithread.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -51,7 +51,7 @@
public class TestLinkedCacheMultithread extends JcrImplBaseTest
{
- protected static Log log = ExoLogger.getLogger("jcr.TestLinkedCacheMultithread");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.TestLinkedCacheMultithread");
private LinkedWorkspaceStorageCacheImpl cache;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCWDCTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCWDCTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/JDBCWDCTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -63,7 +63,7 @@
public class JDBCWDCTest extends TestCase
{
- protected static Log log = ExoLogger.getLogger("jcr.JDBCWorkspaceDataContainer");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.JDBCWorkspaceDataContainer");
protected WorkspaceEntry config;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/ValueStoragePluginTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -58,7 +58,7 @@
public class ValueStoragePluginTest extends BaseStandaloneTest
{
- protected static Log log = ExoLogger.getLogger("jcr.ValueStoragePluginTest");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.ValueStoragePluginTest");
// protected String sourceName = "jdbc/basic";
// JDBCWorkspaceDataContainer container;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/fs/TestJCRVSReadWrite.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -64,7 +64,7 @@
public class TestJCRVSReadWrite extends JcrImplBaseTest
{
- private static Log log = ExoLogger.getLogger("jcr.TestJCRVSReadWrite");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.TestJCRVSReadWrite");
public static final int FILES_COUNT = 1000;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableFileIOChannelTestBase.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -20,8 +20,6 @@
import org.exoplatform.services.jcr.JcrImplBaseTest;
import org.exoplatform.services.jcr.datamodel.ValueData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.FilePersistedValueData;
import org.exoplatform.services.jcr.impl.dataflow.persistent.StreamPersistedValueData;
import org.exoplatform.services.jcr.impl.storage.value.cas.RecordAlreadyExistsException;
import org.exoplatform.services.jcr.impl.storage.value.cas.RecordNotFoundException;
@@ -46,7 +44,7 @@
public abstract class CASableFileIOChannelTestBase extends JcrImplBaseTest
{//
- private static Log LOG = ExoLogger.getLogger("jcr.CASableFileIOChannelTestBase");
+ private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CASableFileIOChannelTestBase");
protected ValueContentAddressStorage vcas;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/TreeGenerator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/TreeGenerator.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/TreeGenerator.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -31,7 +31,7 @@
*/
public class TreeGenerator
{
- protected static Log log = ExoLogger.getLogger(TreeGenerator.class);
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.TreeGenerator");
private final Node root;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/ValueSsh1Comparator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/ValueSsh1Comparator.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/ValueSsh1Comparator.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -51,7 +51,7 @@
private final MessageDigest md;
- protected Log log = ExoLogger.getLogger(ValueSsh1Comparator.class);
+ protected Log log = ExoLogger.getLogger("exo.jcr.component.core.ValueSsh1Comparator");
public ValueSsh1Comparator(ItemDataConsumer dataManager, InputStream ssh1ChecksumStream) throws IOException,
NoSuchAlgorithmException
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/generator/RandomValueNodeGenerator.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/generator/RandomValueNodeGenerator.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/tools/tree/generator/RandomValueNodeGenerator.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -46,7 +46,7 @@
{
private static final Random random = new Random();
- protected static Log log = ExoLogger.getLogger(RandomValueNodeGenerator.class);
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.RandomValueNodeGenerator");
private final int maxBinarySize;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/TestStringConverter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/TestStringConverter.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/utils/TestStringConverter.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -35,7 +35,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger(getClass().getName());
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestStringConverter");
public void testNormalize_() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/integration/JCRAPITest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/integration/JCRAPITest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/integration/JCRAPITest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -35,7 +35,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.JCRAPInew");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.JCRAPITest");
public static Test suite() throws InterruptedException
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -42,7 +42,7 @@
/**
* Logger instance for this class
*/
- private final Log log = ExoLogger.getLogger(TestIndexUpdateMonitor.class);
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestIndexUpdateMonitor");
private IndexUpdateMonitor indexUpdateMonitor;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQuery.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQuery.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -43,7 +43,7 @@
public class TestLoadIndexerQuery extends JcrAPIBaseTest
{
- private Log log = ExoLogger.getLogger(TestLoadIndexerQuery.class);
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.TestLoadIndexerQuery");
private boolean stop = false;
@@ -88,7 +88,7 @@
{
while (!stop)
{
- Session sessionLocal = null;
+ Session sessionLocal = null;
try
{
// login
@@ -122,7 +122,8 @@
+ "/%' and fn:name() = '" + word + "'", Query.SQL);
QueryResult res = q.execute();
long sqlsize = res.getNodes().getSize();
- log.info("Exp: " + count + "\t found:" + sqlsize + " time: " + (System.currentTimeMillis() - time));
+ log
+ .info("Exp: " + count + "\t found:" + sqlsize + " time: " + (System.currentTimeMillis() - time));
}
}
}
@@ -135,9 +136,9 @@
if (sessionLocal != null)
{
sessionLocal.logout();
- sessionLocal = null;
+ sessionLocal = null;
}
- }
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQueryWithModes.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQueryWithModes.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadIndexerQueryWithModes.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -45,7 +45,7 @@
public class TestLoadIndexerQueryWithModes extends JcrAPIBaseTest
{
- private Log log = ExoLogger.getLogger(TestLoadIndexerQueryWithModes.class);
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.TestLoadIndexerQueryWithModes");
private boolean stop = false;
@@ -103,7 +103,7 @@
while (!stop)
{
- Session sessionLocal = null;
+ Session sessionLocal = null;
try
{
// login
@@ -151,9 +151,9 @@
if (sessionLocal != null)
{
sessionLocal.logout();
- sessionLocal = null;
+ sessionLocal = null;
}
- }
+ }
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadPredictableIndexerQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadPredictableIndexerQuery.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/test/TestLoadPredictableIndexerQuery.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -45,7 +45,7 @@
*/
public class TestLoadPredictableIndexerQuery extends JcrAPIBaseTest
{
- protected final Log log = ExoLogger.getLogger(TestLoadPredictableIndexerQuery.class);
+ protected final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestLoadPredictableIndexerQuery");
private boolean stop = false;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestJira282.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestJira282.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestJira282.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -76,7 +76,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestJira282");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestJira282");
public void test283() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestSameUserLogin.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestSameUserLogin.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/TestSameUserLogin.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -41,7 +41,7 @@
public class TestSameUserLogin extends BaseUsecasesTest
{
- private final Log TLOG = ExoLogger.getLogger("jcr.LoginThread");
+ private final Log TLOG = ExoLogger.getLogger("exo.jcr.component.core.TestSameUserLogin");
class LoginThread extends Thread
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/thread/UserThread.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/thread/UserThread.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/blob/thread/UserThread.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -45,7 +45,7 @@
super();
int inx = getName().indexOf("-");
setName(getClass().getSimpleName() + "-" + getName().substring(inx >= 0 ? inx + 1 : 0));
- threadLog = ExoLogger.getLogger("jcr." + getName());
+ threadLog = ExoLogger.getLogger("exo.jcr.component.core." + getName());
this.threadSession = threadSession;
process = true;
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestLimitAndOffset.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestLimitAndOffset.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/perf/TestLimitAndOffset.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -43,7 +43,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.TestLimitAndOffset");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.TestLimitAndOffset");
private QueryImpl query;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/load/storage/fs/TestFSReadWrite.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -44,7 +44,7 @@
public class TestFSReadWrite extends TestCase
{
- private static Logger log = Logger.getLogger("org.exoplatform.services.jcr.impl.storage.fs");
+ private static Logger log = Logger.getLogger("exo.jcr.component.core.TestFSReadWrite");
public static final int FILES_COUNT = 50000;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/common/AddNodeAmongSessionsTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/common/AddNodeAmongSessionsTest.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/usecases/common/AddNodeAmongSessionsTest.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -33,7 +33,7 @@
public class AddNodeAmongSessionsTest extends BaseUsecasesTest
{
- protected static Log log = ExoLogger.getLogger("jcr.test.AddNodeAmongSessionsTest");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.AddNodeAmongSessionsTest");
protected void tearDown() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java 2010-03-26 06:59:27 UTC (rev 2146)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/util/ConfigurationHelper.java 2010-03-26 07:52:01 UTC (rev 2147)
@@ -56,7 +56,7 @@
*/
public class ConfigurationHelper
{
- private static Log log = ExoLogger.getLogger("jcr.ConfigurationHelper");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ConfigurationHelper");
private static ConfigurationHelper instence;
14 years, 2 months
exo-jcr SVN: r2146 - jcr/trunk/exo.jcr.component.ext.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-26 02:59:27 -0400 (Fri, 26 Mar 2010)
New Revision: 2146
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
Log:
EXOJCR-549: exclude HttpBackupAgentTest
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2010-03-26 06:56:52 UTC (rev 2145)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2010-03-26 06:59:27 UTC (rev 2146)
@@ -174,14 +174,13 @@
<include>**/replication/*.java</include>
<include>**/replication/external/*.java</include>
<include>**/replication/async/**/*.java</include>
- <include>**/**/HTTPBackupAgentTest.java</include>
</includes>
<excludes>
<exclude>**/BaseStandaloneTest.java</exclude>
<exclude>**/replication/*.java</exclude>
<exclude>**/replication/external/*.java</exclude>
<exclude>**/replication/external/BaseTestCaseChecker.java</exclude>
- <!--exclude>**/backup/*.java</exclude-->
+ <exclude>**/backup/*.java</exclude>
<exclude>**/access/*.java</exclude>
<exclude>**/LocalStorageMultithreadTest.java</exclude>
</excludes>
14 years, 2 months
exo-jcr SVN: r2145 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/observation and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-26 02:56:52 -0400 (Fri, 26 Mar 2010)
New Revision: 2145
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestObservationManager.java
Log:
EXOJCR-591: Observation is not txAware() now
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2010-03-25 17:02:27 UTC (rev 2144)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/observation/ActionLauncher.java 2010-03-26 06:56:52 UTC (rev 2145)
@@ -270,6 +270,6 @@
*/
public boolean isTXAware()
{
- return true;
+ return false;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestObservationManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestObservationManager.java 2010-03-25 17:02:27 UTC (rev 2144)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/observation/TestObservationManager.java 2010-03-26 06:56:52 UTC (rev 2145)
@@ -19,6 +19,8 @@
package org.exoplatform.services.jcr.api.observation;
import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.core.CredentialsImpl;
+import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
import org.exoplatform.services.log.Log;
import java.util.Calendar;
@@ -277,6 +279,20 @@
}
+ public void testRemoveSourceNodeEvents() throws RepositoryException
+ {
+ ObservationManager observationManager = this.workspace.getObservationManager();
+ testRoot.addNode("testRemoveSourceNode");
+ EventListener listener = new RemoveDummyListener(this.log, this.repository, this.credentials);
+ observationManager.addEventListener(listener, Event.NODE_ADDED, "/", true, null, null, false);
+ root.save();
+ Session session2 = repository.login(credentials, "ws2");
+ Session session = repository.login(credentials, "ws");
+ assertFalse(session.itemExists("/testRoot/testRemoveSourceNode"));
+ assertTrue(session2.itemExists("/testRemoveSourceNode"));
+ observationManager.removeEventListener(listener);
+ }
+
private void checkEventNumAndCleanCounter(int cnt)
{
assertEquals(cnt, counter);
@@ -332,4 +348,48 @@
}
}
+ private static class RemoveDummyListener implements EventListener
+ {
+ protected Log log;
+
+ protected RepositoryImpl repository;
+
+ protected CredentialsImpl credentials;
+
+ public RemoveDummyListener(Log log, RepositoryImpl repository, CredentialsImpl credentials)
+ {
+ this.log = log;
+ this.repository = repository;
+ this.credentials = credentials;
+ }
+
+ public void onEvent(EventIterator events)
+ {
+ while (events.hasNext())
+ {
+ Event event = events.nextEvent();
+ counter++;
+ try
+ {
+ String path = event.getPath();
+ Session session2 = repository.login(credentials, "ws2");
+ session2.getWorkspace().clone("ws", path, "/testRemoveSourceNode", true);
+ Session session = repository.login(credentials, "ws");
+ session.getItem(path).remove();
+ session.save();
+ }
+ catch (RepositoryException re)
+ {
+ System.out.println(re.getMessage());
+ if (log.isErrorEnabled())
+ {
+ log.error(re.getMessage());
+ }
+ }
+ if (log.isDebugEnabled())
+ log.debug("EVENT fired by RemoveDummyListener " + event + " " + event.getType());
+ }
+ }
+ }
+
}
14 years, 2 months
exo-jcr SVN: r2144 - in jcr/trunk/exo.jcr.component.ext/src: main/java/org/exoplatform/services/jcr/ext/backup/server and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-25 13:02:27 -0400 (Thu, 25 Mar 2010)
New Revision: 2144
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java
Log:
EXOJCR-549: fix bugs
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-03-25 16:33:34 UTC (rev 2143)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-03-25 17:02:27 UTC (rev 2144)
@@ -22,6 +22,7 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
@@ -67,7 +68,7 @@
writer.writeStartDocument();
writer.writeStartElement("repository-backup-cain-log");
writer.flush();
-
+
writer.writeStartElement("start-time");
writer.writeCharacters(JCRDateFormat.format(startedTime));
writer.writeEndElement();
@@ -84,14 +85,14 @@
public void writeBackupsPath(List<String> wsLogFilePathList) throws XMLStreamException
{
writer.writeStartElement("workspaces-backup-info");
-
+
for (String path : wsLogFilePathList)
{
writer.writeStartElement("url");
writer.writeCharacters(path);
writer.writeEndElement();
}
-
+
writer.writeEndElement();
writer.flush();
@@ -104,7 +105,7 @@
writer.writeStartElement("finish-time");
writer.writeCharacters(JCRDateFormat.format(finishedTime));
writer.writeEndElement();
-
+
writer.writeEndElement();
writer.writeEndDocument();
writer.flush();
@@ -115,21 +116,27 @@
}
}
}
-
+
private class LogReader
{
- protected Log logger = ExoLogger.getLogger("ext.LogWriter");
+ protected Log logger = ExoLogger.getLogger("ext.LogReader");
private File logFile;
private XMLStreamReader reader;
+ private BackupConfig config;
+
+ private List<JobEntryInfo> jobEntriesNormalize;
+
public LogReader(File logFile) throws FileNotFoundException, XMLStreamException, FactoryConfigurationError
{
this.logFile = logFile;
+ jobEntries = new ArrayList<JobEntryInfo>();
+
reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(logFile));
}
-
+
public void readLogFile() throws XMLStreamException, MalformedURLException, ValueFormatException
{
boolean endDocument = false;
@@ -146,12 +153,15 @@
if (name.equals("system-workspace"))
workspaceSystem = readContent();
+ if (name.equals("backup-config"))
+ config = readBackupConfig();
+
if (name.equals("workspaces-backup-info"))
workspaceBackupsInfo = readWorkspaceBackupInfo();
-
+
if (name.equals("start-time"))
startedTime = JCRDateFormat.parse(readContent());
-
+
if (name.equals("finish-time"))
finishedTime = JCRDateFormat.parse(readContent());
@@ -163,7 +173,27 @@
}
}
}
-
+
+ public BackupConfig getBackupConfig()
+ {
+ return config;
+ }
+
+ public Calendar getBeginTime()
+ {
+ return jobEntries.get(0).getDate();
+ }
+
+ public Calendar getEndTime()
+ {
+ return jobEntries.get(jobEntries.size() - 1).getDate();
+ }
+
+ public List<JobEntryInfo> getJobEntryInfoNormalizeList()
+ {
+ return jobEntriesNormalize;
+ }
+
private List<String> readWorkspaceBackupInfo() throws XMLStreamException
{
List<String> wsBackupInfo = new ArrayList<String>();
@@ -207,6 +237,139 @@
return content;
}
+
+ private JobEntryInfo readJobEntryInfo() throws XMLStreamException, MalformedURLException, ValueFormatException
+ {
+ JobEntryInfo info = new JobEntryInfo();
+
+ boolean endJobEntryInfo = false;
+
+ while (!endJobEntryInfo)
+ {
+ int eventCode = reader.next();
+ switch (eventCode)
+ {
+
+ case StartElement.START_ELEMENT :
+ String name = reader.getLocalName();
+
+ if (name.equals("type"))
+ info.setType(getType(readContent()));
+
+ if (name.equals("state"))
+ info.setState(getState(readContent()));
+
+ if (name.equals("url"))
+ info.setURL(new URL(readContent()));
+
+ if (name.equals("date"))
+ info.setDate(JCRDateFormat.parse(readContent()));
+
+ break;
+
+ case StartElement.END_ELEMENT :
+ String tagName = reader.getLocalName();
+
+ if (tagName.equals("job-entry-info"))
+ endJobEntryInfo = true;
+ break;
+ }
+ }
+
+ return info;
+ }
+
+ private int getState(String content)
+ {
+ int state = -1;
+
+ if (content.equals("FINISHED"))
+ state = BackupJob.FINISHED;
+
+ if (content.equals("STARTING"))
+ state = BackupJob.STARTING;
+
+ if (content.equals("WAITING"))
+ state = BackupJob.WAITING;
+
+ if (content.equals("WORKING"))
+ state = BackupJob.WORKING;
+
+ return state;
+ }
+
+ private int getType(String content)
+ {
+ int type = -1;
+
+ if (content.equals("FULL"))
+ type = BackupJob.FULL;
+
+ if (content.equals("INCREMENTAL"))
+ type = BackupJob.INCREMENTAL;
+
+ return type;
+ }
+
+ public BackupConfig readBackupConfig() throws XMLStreamException
+ {
+ BackupConfig conf = new BackupConfig();
+
+ boolean endBackupConfig = false;
+
+ while (!endBackupConfig)
+ {
+ int eventCode = reader.next();
+ switch (eventCode)
+ {
+
+ case StartElement.START_ELEMENT :
+ String name = reader.getLocalName();
+
+ if (name.equals("backup-dir"))
+ conf.setBackupDir(new File(readContent()));
+
+ if (name.equals("repository"))
+ conf.setRepository(readContent());
+
+ if (name.equals("incremental-job-period"))
+ conf.setIncrementalJobPeriod(Long.valueOf(readContent()).longValue());
+
+ if (name.equals("incremental-job-number"))
+ conf.setIncrementalJobNumber(Integer.valueOf(readContent()).intValue());
+
+ break;
+
+ case StartElement.END_ELEMENT :
+ String tagName = reader.getLocalName();
+
+ if (tagName.equals("repository-backup-cain-log"))
+ endBackupConfig = true;
+ break;
+ }
+ }
+
+ return conf;
+ }
+
+ public void jobEntrysNormalize()
+ {
+ jobEntriesNormalize = new ArrayList<JobEntryInfo>();
+
+ for (int i = 0; i < jobEntries.size(); i++)
+ {
+ JobEntryInfo entryInfo = jobEntries.get(i);
+
+ boolean alreadyExist = false;
+
+ for (int j = 0; j < jobEntriesNormalize.size(); j++)
+ if (jobEntriesNormalize.get(j).getURL().toString().equals(entryInfo.getURL().toString()))
+ alreadyExist = true;
+
+ if (!alreadyExist)
+ jobEntriesNormalize.add(entryInfo);
+ }
+ }
}
protected static Log logger = ExoLogger.getLogger("ext.BackupChainLog");
@@ -223,6 +386,8 @@
private RepositoryBackupConfig config;
+ private List<JobEntryInfo> jobEntries;
+
private String backupId;
private Calendar startedTime;
@@ -230,9 +395,9 @@
private Calendar finishedTime;
private boolean finalized;
-
+
private List<String> workspaceBackupsInfo;
-
+
private String workspaceSystem;
/**
@@ -244,8 +409,8 @@
* @param startTime
* @throws BackupOperationException
*/
- public RepositoryBackupChainLog(File logDirectory, RepositoryBackupConfig config, String systemWorkspace, List<String> wsLogFilePathList,
- String backupId, Calendar startTime) throws BackupOperationException
+ public RepositoryBackupChainLog(File logDirectory, RepositoryBackupConfig config, String systemWorkspace,
+ List<String> wsLogFilePathList, String backupId, Calendar startTime) throws BackupOperationException
{
try
{
@@ -255,11 +420,12 @@
this.backupId = backupId;
this.config = config;
this.startedTime = Calendar.getInstance();
+ this.jobEntries = new ArrayList<JobEntryInfo>();
logWriter = new LogWriter(log);
logWriter.writeSystemWorkspaceName(systemWorkspace);
logWriter.writeBackupsPath(wsLogFilePathList);
-
+
this.workspaceBackupsInfo = wsLogFilePathList;
this.workspaceSystem = systemWorkspace;
}
@@ -276,7 +442,7 @@
throw new BackupOperationException("Can not create backup log ...", e);
}
}
-
+
/**
* @param log
* @throws BackupOperationException
@@ -290,26 +456,46 @@
{
logReader = new LogReader(log);
logReader.readLogFile();
+ logReader.jobEntrysNormalize();
+
+ this.config = logReader.getBackupConfig();
+ this.startedTime = logReader.getBeginTime();
+ this.finishedTime = logReader.getEndTime();
+ this.jobEntries = logReader.getJobEntryInfoNormalizeList();
+
+ for (JobEntryInfo info : jobEntries)
+ {
+ if (info.getType() == BackupJob.INCREMENTAL)
+ {
+ config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
+ break;
+ }
+ }
}
catch (FileNotFoundException e)
{
- throw new BackupOperationException("Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
+ throw new BackupOperationException(
+ "Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
}
catch (XMLStreamException e)
{
- throw new BackupOperationException("Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
+ throw new BackupOperationException(
+ "Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
}
catch (FactoryConfigurationError e)
{
- throw new BackupOperationException("Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
+ throw new BackupOperationException(
+ "Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
}
catch (MalformedURLException e)
{
- throw new BackupOperationException("Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
+ throw new BackupOperationException(
+ "Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
}
catch (ValueFormatException e)
{
- throw new BackupOperationException("Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
+ throw new BackupOperationException(
+ "Can not read RepositoryBackupChainLog from file :" + log.getAbsolutePath(), e);
}
}
@@ -361,43 +547,43 @@
{
return finalized;
}
-
+
/**
* Finalize log.
*
*/
public synchronized void endLog()
{
- if (!finalized)
+ if (!finalized)
{
finishedTime = Calendar.getInstance();
finalized = true;
logWriter.writeEndLog();
}
}
-
+
/**
* Getting the system workspace name.
*
* @return String
* return the system workspace name.
*/
- public String getSystemWorkspace()
+ public String getSystemWorkspace()
{
return workspaceSystem;
}
-
+
/**
* Getting the workspace backups info.
*
* @return Collection
* return the list with path to backups.
*/
- public List<String> getWorkspaceBackupsInfo()
+ public List<String> getWorkspaceBackupsInfo()
{
return workspaceBackupsInfo;
}
-
+
/**
* Getting the backup id.
*
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-03-25 16:33:34 UTC (rev 2143)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-03-25 17:02:27 UTC (rev 2144)
@@ -126,7 +126,7 @@
/**
* Stop repository backup operations.
*/
- public static final String STOP_BACKUP_REPOSITORY = "stop-repository";
+ public static final String STOP_BACKUP_REPOSITORY = "/stop-repository-backup";
/**
* The current and completed backups info operation.
@@ -152,12 +152,11 @@
* The current or completed backup info operations.
*/
public static final String CURRENT_OR_COMPLETED_BACKUP_INFO = "/info/backup";
-
+
/**
* The current or completed repository backup info operations.
*/
public static final String CURRENT_OR_COMPLETED_BACKUP_REPOSITORY_INFO = "/info/backup-repository-id";
-
/**
* The current restore info operations for specific workspace.
@@ -794,8 +793,8 @@
@GET
@Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("administrators")
- @Path("/stop-repository/{id}")
- public Response stopRepository(@PathParam("id") String backupId)
+ @Path("/stop-repository-backup/{id}")
+ public Response stopRepositoryBackup(@PathParam("id") String backupId)
{
String failMessage;
Response.Status status;
@@ -1269,8 +1268,8 @@
log.error("Can not get information about current or completed repository backups", e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
- "Can not get information about current or completed repository backups" + e.getMessage()).type(MediaType.TEXT_PLAIN)
- .cacheControl(noCache).build();
+ "Can not get information about current or completed repository backups" + e.getMessage()).type(
+ MediaType.TEXT_PLAIN).cacheControl(noCache).build();
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java 2010-03-25 16:33:34 UTC (rev 2143)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java 2010-03-25 17:02:27 UTC (rev 2144)
@@ -223,45 +223,45 @@
Thread.sleep(10000);
- // // Get repository backup id for backup on workspace /db6/ws2
- // String id = null;
- //
- // {
- // MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
- // ContainerRequestUserRole creq =
- // new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
- // + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""), null,
- // new InputHeadersMap(headers));
- //
- // ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
- // ContainerResponse cres = new ContainerResponse(responseWriter);
- // handler.handleRequest(creq, cres);
- //
- // assertEquals(200, cres.getStatus());
- //
- // ShortInfoList infoList = (ShortInfoList)getObject(ShortInfoList.class, responseWriter.getBody());
- // List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());
- //
- // assertEquals(1, list.size());
- //
- // ShortInfo info = list.get(0);
- //
- // assertEquals(info.getRepositoryName(), "db6");
- //
- // id = info.getBackupId();
- // }
- //
- // MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
- // ContainerRequestUserRole creq =
- // new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
- // + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP_REPOSITORY + "/" + id), new URI(""), null,
- // new InputHeadersMap(headers));
- //
- // ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
- // ContainerResponse cres = new ContainerResponse(responseWriter);
- // handler.handleRequest(creq, cres);
- //
- // assertEquals(200, cres.getStatus());
+ // Get repository backup id for backup on workspace /db6/ws2
+ String id = null;
+
+ {
+ headers = new MultivaluedMapImpl();
+ creq =
+ new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
+ + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""), null,
+ new InputHeadersMap(headers));
+
+ responseWriter = new ByteArrayContainerResponseWriter();
+ cres = new ContainerResponse(responseWriter);
+ handler.handleRequest(creq, cres);
+
+ assertEquals(200, cres.getStatus());
+
+ ShortInfoList infoList = (ShortInfoList)getObject(ShortInfoList.class, responseWriter.getBody());
+ List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());
+
+ assertEquals(1, list.size());
+
+ ShortInfo info = list.get(0);
+
+ assertEquals(info.getRepositoryName(), "db6");
+
+ id = info.getBackupId();
+ }
+
+ headers = new MultivaluedMapImpl();
+ creq =
+ new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
+ + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP_REPOSITORY + "/" + id), new URI(""), null,
+ new InputHeadersMap(headers));
+
+ responseWriter = new ByteArrayContainerResponseWriter();
+ cres = new ContainerResponse(responseWriter);
+ handler.handleRequest(creq, cres);
+
+ assertEquals(200, cres.getStatus());
}
public void testInfoBackup() throws Exception
14 years, 2 months
exo-jcr SVN: r2143 - in ws/branches/2.2.x: exo.ws.rest.core/src/main/java/org/exoplatform/services/rest and 3 other directories.
by do-not-reply@jboss.org
Author: yakimenko
Date: 2010-03-25 12:33:34 -0400 (Thu, 25 Mar 2010)
New Revision: 2143
Added:
ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/ExceptionsTest.java
Modified:
ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/ExtHttpHeaders.java
ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/service/RestServicesList.java
ws/branches/2.2.x/pom.xml
Log:
EVERREST-1 : merge last changes from trunk
Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/ExtHttpHeaders.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/ExtHttpHeaders.java 2010-03-25 16:33:32 UTC (rev 2142)
+++ ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/ExtHttpHeaders.java 2010-03-25 16:33:34 UTC (rev 2143)
@@ -175,5 +175,11 @@
* Field Definitions sec. 14.41 Transfer-Encoding</a>.
*/
public static final String TRANSFER_ENCODING = "Transfer-Encoding";
-
+
+ /**
+ * This header indicates that body is provided via JAXR framework.
+ * Value of header MAY contain additional information about the nature
+ * of body's content, for example: 'Error-Message'.
+ */
+ public static final String JAXRS_BODY_PROVIDED = "JAXRS-Body-Provided";
}
Modified: ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2010-03-25 16:33:32 UTC (rev 2142)
+++ ws/branches/2.2.x/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2010-03-25 16:33:34 UTC (rev 2143)
@@ -27,6 +27,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.ext.ExceptionMapper;
import org.exoplatform.services.log.ExoLogger;
@@ -41,6 +42,7 @@
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.ResponseFilter;
+import org.exoplatform.services.rest.ExtHttpHeaders;
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
@@ -77,7 +79,6 @@
e.printStackTrace(pw);
pw.flush();
}
-
}
/**
@@ -90,12 +91,12 @@
* and may be accessible via method {@link ApplicationContextImpl#getProperties()}.
*/
private static final Map<String, String> properties = new HashMap<String, String>();
-
+
public static final String getProperty(String name)
{
return properties.get(name);
}
-
+
public static final void setProperty(String name, String value)
{
if (value == null)
@@ -107,14 +108,14 @@
* See {@link RequestDispatcher}.
*/
private final RequestDispatcher dispatcher;
-
+
/**
* ResourceBinder.
*/
private final ResourceBinder binder;
-
+
private final DependencySupplier depInjector;
-
+
public RequestHandlerImpl(ResourceBinder binder, DependencySupplier depInjector)
{
this.binder = binder;
@@ -154,7 +155,14 @@
{
dispatcher.dispatch(request, response);
-
+ if (response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED) == null)
+ {
+ String jaxrsHeader = getJaxrsHeader(response.getStatus());
+ if (jaxrsHeader != null)
+ {
+ response.getHttpHeaders().putSingle(ExtHttpHeaders.JAXRS_BODY_PROVIDED, jaxrsHeader);
+ }
+ }
}
catch (Exception e)
{
@@ -164,65 +172,50 @@
Response errorResponse = ((WebApplicationException)e).getResponse();
ExceptionMapper excmap = ProviderBinder.getInstance().getExceptionMapper(WebApplicationException.class);
+ int errorStatus = errorResponse.getStatus();
// should be some of 4xx status
- if (errorResponse.getStatus() < 500)
+ if (errorStatus < 500)
{
+ // Warn about error in debug mode only.
if (LOG.isDebugEnabled() && e.getCause() != null)
{
- LOG.warn("WedApplication exception occurs.", e.getCause());
+ LOG.warn("WebApplication exception occurs.", e.getCause());
}
- if (errorResponse.getEntity() == null)
+ }
+ else
+ {
+ if (e.getCause() != null)
{
- if (excmap != null)
+ LOG.warn("WebApplication exception occurs.", e.getCause());
+ }
+ }
+ // -----
+ if (errorResponse.getEntity() == null)
+ {
+ if (excmap != null)
+ {
+ errorResponse = excmap.toResponse(e);
+ }
+ else
+ {
+ if (e.getMessage() != null)
{
- errorResponse = excmap.toResponse(e);
+ errorResponse = createErrorResponse(errorStatus, e.getMessage());
}
}
-
- if (e.getMessage() != null)
- errorResponse =
- Response.status(errorResponse.getStatus()).entity(new String(e.getMessage())).type(
- MediaType.TEXT_PLAIN).header("JAXRS-Message-Provided", "true").build();
-
- response.setResponse(errorResponse);
}
else
{
-
- if (errorResponse.getEntity() == null)
+ if (errorResponse.getMetadata().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED) == null)
{
- if (excmap != null)
+ String jaxrsHeader = getJaxrsHeader(errorStatus);
+ if (jaxrsHeader != null)
{
- if (LOG.isDebugEnabled() && e.getCause() != null)
- {
- // Hide error message if exception mapper exists.
- LOG.warn("WedApplication exception occurs.", e.getCause());
- }
-
- errorResponse = excmap.toResponse(e);
+ errorResponse.getMetadata().putSingle(ExtHttpHeaders.JAXRS_BODY_PROVIDED, jaxrsHeader);
}
- else
- {
- if (e.getCause() != null)
- {
- LOG.warn("WedApplication exception occurs.", e.getCause());
- }
-
- // print stack trace & adding ex message into body
- if (LOG.isDebugEnabled())
- {
- e.printStackTrace();
- }
- if (e.getMessage() != null)
- errorResponse =
- Response.status(errorResponse.getStatus()).entity(new String(e.getMessage())).type(
- MediaType.TEXT_PLAIN).header("JAXRS-Message-Provided", "true").build();
- else
- errorResponse = Response.status(errorResponse.getStatus()).header("JAXRS-Message-Provided", "false").build();
- }
}
- response.setResponse(errorResponse);
}
+ response.setResponse(errorResponse);
}
else if (e instanceof InternalException)
{
@@ -255,7 +248,6 @@
throw new UnhandledException(e);
}
}
-
for (ObjectFactory<FilterDescriptor> factory : ProviderBinder.getInstance().getResponseFilters(
context.getPath()))
{
@@ -273,4 +265,32 @@
}
}
+ /**
+ * Create error response with specified status and body message.
+ *
+ * @param status response status
+ * @param message response message
+ * @return response
+ */
+ private Response createErrorResponse(int status, String message)
+ {
+
+ ResponseBuilder responseBuilder = Response.status(status);
+ responseBuilder.entity(message).type(MediaType.TEXT_PLAIN);
+ String jaxrsHeader = getJaxrsHeader(status);
+ if (jaxrsHeader != null)
+ responseBuilder.header(ExtHttpHeaders.JAXRS_BODY_PROVIDED, jaxrsHeader);
+
+ return responseBuilder.build();
+ }
+
+ private String getJaxrsHeader(int status)
+ {
+ if (status >= 400)
+ {
+ return "Error-Message";
+ }
+ // Add required behavior here.
+ return null;
+ }
}
Added: ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/ExceptionsTest.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/ExceptionsTest.java (rev 0)
+++ ws/branches/2.2.x/exo.ws.rest.core/src/test/java/org/exoplatform/services/rest/impl/ExceptionsTest.java 2010-03-25 16:33:34 UTC (rev 2143)
@@ -0,0 +1,775 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.rest.impl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.UnhandledException;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Date: 24 Dec 2009
+ *
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id: WebApplicationExceptionTest.java
+ */
+public class ExceptionsTest extends AbstractResourceTest
+{
+
+ @Path("a")
+ public static class Resource1
+ {
+
+ @GET
+ @Path("0")
+ public void m0() throws WebApplicationException
+ {
+ Exception e = new Exception(errorMessage);
+ throw new WebApplicationException(e, 500);
+ }
+
+ @GET
+ @Path("1")
+ public void m1() throws WebApplicationException
+ {
+ Response response = Response.status(500).entity(errorMessage).type("text/plain").build();
+ throw new WebApplicationException(new Exception(), response);
+ }
+
+ @GET
+ @Path("2")
+ public Response m2() throws WebApplicationException
+ {
+ throw new WebApplicationException(500);
+ }
+
+ @GET
+ @Path("3")
+ public void m3() throws Exception
+ {
+ throw new RuntimeException("Runtime exception");
+ }
+
+ @GET
+ @Path("4")
+ public Response m4() throws Exception
+ {
+ return Response.status(500).entity(errorMessage).type("text/plain").build();
+ }
+
+ }
+
+ private static String errorMessage = "test-error-message";
+
+ private Resource1 resource;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ resource = new Resource1();
+ registry(resource);
+ }
+
+ public void tearDown() throws Exception
+ {
+ unregistry(resource);
+ super.tearDown();
+ }
+
+ public void testErrorResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/4", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testUncheckedException() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ try
+ {
+ service("GET", "/a/3", "", null, null, writer);
+ fail("UnhandledException should be throw by RequstHandlerImpl");
+ }
+ catch (UnhandledException e)
+ {
+ // OK
+ }
+ }
+
+ public void testWebApplicationExceptionWithCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/0", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(new Exception(errorMessage).toString(), entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithoutCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/2", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ assertNull(response.getEntity());
+ assertNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/1", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+}
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.rest.impl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.UnhandledException;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Date: 24 Dec 2009
+ *
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id: WebApplicationExceptionTest.java
+ */
+public class ExceptionsTest extends AbstractResourceTest
+{
+
+ @Path("a")
+ public static class Resource1
+ {
+
+ @GET
+ @Path("0")
+ public void m0() throws WebApplicationException
+ {
+ Exception e = new Exception(errorMessage);
+ throw new WebApplicationException(e, 500);
+ }
+
+ @GET
+ @Path("1")
+ public void m1() throws WebApplicationException
+ {
+ Response response = Response.status(500).entity(errorMessage).type("text/plain").build();
+ throw new WebApplicationException(new Exception(), response);
+ }
+
+ @GET
+ @Path("2")
+ public Response m2() throws WebApplicationException
+ {
+ throw new WebApplicationException(500);
+ }
+
+ @GET
+ @Path("3")
+ public void m3() throws Exception
+ {
+ throw new RuntimeException("Runtime exception");
+ }
+
+ @GET
+ @Path("4")
+ public Response m4() throws Exception
+ {
+ return Response.status(500).entity(errorMessage).type("text/plain").build();
+ }
+
+ }
+
+ private static String errorMessage = "test-error-message";
+
+ private Resource1 resource;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ resource = new Resource1();
+ registry(resource);
+ }
+
+ public void tearDown() throws Exception
+ {
+ unregistry(resource);
+ super.tearDown();
+ }
+
+ public void testErrorResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/4", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testUncheckedException() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ try
+ {
+ service("GET", "/a/3", "", null, null, writer);
+ fail("UnhandledException should be throw by RequstHandlerImpl");
+ }
+ catch (UnhandledException e)
+ {
+ // OK
+ }
+ }
+
+ public void testWebApplicationExceptionWithCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/0", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(new Exception(errorMessage).toString(), entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithoutCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/2", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ assertNull(response.getEntity());
+ assertNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/1", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+}
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.rest.impl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.UnhandledException;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Date: 24 Dec 2009
+ *
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id: WebApplicationExceptionTest.java
+ */
+public class ExceptionsTest extends AbstractResourceTest
+{
+
+ @Path("a")
+ public static class Resource1
+ {
+
+ @GET
+ @Path("0")
+ public void m0() throws WebApplicationException
+ {
+ Exception e = new Exception(errorMessage);
+ throw new WebApplicationException(e, 500);
+ }
+
+ @GET
+ @Path("1")
+ public void m1() throws WebApplicationException
+ {
+ Response response = Response.status(500).entity(errorMessage).type("text/plain").build();
+ throw new WebApplicationException(new Exception(), response);
+ }
+
+ @GET
+ @Path("2")
+ public Response m2() throws WebApplicationException
+ {
+ throw new WebApplicationException(500);
+ }
+
+ @GET
+ @Path("3")
+ public void m3() throws Exception
+ {
+ throw new RuntimeException("Runtime exception");
+ }
+
+ @GET
+ @Path("4")
+ public Response m4() throws Exception
+ {
+ return Response.status(500).entity(errorMessage).type("text/plain").build();
+ }
+
+ }
+
+ private static String errorMessage = "test-error-message";
+
+ private Resource1 resource;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ resource = new Resource1();
+ registry(resource);
+ }
+
+ public void tearDown() throws Exception
+ {
+ unregistry(resource);
+ super.tearDown();
+ }
+
+ public void testErrorResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/4", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testUncheckedException() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ try
+ {
+ service("GET", "/a/3", "", null, null, writer);
+ fail("UnhandledException should be throw by RequstHandlerImpl");
+ }
+ catch (UnhandledException e)
+ {
+ // OK
+ }
+ }
+
+ public void testWebApplicationExceptionWithCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/0", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(new Exception(errorMessage).toString(), entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithoutCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/2", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ assertNull(response.getEntity());
+ assertNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/1", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+}
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.rest.impl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.UnhandledException;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Date: 24 Dec 2009
+ *
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id: WebApplicationExceptionTest.java
+ */
+public class ExceptionsTest extends AbstractResourceTest
+{
+
+ @Path("a")
+ public static class Resource1
+ {
+
+ @GET
+ @Path("0")
+ public void m0() throws WebApplicationException
+ {
+ Exception e = new Exception(errorMessage);
+ throw new WebApplicationException(e, 500);
+ }
+
+ @GET
+ @Path("1")
+ public void m1() throws WebApplicationException
+ {
+ Response response = Response.status(500).entity(errorMessage).type("text/plain").build();
+ throw new WebApplicationException(new Exception(), response);
+ }
+
+ @GET
+ @Path("2")
+ public Response m2() throws WebApplicationException
+ {
+ throw new WebApplicationException(500);
+ }
+
+ @GET
+ @Path("3")
+ public void m3() throws Exception
+ {
+ throw new RuntimeException("Runtime exception");
+ }
+
+ @GET
+ @Path("4")
+ public Response m4() throws Exception
+ {
+ return Response.status(500).entity(errorMessage).type("text/plain").build();
+ }
+
+ }
+
+ private static String errorMessage = "test-error-message";
+
+ private Resource1 resource;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ resource = new Resource1();
+ registry(resource);
+ }
+
+ public void tearDown() throws Exception
+ {
+ unregistry(resource);
+ super.tearDown();
+ }
+
+ public void testErrorResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/4", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testUncheckedException() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ try
+ {
+ service("GET", "/a/3", "", null, null, writer);
+ fail("UnhandledException should be throw by RequstHandlerImpl");
+ }
+ catch (UnhandledException e)
+ {
+ // OK
+ }
+ }
+
+ public void testWebApplicationExceptionWithCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/0", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(new Exception(errorMessage).toString(), entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithoutCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/2", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ assertNull(response.getEntity());
+ assertNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/1", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+}
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.rest.impl;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
+import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.UnhandledException;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+/**
+ * Created by The eXo Platform SAS. <br/>
+ * Date: 24 Dec 2009
+ *
+ * @author <a href="mailto:max.shaposhnik@exoplatform.com">Max Shaposhnik</a>
+ * @version $Id: WebApplicationExceptionTest.java
+ */
+public class ExceptionsTest extends AbstractResourceTest
+{
+
+ @Path("a")
+ public static class Resource1
+ {
+
+ @GET
+ @Path("0")
+ public void m0() throws WebApplicationException
+ {
+ Exception e = new Exception(errorMessage);
+ throw new WebApplicationException(e, 500);
+ }
+
+ @GET
+ @Path("1")
+ public void m1() throws WebApplicationException
+ {
+ Response response = Response.status(500).entity(errorMessage).type("text/plain").build();
+ throw new WebApplicationException(new Exception(), response);
+ }
+
+ @GET
+ @Path("2")
+ public Response m2() throws WebApplicationException
+ {
+ throw new WebApplicationException(500);
+ }
+
+ @GET
+ @Path("3")
+ public void m3() throws Exception
+ {
+ throw new RuntimeException("Runtime exception");
+ }
+
+ @GET
+ @Path("4")
+ public Response m4() throws Exception
+ {
+ return Response.status(500).entity(errorMessage).type("text/plain").build();
+ }
+
+ }
+
+ private static String errorMessage = "test-error-message";
+
+ private Resource1 resource;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ resource = new Resource1();
+ registry(resource);
+ }
+
+ public void tearDown() throws Exception
+ {
+ unregistry(resource);
+ super.tearDown();
+ }
+
+ public void testErrorResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/4", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testUncheckedException() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ try
+ {
+ service("GET", "/a/3", "", null, null, writer);
+ fail("UnhandledException should be throw by RequstHandlerImpl");
+ }
+ catch (UnhandledException e)
+ {
+ // OK
+ }
+ }
+
+ public void testWebApplicationExceptionWithCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/0", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(new Exception(errorMessage).toString(), entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithoutCause() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/2", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ assertNull(response.getEntity());
+ assertNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+ public void testWebApplicationExceptionWithResponse() throws Exception
+ {
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse response = service("GET", "/a/1", "", null, null, writer);
+ assertEquals(500, response.getStatus());
+ String entity = new String(writer.getBody());
+ assertEquals(errorMessage, entity);
+ assertNotNull(response.getHttpHeaders().getFirst(ExtHttpHeaders.JAXRS_BODY_PROVIDED));
+ }
+
+}
Modified: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/service/RestServicesList.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/service/RestServicesList.java 2010-03-25 16:33:32 UTC (rev 2142)
+++ ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/service/RestServicesList.java 2010-03-25 16:33:34 UTC (rev 2143)
@@ -19,7 +19,7 @@
package org.exoplatform.services.rest.ext.service;
import org.exoplatform.services.rest.ObjectFactory;
-import org.exoplatform.services.rest.impl.ResourceBinder;
+import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
import java.io.ByteArrayOutputStream;
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/branches/2.2.x/pom.xml 2010-03-25 16:33:32 UTC (rev 2142)
+++ ws/branches/2.2.x/pom.xml 2010-03-25 16:33:34 UTC (rev 2143)
@@ -32,7 +32,6 @@
<artifactId>ws-parent</artifactId>
<version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
-
<name>eXo WS</name>
<scm>
@@ -45,8 +44,8 @@
<exo.product.name>exo-ws</exo.product.name>
<exo.product.specification>2.1</exo.product.specification>
- <org.exoplatform.kernel.version>2.2.0-Beta02</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.0-Beta02</org.exoplatform.core.version>
+ <org.exoplatform.kernel.version>2.2.0-GA</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.0-GA</org.exoplatform.core.version>
<exo.test.includes>*Test*</exo.test.includes>
</properties>
14 years, 2 months
exo-jcr SVN: r2142 - in ws/trunk/exo.ws.frameworks.json/src: test/java/org/exoplatform/ws/frameworks/json and 1 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2010-03-25 12:33:32 -0400 (Thu, 25 Mar 2010)
New Revision: 2142
Added:
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithBookEnum.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithSimpleEnum.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BookEnum.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/StringEnum.java
Modified:
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/BeanBuilder.java
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/Book.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonParserTest.java
Log:
EXOJCR-602 : add java enum serialization
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/BeanBuilder.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/BeanBuilder.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/BeanBuilder.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -46,14 +46,22 @@
/**
* Create Java Bean from Json Source.
- *
+ *
* @param clazz the Class of target Object.
* @param jsonValue the Json representation.
* @return Object.
* @throws Exception if any errors occurs.
*/
+ @SuppressWarnings("unchecked")
public Object createObject(Class<?> clazz, JsonValue jsonValue) throws Exception
{
+ if (JsonUtils.getType(clazz) == Types.ENUM)
+ {
+ // Enum is not instantiable via CLass.getInstance().
+ // This is used when enum is member of array or collection.
+ Class c = clazz;
+ return Enum.valueOf(c, jsonValue.getStringValue());
+ }
Object object = clazz.newInstance();
Method[] methods = clazz.getMethods();
@@ -67,8 +75,10 @@
Class<?>[] parameterTypes = method.getParameterTypes();
if (parameterTypes.length != 1)
+ {
throw new JsonException("Each set method must have one parameters, but method " + clazz.getName() + "#"
+ method.getName() + " has " + parameterTypes.length);
+ }
Class<?> methodParameterClazz = parameterTypes[0];
String key = methodName.substring("set".length());
@@ -77,16 +87,22 @@
// Bug : WS-53
if (jsonValue.isNull())
+ {
return null;
+ }
if (!jsonValue.isObject())
+ {
throw new JsonException("Unsupported type of jsonValue for parameter of method " + clazz.getName() + "#"
+ method.getName());
+ }
JsonValue childJsonValue = jsonValue.getElement(key);
if (childJsonValue == null)
+ {
continue;
+ }
// if one of known primitive type or array of primitive type
if (JsonUtils.isKnownType(methodParameterClazz))
@@ -101,6 +117,12 @@
{
switch (type)
{
+ case ENUM : {
+ Class c = methodParameterClazz;
+ Enum<?> en = Enum.valueOf(c, childJsonValue.getStringValue());
+ method.invoke(object, new Object[]{en});
+ }
+ break;
case ARRAY_OBJECT : {
Object array = createArray(methodParameterClazz, childJsonValue);
method.invoke(object, new Object[]{array});
@@ -174,8 +196,10 @@
constructor = methodParameterClazz.getConstructor(new Class[]{Collection.class});
}
if (constructor == null)
+ {
throw new JsonException("Can't find satisfied constructor for : " + methodParameterClazz
+ ", method : " + clazz.getName() + "#" + method.getName());
+ }
ArrayList<Object> sourceCollection = new ArrayList<Object>(childJsonValue.size());
@@ -185,9 +209,13 @@
{
JsonValue v = values.next();
if (!JsonUtils.isKnownType(parameterizedTypeClass))
+ {
sourceCollection.add(createObject(parameterizedTypeClass, v));
+ }
else
+ {
sourceCollection.add(createObjectKnownTypes(parameterizedTypeClass, v));
+ }
}
constructor.newInstance(sourceCollection);
@@ -204,8 +232,10 @@
ParameterizedType parameterizedType = (ParameterizedType)genericParameterTypes[0];
if (!String.class
.isAssignableFrom((Class<?>)parameterizedType.getActualTypeArguments()[0]))
+ {
throw new JsonException("Unsupported parameter in method " + clazz.getName() + "#"
+ method.getName() + ". Key of Map must be String.");
+ }
try
{
parameterizedTypeClass = (Class<?>)parameterizedType.getActualTypeArguments()[1];
@@ -263,8 +293,10 @@
}
if (constructor == null)
+ {
throw new JsonException("Can't find satisfied constructor for : " + methodParameterClazz
+ ", method : " + clazz.getName() + "#" + method.getName());
+ }
HashMap<String, Object> sourceMap = new HashMap<String, Object>(childJsonValue.size());
@@ -275,9 +307,13 @@
String k = keys.next();
JsonValue v = childJsonValue.getElement(k);
if (!JsonUtils.isKnownType(parameterizedTypeClass))
+ {
sourceMap.put(k, createObject(parameterizedTypeClass, v));
+ }
else
+ {
sourceMap.put(k, createObjectKnownTypes(parameterizedTypeClass, v));
+ }
}
method.invoke(object, constructor.newInstance(sourceMap));
@@ -303,8 +339,9 @@
}
/**
- * Create array of Java Object from Json Source include multi-dimension array.
- *
+ * Create array of Java Object from Json Source include multi-dimension
+ * array.
+ *
* @param clazz the Class of target Object.
* @param jsonValue the Json representation.
* @return Object.
@@ -350,7 +387,7 @@
/**
* Create Objects of known types.
- *
+ *
* @param clazz class.
* @param jsonValue JsonValue , @see {@link JsonValue}
* @return Object.
@@ -387,7 +424,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getBooleanValue();
+ }
return params;
}
case ARRAY_BYTE : {
@@ -395,7 +434,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getByteValue();
+ }
return params;
}
case ARRAY_SHORT : {
@@ -403,7 +444,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getShortValue();
+ }
return params;
}
case ARRAY_INT : {
@@ -411,7 +454,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getIntValue();
+ }
return params;
}
case ARRAY_LONG : {
@@ -419,7 +464,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getLongValue();
+ }
return params;
}
case ARRAY_FLOAT : {
@@ -427,7 +474,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getFloatValue();
+ }
return params;
}
case ARRAY_DOUBLE : {
@@ -435,7 +484,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getDoubleValue();
+ }
return params;
}
case ARRAY_CHAR : {
@@ -444,7 +495,9 @@
int i = 0;
// TODO better checking an transformation string to char
while (values.hasNext())
+ {
params[i++] = values.next().getStringValue().charAt(0);
+ }
return params;
}
case ARRAY_STRING : {
@@ -452,7 +505,9 @@
Iterator<JsonValue> values = jsonValue.getElements();
int i = 0;
while (values.hasNext())
+ {
params[i++] = values.next().getStringValue();
+ }
return params;
}
default :
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorImpl.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -94,9 +94,13 @@
Object invokeResult = method.invoke(object, new Object[0]);
if (JsonUtils.getType(invokeResult) != null)
+ {
jsonRootValue.addElement(key, createJsonValue(invokeResult));
+ }
else
+ {
jsonRootValue.addElement(key, createJsonObject(invokeResult));
+ }
}
catch (InvocationTargetException e)
@@ -115,7 +119,7 @@
/**
* Create JsonValue corresponding to Java object.
- *
+ *
* @param object source object.
* @return JsonValue.
* @throws JsonException if any errors occurs.
@@ -146,67 +150,87 @@
return new StringValue(Character.toString((Character)object));
case STRING :
return new StringValue((String)object);
+ case ENUM:
+ return new StringValue(((Enum)object).name());
case ARRAY_BOOLEAN : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new BooleanValue(Array.getBoolean(object, i)));
+ }
return jsonArray;
}
case ARRAY_BYTE : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new LongValue(Array.getByte(object, i)));
+ }
return jsonArray;
}
case ARRAY_SHORT : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new LongValue(Array.getShort(object, i)));
+ }
return jsonArray;
}
case ARRAY_INT : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new LongValue(Array.getInt(object, i)));
+ }
return jsonArray;
}
case ARRAY_LONG : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new LongValue(Array.getLong(object, i)));
+ }
return jsonArray;
}
case ARRAY_FLOAT : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new DoubleValue(Array.getFloat(object, i)));
+ }
return jsonArray;
}
case ARRAY_DOUBLE : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new DoubleValue(Array.getDouble(object, i)));
+ }
return jsonArray;
}
case ARRAY_CHAR : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new StringValue(Character.toString(Array.getChar(object, i))));
+ }
return jsonArray;
}
case ARRAY_STRING : {
JsonValue jsonArray = new ArrayValue();
int length = Array.getLength(object);
for (int i = 0; i < length; i++)
+ {
jsonArray.addElement(new StringValue((String)Array.get(object, i)));
+ }
return jsonArray;
}
case ARRAY_OBJECT : {
@@ -216,9 +240,13 @@
{
Object el = Array.get(object, i);
if (JsonUtils.getType(el) != null)
+ {
jsonArray.addElement(createJsonValue(el));
+ }
else
+ {
jsonArray.addElement(createJsonObject(el));
+ }
}
return jsonArray;
@@ -229,9 +257,13 @@
for (Object o : list)
{
if (JsonUtils.getType(o) != null)
+ {
jsonArray.addElement(createJsonValue(o));
+ }
else
+ {
jsonArray.addElement(createJsonObject(o));
+ }
}
return jsonArray;
@@ -244,9 +276,13 @@
{
Object o = map.get(k);
if (JsonUtils.getType(o) != null)
+ {
jsonObject.addElement(k, createJsonValue(o));
+ }
else
+ {
jsonObject.addElement(k, createJsonObject(o));
+ }
}
return jsonObject;
@@ -258,9 +294,9 @@
}
/**
- * Check fields in class which marked as 'transient'. Transient fields will be
- * not serialized in JSON representation.
- *
+ * Check fields in class which marked as 'transient'. Transient fields will
+ * be not serialized in JSON representation.
+ *
* @param clazz the class.
* @return list of fields which must be skiped.
*/
Modified: ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/main/java/org/exoplatform/ws/frameworks/json/impl/JsonUtils.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -152,7 +152,12 @@
/**
* Map.
*/
- MAP
+ MAP,
+
+ /**
+ * Enum.
+ */
+ ENUM
}
/**
@@ -321,6 +326,8 @@
return Types.NULL;
if (KNOWN_TYPES.get(o.getClass().getName()) != null)
return KNOWN_TYPES.get(o.getClass().getName());
+ if (o instanceof Enum)
+ return Types.ENUM;
if (o instanceof Object[])
return Types.ARRAY_OBJECT;
if (o instanceof Collection)
@@ -340,6 +347,8 @@
{
if (KNOWN_TYPES.get(clazz.getName()) != null)
return KNOWN_TYPES.get(clazz.getName());
+ if (Enum.class.isAssignableFrom(clazz))
+ return Types.ENUM;
if (clazz.isArray())
return Types.ARRAY_OBJECT;
if (Collection.class.isAssignableFrom(clazz))
Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithBookEnum.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithBookEnum.java (rev 0)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithBookEnum.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -0,0 +1,41 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.ws.frameworks.json;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class BeanWithBookEnum
+{
+
+ private BookEnum book;
+
+ public BookEnum getBook()
+ {
+ return book;
+ }
+
+ public void setBook(BookEnum book)
+ {
+ this.book = book;
+ }
+
+}
Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithBookEnum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithSimpleEnum.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithSimpleEnum.java (rev 0)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithSimpleEnum.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -0,0 +1,78 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.ws.frameworks.json;
+
+import java.util.List;
+
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class BeanWithSimpleEnum
+{
+ private String name;
+
+ private StringEnum count;
+
+ private StringEnum[] counts;
+
+ private List<StringEnum> countList;
+
+ public StringEnum getCount()
+ {
+ return count;
+ }
+
+ public List<StringEnum> getCountList()
+ {
+ return countList;
+ }
+
+ public StringEnum[] getCounts()
+ {
+ return counts;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setCount(StringEnum count)
+ {
+ this.count = count;
+ }
+
+ public void setCountList(List<StringEnum> countList)
+ {
+ this.countList = countList;
+ }
+
+ public void setCounts(StringEnum[] counts)
+ {
+ this.counts = counts;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BeanWithSimpleEnum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/Book.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/Book.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/Book.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -39,6 +39,21 @@
private boolean delivery;
+ public Book()
+ {
+ }
+
+ public Book(String author, String title, double price, long isdn, int pages, boolean availability, boolean delivery)
+ {
+ this.author = author;
+ this.title = title;
+ this.price = price;
+ this.isdn = isdn;
+ this.pages = pages;
+ this.availability = availability;
+ this.delivery = delivery;
+ }
+
public void setAuthor(String s)
{
author = s;
Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BookEnum.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BookEnum.java (rev 0)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BookEnum.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.ws.frameworks.json;
+
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public enum BookEnum {
+
+ JUNIT_IN_ACTION(new Book("Vincent Masson", "JUnit in Action", 19.37, 93011099534534L, 386, true, false)), //
+ BEGINNING_C(new Book("Christian Gross", "Beginning C# 2008 from novice to professional", 23.56, 9781590598696L, 511,
+ false, false));
+
+ private final Book book;
+
+ private BookEnum(Book book)
+ {
+ this.book = book;
+ }
+
+ @Override
+ public String toString()
+ {
+ return book.toString();
+ }
+}
Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/BookEnum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/StringEnum.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/StringEnum.java (rev 0)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/StringEnum.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * 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.exoplatform.ws.frameworks.json;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public enum StringEnum {
+
+ ONE("one"), //
+ TWO("two"), //
+ TREE("tree");
+
+ private final String count;
+
+ private StringEnum(String count)
+ {
+ this.count = count;
+ }
+
+ @Override
+ public String toString()
+ {
+ return count;
+ }
+}
\ No newline at end of file
Property changes on: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/StringEnum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonGeneratorTest.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -20,14 +20,19 @@
import junit.framework.TestCase;
+import org.exoplatform.ws.frameworks.json.BeanWithBookEnum;
+import org.exoplatform.ws.frameworks.json.BeanWithSimpleEnum;
import org.exoplatform.ws.frameworks.json.BeanWithTransientField;
import org.exoplatform.ws.frameworks.json.Book;
+import org.exoplatform.ws.frameworks.json.BookEnum;
import org.exoplatform.ws.frameworks.json.BookStorage;
import org.exoplatform.ws.frameworks.json.BookWrapper;
import org.exoplatform.ws.frameworks.json.JavaMapBean;
+import org.exoplatform.ws.frameworks.json.StringEnum;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -214,4 +219,49 @@
}
}
+ public void testEnumSerialization() throws Exception
+ {
+ BeanWithSimpleEnum be = new BeanWithSimpleEnum();
+ be.setName("name");
+ be.setCount(StringEnum.TWO);
+ be.setCounts(new StringEnum[]{StringEnum.ONE, StringEnum.TWO});
+ be.setCountList(Arrays.asList(StringEnum.ONE, StringEnum.TWO, StringEnum.TREE));
+ JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(be);
+ //System.out.println(jsonValue);
+
+ assertEquals("name", jsonValue.getElement("name").getStringValue());
+
+ assertEquals(StringEnum.TWO.name(), jsonValue.getElement("count").getStringValue());
+
+ JsonValue countValues = jsonValue.getElement("counts");
+ List<String> tmp = new ArrayList<String>();
+ for (Iterator<JsonValue> counts = countValues.getElements(); counts.hasNext();)
+ {
+ tmp.add(counts.next().getStringValue());
+ }
+ assertEquals(2, tmp.size());
+ assertTrue(tmp.contains(StringEnum.ONE.name()));
+ assertTrue(tmp.contains(StringEnum.TWO.name()));
+
+ JsonValue countListValues = jsonValue.getElement("countList");
+ tmp = new ArrayList<String>();
+ for (Iterator<JsonValue> counts = countListValues.getElements(); counts.hasNext();)
+ {
+ tmp.add(counts.next().getStringValue());
+ }
+ assertEquals(3, tmp.size());
+ assertTrue(tmp.contains(StringEnum.ONE.name()));
+ assertTrue(tmp.contains(StringEnum.TWO.name()));
+ assertTrue(tmp.contains(StringEnum.TREE.name()));
+ }
+
+ public void testEnumSerialization2() throws Exception
+ {
+ BeanWithBookEnum be = new BeanWithBookEnum();
+ be.setBook(BookEnum.JUNIT_IN_ACTION);
+ JsonValue jsonValue = new JsonGeneratorImpl().createJsonObject(be);
+ //System.out.println(jsonValue);
+ assertEquals(BookEnum.JUNIT_IN_ACTION.name(), jsonValue.getElement("book").getStringValue());
+ }
+
}
Modified: ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonParserTest.java
===================================================================
--- ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonParserTest.java 2010-03-25 16:14:57 UTC (rev 2141)
+++ ws/trunk/exo.ws.frameworks.json/src/test/java/org/exoplatform/ws/frameworks/json/impl/JsonParserTest.java 2010-03-25 16:33:32 UTC (rev 2142)
@@ -20,17 +20,22 @@
import junit.framework.TestCase;
+import org.exoplatform.ws.frameworks.json.BeanWithBookEnum;
+import org.exoplatform.ws.frameworks.json.BeanWithSimpleEnum;
import org.exoplatform.ws.frameworks.json.Book;
+import org.exoplatform.ws.frameworks.json.BookEnum;
import org.exoplatform.ws.frameworks.json.BookStorage;
import org.exoplatform.ws.frameworks.json.JavaCollectionBean;
import org.exoplatform.ws.frameworks.json.JavaMapBean;
import org.exoplatform.ws.frameworks.json.JsonHandler;
import org.exoplatform.ws.frameworks.json.JsonParser;
+import org.exoplatform.ws.frameworks.json.StringEnum;
import org.exoplatform.ws.frameworks.json.value.JsonValue;
import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
/**
@@ -226,4 +231,46 @@
.getElements().next().getElement("title").getStringValue());
}
+ public void testEnumSerialization() throws Exception
+ {
+ String source =
+ "{\"countList\":[\"ONE\",\"TWO\",\"TREE\"], \"name\":\"andrew\",\"count\":\"TREE\",\"counts\":[\"TWO\",\"TREE\"]}";
+ JsonParser parser = new JsonParserImpl();
+ JsonHandler jsonHandler = new JsonDefaultHandler();
+ parser.parse(new ByteArrayInputStream(source.getBytes()), jsonHandler);
+ JsonValue jsonValue = jsonHandler.getJsonObject();
+ // System.out.println(jsonValue);
+
+ BeanWithSimpleEnum o = (BeanWithSimpleEnum)new BeanBuilder().createObject(BeanWithSimpleEnum.class, jsonValue);
+
+ assertEquals("andrew", o.getName());
+
+ assertEquals(StringEnum.TREE, o.getCount());
+
+ StringEnum[] counts = o.getCounts();
+ assertEquals(2, counts.length);
+
+ List<StringEnum> tmp = Arrays.asList(counts);
+ assertTrue(tmp.contains(StringEnum.TWO));
+ assertTrue(tmp.contains(StringEnum.TREE));
+
+ tmp = o.getCountList();
+ assertEquals(3, tmp.size());
+ assertTrue(tmp.contains(StringEnum.ONE));
+ assertTrue(tmp.contains(StringEnum.TWO));
+ assertTrue(tmp.contains(StringEnum.TREE));
+ }
+
+ public void testEnumSerialization2() throws Exception
+ {
+ String source = "{\"book\":\"BEGINNING_C\"}";
+ JsonParser parser = new JsonParserImpl();
+ JsonHandler jsonHandler = new JsonDefaultHandler();
+ parser.parse(new ByteArrayInputStream(source.getBytes()), jsonHandler);
+ JsonValue jsonValue = jsonHandler.getJsonObject();
+ //System.out.println(jsonValue);
+ BeanWithBookEnum o = (BeanWithBookEnum)new BeanBuilder().createObject(BeanWithBookEnum.class, jsonValue);
+ assertEquals(BookEnum.BEGINNING_C, o.getBook());
+ }
+
}
14 years, 2 months
exo-jcr SVN: r2141 - in jcr/trunk/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/impl/dataflow/serialization and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-25 12:14:57 -0400 (Thu, 25 Mar 2010)
New Revision: 2141
Added:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java
Log:
EXOJCR-605: empty classes removed and test renamed
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FilterMultiColumnQuery.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>FilterMultiColumnQuery</code> wraps a multi column query and filters
- * out rows that do not satisfy a given constraint.
- */
-public class FilterMultiColumnQuery
-{
- //implements MultiColumnQuery {
- //
- // /**
- // * The logger instance for this class.
- // */
- // private static final Logger log = LoggerFactory.getLogger(FilterMultiColumnQuery.class);
- //
- // /**
- // * The query to filter.
- // */
- // private final MultiColumnQuery query;
- //
- // /**
- // * The constraint for filtering.
- // */
- // private final Constraint constraint;
- //
- // /**
- // * Creates a new filter multi column query for the given <code>query</code>
- // * and <code>constraint</code>.
- // *
- // * @param query the query to filter.
- // * @param constraint the constraint for filtering.
- // */
- // public FilterMultiColumnQuery(MultiColumnQuery query,
- // Constraint constraint) {
- // this.query = query;
- // this.constraint = constraint;
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // public MultiColumnQueryHits execute(final JackrabbitIndexSearcher searcher,
- // Sort sort,
- // long resultFetchHint)
- // throws IOException {
- // return new FilterMultiColumnQueryHits(query.execute(
- // searcher, sort, resultFetchHint)) {
- //
- // {
- // log.debug(Arrays.asList(getSelectorNames()).toString());
- // }
- //
- // public ScoreNode[] nextScoreNodes() throws IOException {
- // ScoreNode[] next;
- // do {
- // next = super.nextScoreNodes();
- // if (log.isDebugEnabled()) {
- // if (next != null) {
- // log.debug(Arrays.asList(next).toString());
- // }
- // }
- // } while (next != null && !constraint.evaluate(next, getSelectorNames(), searcher));
- // return next;
- // }
- // };
- // }
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrTextExtractor.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-//
-///**
-// * Backwards-compatible Jackrabbit text extractor component. This class
-// * implements the following functionality:
-// * <ul>
-// * <li>
-// * Parses the configured {@link TextExtractor} and {@link TextFilter}
-// * class names and instantiates the configured classes.
-// * </li>
-// * <li>
-// * Acts as the delegate extractor for any configured
-// * {@link DelegatingTextExtractor} instances.
-// * </li>
-// * <li>
-// * Maintains a {@link CompositeTextExtractor} instance that contains
-// * all the configured extractors and to which all text extraction calls
-// * are delegated.
-// * </li>
-// * <li>
-// * Creates a {@link TextFilterExtractor} adapter for a configured
-// * {@link TextFilter} instance when it is first used and adds that adapter
-// * to the composite extractor for use in text extraction.
-// * </li>
-// * <li>
-// * Logs a warning and creates a dummy {@link EmptyTextExtractor} instance
-// * for any unsupported content types when first detected. The dummy
-// * extractor is added to the composite extractor to prevent future
-// * warnings about the same content type.
-// * </li>
-// * </ul>
-// */
-public class JcrTextExtractor
-{
- //implements TextExtractor {
-
- // /**
- // * Logger instance.
- // */
- // private static final Logger logger =
- // LoggerFactory.getLogger(JackrabbitTextExtractor.class);
- //
- // /**
- // * Set of content types that are known to be supported by the
- // * composite extractor.
- // */
- // private final Set types = new HashSet();
- //
- // /**
- // * Composite extractor used to for all text extration tasks. Contains
- // * all the {@link TextExtractor} instances for directly supported content
- // * types, the {@link TextFilterExtractor} adapters for backwards
- // * compatibility with configured {@link TextFilter} instances that have
- // * already been used, and the dummy {@link EmptyTextExtractor} instances
- // * created for unsupported content types.
- // */
- // private final CompositeTextExtractor extractor =
- // new CompositeTextExtractor();
- //
- // /**
- // * Configured {@link TextFilter} instances. Used for backwards
- // * compatibility with existing configuration files and {@link TextFilter}
- // * implementations.
- // */
- // private final Collection filters = new ArrayList();
- //
- // /**
- // * Creates a Jackrabbit text extractor containing the configured component
- // * classes.
- // *
- // * @param classes configured {@link TextExtractor} (and {@link TextFilter})
- // * class names (space- or comma-separated)
- // */
- // public JackrabbitTextExtractor(String classes) {
- // logger.debug("JackrabbitTextExtractor({})", classes);
- // StringTokenizer tokenizer = new StringTokenizer(classes, ", \t\n\r\f");
- // while (tokenizer.hasMoreTokens()) {
- // String name = tokenizer.nextToken();
- // try {
- // Object object = Class.forName(name).newInstance();
- // if (object instanceof DelegatingTextExtractor) {
- // ((DelegatingTextExtractor) object)
- // .setDelegateTextExtractor(this);
- // }
- // if (object instanceof TextExtractor) {
- // extractor.addTextExtractor((TextExtractor) object);
- // } else if (object instanceof TextFilter) {
- // filters.add(object);
- // } else {
- // logger.warn("Unknown text extractor class: {}", name);
- // }
- // } catch (ClassNotFoundException e) {
- // logger.warn("Extractor class not found: " + name, e);
- // } catch (LinkageError e) {
- // logger.warn("Extractor dependency not found: " + name, e);
- // } catch (IllegalAccessException e) {
- // logger.warn("Extractor constructor not accessible: " + name, e);
- // } catch (InstantiationException e) {
- // logger.warn("Extractor instantiation failed: " + name, e);
- // }
- // }
- //
- // types.addAll(Arrays.asList(extractor.getContentTypes()));
- // }
- //
- // //-------------------------------------------------------< TextExtractor >
- //
- // /**
- // * Returns the content types that the component extractors are known
- // * to support.
- // *
- // * @return supported content types
- // */
- // public String[] getContentTypes() {
- // return extractor.getContentTypes(); // and then some
- // }
- //
- // /**
- // * Extracts the text content from the given binary stream. The given
- // * content type is used to look up a configured text extractor to which
- // * to delegate the request.
- // * <p>
- // * If a matching extractor is not found, then the configured text filters
- // * searched for an instance that claims to support the given content type.
- // * A text extractor adapter is created for that filter and saved in the
- // * extractor map for future use before delegating the request to the
- // * adapter.
- // * <p>
- // * If not even a text filter is found for the given content type, a warning
- // * is logged and an empty text extractor is created for that content type
- // * and saved in the extractor map for future use before delegating the
- // * request to the empty extractor.
- // *
- // * @param stream binary stream
- // * @param type content type
- // * @param encoding character encoding, or <code>null</code>
- // * @return reader for the text content of the binary stream
- // * @throws IOException if the binary stream can not be read
- // */
- // public Reader extractText(InputStream stream, String type, String encoding)
- // throws IOException {
- // logger.debug("extractText(stream, {}, {})", type, encoding);
- // if (!types.contains(type)) {
- // Iterator iterator = filters.iterator();
- // while (iterator.hasNext()) {
- // TextFilter filter = (TextFilter) iterator.next();
- // if (filter.canFilter(type)) {
- // types.add(type);
- // extractor.addTextExtractor(
- // new TextFilterExtractor(type, filter));
- // break;
- // }
- // }
- // }
- //
- // if (!types.contains(type)) {
- // logger.debug("Full text indexing of {} is not supported", type);
- // types.add(type);
- // extractor.addTextExtractor(new EmptyTextExtractor(type));
- // }
- //
- // return extractor.extractText(stream, type, encoding);
- // }
-
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NamePathResolverImpl.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>NamePathResolverImpl</code>...
- */
-public class NamePathResolverImpl{
-//extends DefaultNamePathResolver {
-//
-// private static Logger log = LoggerFactory.getLogger(NamePathResolverImpl.class);
-//
-// private static final NameFactory NAME_FACTORY = NameFactoryImpl.getInstance();
-// private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
-//
-// private NamePathResolverImpl(NameResolver nResolver, PathResolver pResolver) {
-// super(nResolver, pResolver);
-// }
-//
-// public static NamePathResolver create(NamespaceMappings nsMappings) {
-// NameResolver nResolver = new NameResolverImpl(nsMappings);
-// PathResolver pResolver = new ParsingPathResolver(PATH_FACTORY, nResolver);
-// return new NamePathResolverImpl(nResolver, pResolver);
-// }
-//
-//
-// //--------------------------------------------------------< inner class >---
-// /**
-// * Query specific NameResolver that does not assume an empty prefix for the
-// * default namespace URI. Instead the prefix is always retrieved from the
-// * NamespaceResolver.
-// */
-// private static class NameResolverImpl implements NameResolver {
-//
-// /**
-// * Namespace resolver.
-// */
-// private final NamespaceResolver resolver;
-//
-// /**
-// * Creates a parsing name resolver.
-// *
-// * @param resolver namespace resolver
-// */
-// public NameResolverImpl(NamespaceResolver resolver) {
-// this.resolver = resolver;
-// }
-//
-// //-------------------------------------------------------< NameResolver >---
-// /**
-// * Parses the prefixed JCR name and returns the resolved qualified name.
-// *
-// * @param name prefixed JCR name
-// * @return qualified name
-// * @throws IllegalNameException if the JCR name format is invalid
-// * @throws NamespaceException if the namespace prefix can not be resolved
-// */
-// public Name getQName(String name) throws IllegalNameException, NamespaceException {
-// return NameParser.parse(name, resolver, NAME_FACTORY);
-// }
-//
-// /**
-// * Returns the prefixed JCR name for the given qualified name.
-// * Note, that the JCR prefix is always retrieved from the NamespaceResolver
-// * even if the name is in the defaut namespace. This is a special treatement
-// * for query specific implementation, which defines a prefix for all namespace
-// * URIs including the default namespace.
-// *
-// * @param name qualified name
-// * @return prefixed JCR name
-// * @throws NamespaceException if the namespace URI can not be resolved
-// */
-// public String getJCRName(Name name) throws NamespaceException {
-// String uri = name.getNamespaceURI();
-// if (resolver.getPrefix(uri).length() == 0) {
-// return name.getLocalName();
-// } else {
-// return resolver.getPrefix(uri) + ":" + name.getLocalName();
-// }
-// }
-// }
-
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PooledTextExtractor.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-
-/**
- * <code>PooledTextExtractor</code> implements a text extractor that extracts
- * the text using a pool of background threads.
- */
-public class PooledTextExtractor{
-//implements TextExtractor {
-//
-// /**
-// * The logger instance for this class.
-// */
-// private static final Logger log = LoggerFactory.getLogger(PooledTextExtractor.class);
-//
-// /**
-// * The actual text extractor.
-// */
-// private final TextExtractor extractor;
-//
-// /**
-// * The pooled executor.
-// */
-// private final PooledExecutor executor;
-//
-// /**
-// * The timeout for the {@link TextExtractorReader}.
-// */
-// private final long timout;
-//
-// /**
-// * Returns a pooled text extractor based on <code>extractor</code>.
-// *
-// * @param extractor the actual text extractor.
-// * @param poolSize the pool size.
-// * @param backLog size of the back log queue.
-// * @param timeout the timeout in milliseconds until text extraction is put
-// * into the indexing queue and the fulltext index for the
-// * node is later updated when the text extractor finished
-// * its work.
-// */
-// public PooledTextExtractor(TextExtractor extractor,
-// int poolSize,
-// int backLog,
-// long timeout) {
-// this.extractor = extractor;
-// this.timout = timeout;
-// Channel c;
-// if (backLog <= 0) {
-// c = new SynchronousChannel();
-// } else {
-// c = new BoundedLinkedQueue(backLog);
-// }
-// this.executor = new PooledExecutor(c, poolSize);
-// this.executor.setMinimumPoolSize(poolSize);
-// this.executor.setBlockedExecutionHandler(
-// new PooledExecutor.BlockedExecutionHandler() {
-// public boolean blockedAction(Runnable command) {
-// // execute with current thread and log message
-// log.info("Extractor pool busy, running command with "
-// + "current thread: {}", command.toString());
-// command.run();
-// return true;
-// }
-// });
-// }
-//
-//
-// /**
-// * {@inheritDoc}
-// */
-// public String[] getContentTypes() {
-// return extractor.getContentTypes();
-// }
-//
-// /**
-// * {@inheritDoc}
-// * <p/>
-// * This implementation returns an instance of {@link TextExtractorReader}.
-// */
-// public Reader extractText(InputStream stream,
-// String type,
-// String encoding) throws IOException {
-// TextExtractorJob job = new TextExtractorJob(extractor, stream, type, encoding);
-// return new TextExtractorReader(job, executor, timout);
-// }
-//
-// /**
-// * Shuts down this pooled text extractor. This methods stops all currently
-// * running text extractor tasks and cleans up the pending queue (back log).
-// */
-// public void shutdown() {
-// executor.shutdownNow();
-// boolean interrupted;
-// do {
-// try {
-// executor.awaitTerminationAfterShutdown();
-// interrupted = false;
-// } catch (InterruptedException e) {
-// interrupted = true;
-// }
-// } while (interrupted);
-// executor.drain();
-// }
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextExtractorFilter.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-import org.exoplatform.services.jcr.impl.core.query.TextFilter;
-
-/**
- * Utility base class for migrating functionality from existing implementations
- * of the deprecated {@link TextFilter} interface to the new
- * {@link TextExtractor} interface. Once the functionality of an existing
- * TextFilter has been copied to a new TextExtractor, the original class can
- * be replaced with the following template to keep backwards compatibility
- * while avoiding the burden of maintaining duplicate code:
- * <pre>
- * <b>public class</b> SomeTextFilter <b>extends</b> TextExtractorFilter {
- * <b>public</b> SomeTextFilter() {
- * <b>super</b>(<b>new</b> SomeTextExtractor());
- * }
- * }
- * </pre>
- */
-public class TextExtractorFilter {
-//implements TextFilter {
-//
-// /**
-// * The adapted text extractor.
-// */
-// private final TextExtractor extractor;
-//
-// /**
-// * Creates a text filter adapter for the given text extractor.
-// *
-// * @param extractor adapted text extractor
-// */
-// public TextExtractorFilter(TextExtractor extractor) {
-// this.extractor = extractor;
-// }
-//
-// /**
-// * Returns true if the adapted text extractor supports the given
-// * content type.
-// *
-// * @param mimeType content type
-// * @return <code>true</code> if the content type is supported,
-// * <code>false</code> otherwise
-// */
-// public boolean canFilter(String mimeType) {
-// mimeType = mimeType.toLowerCase();
-// String[] types = extractor.getContentTypes();
-// for (int i = 0; i < types.length; i++) {
-// if (types[i].equals(mimeType)) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// /**
-// * Extracts text content of the given binary property using the adapted
-// * text extractor.
-// *
-// * @param data binary property
-// * @param encoding character encoding, or <code>null</code>
-// * @return map that contains a reader for the extracted text as
-// * the {@link FieldNames#FULLTEXT} entry
-// * @throws RepositoryException if the binary property can not be read
-// */
-// public Map doFilter(PropertyState data, String encoding)
-// throws RepositoryException {
-// InternalValue[] values = data.getValues();
-// if (values.length == 1) {
-// try {
-// String type = "application/octet-stream";
-// String[] types = extractor.getContentTypes();
-// if (types.length > 0) {
-// type = types[0];
-// }
-//
-//// BLOBFileValue blob = values[0].getBLOBFileValue();
-// Reader reader =
-// extractor.extractText(null, type, encoding);
-//
-// Map result = new HashMap();
-// result.put(FieldNames.FULLTEXT, reader);
-// return result;
-// } catch (IOException e) {
-// throw new RepositoryException("Text extraction error", e);
-// }
-// } else {
-// // multi value not supported
-// throw new RepositoryException(
-// "Multi-valued binary properties not supported.");
-// }
-// }
-
-}
Deleted: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/TextFilterExtractor.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.exoplatform.services.jcr.impl.core.query.lucene;
-
-import org.exoplatform.services.jcr.impl.core.query.TextFilter;
-
-/**
- * Adapter class for achieving backwards compatibility with classes
- * implementing the deprectated {@link TextFilter} interface. This class
- * implements the {@link TextExtractor} interface through calls to an
- * underlying {@link TextFilter} instance.
- */
-public class TextFilterExtractor {
-//implements TextExtractor {
-//
-// /**
-// * Supported content types.
-// */
-// private final String[] types;
-//
-// /**
-// * The adapted text filter.
-// */
-// private final TextFilter filter;
-//
-// /**
-// * Creates a text extractor adapter that supports the given content
-// * types using the given text filter.
-// *
-// * @param types supported content types
-// * @param filter text filter to be adapted
-// */
-// public TextFilterExtractor(String[] types, TextFilter filter) {
-// this.types = types;
-// this.filter = filter;
-// }
-//
-// /**
-// * Creates a text extractor adapter that supports the given content
-// * type using the given text filter.
-// *
-// * @param type supported content type
-// * @param filter text filter to be adapted
-// */
-// public TextFilterExtractor(String type, TextFilter filter) {
-// this(new String[] { type }, filter);
-// }
-//
-// /**
-// * Returns the supported content types.
-// *
-// * @return supported content types
-// */
-// public String[] getContentTypes() {
-// return types;
-// }
-//
-// /**
-// * Extracts the text content of the given binary stream by calling the
-// * underlying {@link TextFilter} instance. A dummy {@link PropertyState}
-// * instance is created to comply with the
-// * {@link TextFilter#doFilter(PropertyState, String)} method signature.
-// *
-// * @param stream binary stream
-// * @param type content type
-// * @param encoding character encoding, or <code>null</code>
-// * @return reader reader for the extracted text content
-// * @throws IOException if the adapted call fails
-// */
-// public Reader extractText(InputStream stream, String type, String encoding)
-// throws IOException {
-//// InternalValue v = null;
-//// try {
-//// v = InternalValue.createTemporary(stream);
-//// final InternalValue value = v;
-//// PropertyState state = new PropertyState(
-//// (PropertyId) null, ItemState.STATUS_EXISTING, true);
-//// state.setValues(new InternalValue[] { value });
-//// Map fields = filter.doFilter(state, encoding);
-//// Object fulltext = fields.get(FieldNames.FULLTEXT);
-//// if (fulltext instanceof Reader) {
-//// return new FilterReader((Reader) fulltext) {
-//// public void close() throws IOException {
-//// super.close();
-//// value.getBLOBFileValue().discard();
-//// }
-//// };
-//// } else {
-//// value.getBLOBFileValue().discard();
-//// return new StringReader("");
-//// }
-//// } catch (RepositoryException e) {
-//// if (v != null) {
-//// v.getBLOBFileValue().discard();
-//// }
-//// return new StringReader("");
-//// }
-// return null;
-// }
-
-}
Added: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TestPropsDeserialization.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.exoplatform.services.jcr.impl.dataflow.serialization;
+
+import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Calendar;
+import java.util.List;
+
+import javax.jcr.Node;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date:
+ *
+ * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
+ * @version $Id: TetsPropsDeserialization.java 111 2008-11-11 11:11:11Z serg $
+ */
+public class TestPropsDeserialization extends JcrImplSerializationBaseTest
+{
+
+ public void testPropReSetVal() throws Exception
+ {
+ TesterItemsPersistenceListener pl = new TesterItemsPersistenceListener(this.session);
+
+ File content1 = this.createBLOBTempFile(300);
+ File content2 = this.createBLOBTempFile(301);
+
+ Node srcVersionNode = root.addNode("nt_file_node", "nt:file");
+ Node contentNode = srcVersionNode.addNode("jcr:content", "nt:resource");
+ contentNode.setProperty("jcr:data", new FileInputStream(content1));
+ contentNode.setProperty("jcr:mimeType", "text/plain");
+ contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
+ srcVersionNode.addMixin("mix:versionable");
+
+ session.save();
+
+ contentNode.setProperty("jcr:data", new FileInputStream(content2));
+ session.save();
+
+ List<TransactionChangesLog> logs = pl.pushChanges();
+
+ File jcrfile = super.serializeLogs(logs);
+
+ List<TransactionChangesLog> destLog = super.deSerializeLogs(jcrfile);
+
+ assertEquals(logs.size(), destLog.size());
+
+ for (int i = 0; i < logs.size(); i++)
+ checkIterator(logs.get(i).getAllStates().iterator(), destLog.get(i).getAllStates().iterator());
+ }
+
+}
Deleted: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java 2010-03-25 15:56:25 UTC (rev 2140)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/serialization/TetsPropsDeserialization.java 2010-03-25 16:14:57 UTC (rev 2141)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * 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.exoplatform.services.jcr.impl.dataflow.serialization;
-
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.util.Calendar;
-import java.util.List;
-
-import javax.jcr.Node;
-
-/**
- * Created by The eXo Platform SAS.
- *
- * <br/>Date:
- *
- * @author <a href="karpenko.sergiy(a)gmail.com">Karpenko Sergiy</a>
- * @version $Id: TetsPropsDeserialization.java 111 2008-11-11 11:11:11Z serg $
- */
-public class TetsPropsDeserialization extends JcrImplSerializationBaseTest
-{
-
- public void testPropReSetVal() throws Exception
- {
- TesterItemsPersistenceListener pl = new TesterItemsPersistenceListener(this.session);
-
- File content1 = this.createBLOBTempFile(300);
- File content2 = this.createBLOBTempFile(301);
-
- Node srcVersionNode = root.addNode("nt_file_node", "nt:file");
- Node contentNode = srcVersionNode.addNode("jcr:content", "nt:resource");
- contentNode.setProperty("jcr:data", new FileInputStream(content1));
- contentNode.setProperty("jcr:mimeType", "text/plain");
- contentNode.setProperty("jcr:lastModified", session.getValueFactory().createValue(Calendar.getInstance()));
- srcVersionNode.addMixin("mix:versionable");
-
- session.save();
-
- contentNode.setProperty("jcr:data", new FileInputStream(content2));
- session.save();
-
- List<TransactionChangesLog> logs = pl.pushChanges();
-
- File jcrfile = super.serializeLogs(logs);
-
- List<TransactionChangesLog> destLog = super.deSerializeLogs(jcrfile);
-
- assertEquals(logs.size(), destLog.size());
-
- for (int i = 0; i < logs.size(); i++)
- checkIterator(logs.get(i).getAllStates().iterator(), destLog.get(i).getAllStates().iterator());
- }
-
-}
14 years, 2 months
exo-jcr SVN: r2140 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services: jcr/impl/core/version and 25 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-25 11:56:25 -0400 (Thu, 25 Mar 2010)
New Revision: 2140
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BaseValue.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BinaryValue.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueConstraintsMatcher.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ChildVersionRemoveVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataCopyIgnoredVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataCopyVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataRemoveVisitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LocalWorkspaceDataManagerStub.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionInterceptor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryContainerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/StringConverter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/SpoolFile.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/WorkspaceSystemViewStreamExporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/StreamImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceDataImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceRestoreContentImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/PropertyInfo.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/observation/ExtendedEventType.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/VersionHistoryImporter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java
Log:
EXOJCR-605: jcr.core Loggers updated
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BaseValue.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BaseValue.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BaseValue.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -49,7 +49,7 @@
public abstract class BaseValue implements ExtendedValue, ReadableBinaryValue
{
- protected static Log log = ExoLogger.getLogger("jcr.BinaryValue");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.BaseValue");
protected final int type;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BinaryValue.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BinaryValue.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/BinaryValue.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -49,7 +49,7 @@
protected boolean changed = false;
- protected static Log log = ExoLogger.getLogger("jcr.BinaryValue");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.BinaryValue");
/**
* @param text
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueConstraintsMatcher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueConstraintsMatcher.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueConstraintsMatcher.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -52,7 +52,7 @@
public class ValueConstraintsMatcher
{
- protected static Log log = ExoLogger.getLogger("jcr.ValueConstraintsMatcher");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.ValueConstraintsMatcher");
protected final static String DEFAULT_THRESHOLD = "";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -60,7 +60,7 @@
public class ValueFactoryImpl implements ValueFactory
{
- protected static final Log LOG = ExoLogger.getLogger("jcr.ValueFactoryImpl");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ValueFactoryImpl");
private LocationFactory locationFactory;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ChildVersionRemoveVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ChildVersionRemoveVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ChildVersionRemoveVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -46,7 +46,7 @@
public class ChildVersionRemoveVisitor extends ItemDataTraversingVisitor
{
- private final Log log = ExoLogger.getLogger("jcr.ChildVersionRemoveVisitor");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ChildVersionRemoveVisitor");
protected final Stack<NodeData> parents = new Stack<NodeData>();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/FrozenNodeInitializer.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -60,7 +60,7 @@
public class FrozenNodeInitializer extends AbstractItemDataCopyVisitor
{
- private static Log log = ExoLogger.getLogger("jcr.FrozenNodeInitializer");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.FrozenNodeInitializer");
private final Stack<NodeData> contextNodes;
@@ -90,11 +90,13 @@
protected void entering(PropertyData property, int level) throws RepositoryException
{
- if (log.isDebugEnabled()) {
+ if (log.isDebugEnabled())
+ {
log.debug("Entering property " + property.getQPath().getAsString());
}
-
- if (currentNode() == null) {
+
+ if (currentNode() == null)
+ {
// skip if no parent - parent is COMPUTE, INITIALIZE
return;
}
@@ -196,7 +198,7 @@
else
throw new RepositoryException("Unknown OnParentVersion value " + action);
}
-
+
changesLog.add(ItemState.createAddedState(frozenProperty));
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataCopyIgnoredVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataCopyIgnoredVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataCopyIgnoredVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -46,7 +46,7 @@
public class ItemDataCopyIgnoredVisitor extends DefaultItemDataCopyVisitor
{
- private static Log log = ExoLogger.getLogger("jcr.ItemDataCopyIgnoredVisitor");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemDataCopyIgnoredVisitor");
protected final SessionChangesLog restoredChanges;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataMergeVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -67,7 +67,7 @@
protected static int UPDATE = 2;
- protected static Log log = ExoLogger.getLogger("jcr.ItemDataMergeVisitor");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemDataMergeVisitor");
protected final SessionImpl mergeSession;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/ItemDataRestoreVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -63,7 +63,7 @@
public class ItemDataRestoreVisitor extends AbstractItemDataCopyVisitor
{
- private final Log log = ExoLogger.getLogger("jcr.ItemDataRestoreVisitor");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemDataRestoreVisitor");
protected final boolean removeExisting;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/AbstractPersistedValueData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -18,12 +18,12 @@
*/
package org.exoplatform.services.jcr.impl.dataflow;
-import javax.jcr.RepositoryException;
-
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import javax.jcr.RepositoryException;
+
/**
* @author <a href="mailto:peter.nedonosko@exoplatform.com">Peter Nedonosko</a>
* @version $Id$
@@ -31,7 +31,7 @@
public abstract class AbstractPersistedValueData implements ValueData
{
- protected final static Log LOG = ExoLogger.getLogger("jcr.PersistedValueData");
+ protected final static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.PersistedValueData");
protected int orderNumber;
@@ -41,12 +41,12 @@
protected AbstractPersistedValueData()
{
}
-
+
protected AbstractPersistedValueData(int orderNumber)
{
this.orderNumber = orderNumber;
}
-
+
/**
* {@inheritDoc}
*/
@@ -76,5 +76,5 @@
* @throws RepositoryException if error ocurs
*/
public abstract TransientValueData createTransientCopy() throws RepositoryException;
-
+
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/EditableValueData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -36,10 +36,10 @@
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
-public class EditableValueData extends TransientValueData
+public class EditableValueData extends TransientValueData
{
- protected final static Log LOG = ExoLogger.getLogger("jcr.EditableValueData");
+ protected final static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.EditableValueData");
protected class NewEditableValueData extends NewValueData
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataCopyVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataCopyVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataCopyVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -41,7 +41,7 @@
public class ItemDataCopyVisitor extends DefaultItemDataCopyVisitor
{
- private Log log = ExoLogger.getLogger("jcr.ItemDataCopyVisitor");
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemDataCopyVisitor");
public ItemDataCopyVisitor(NodeData parent, InternalQName destNodeName, NodeTypeDataManager nodeTypeManager,
SessionDataManager dataManager, boolean keepIdentifiers)
@@ -143,7 +143,7 @@
{
return;
}
- values = copyValues(property);
+ values = copyValues(property);
}
TransientPropertyData newProperty =
@@ -151,7 +151,8 @@
.getIdentifier() : IdGenerator.generate(), -1, property.getType(), curParent().getIdentifier(), property
.isMultiValued(), values);
- if (log.isDebugEnabled()) {
+ if (log.isDebugEnabled())
+ {
log.debug("entering COPY " + newProperty.getQPath().getAsString() + "; pidentifier: "
+ newProperty.getParentIdentifier() + "; identifier: " + newProperty.getIdentifier());
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataRemoveVisitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataRemoveVisitor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/ItemDataRemoveVisitor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -51,7 +51,7 @@
public class ItemDataRemoveVisitor extends ItemDataTraversingVisitor
{
- private static Log log = ExoLogger.getLogger("jcr.ItemDataRemoveVisitor");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ItemDataRemoveVisitor");
protected List<ItemState> itemRemovedStates = new ArrayList<ItemState>();
@@ -326,7 +326,7 @@
throw new RepositoryException("Node ACL is null. " + node.getQPath().getAsString() + " "
+ node.getIdentifier());
}
-
+
return new TransientNodeData(node.getQPath(), node.getIdentifier(), node.getPersistedVersion(), node
.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(), node.getParentIdentifier(), acl);
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -40,7 +40,7 @@
public abstract class TransientItemData implements ItemData, Externalizable
{
- protected static final Log LOG = ExoLogger.getLogger("jcr.TransientItemData");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TransientItemData");
protected String identifier;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientValueData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -59,7 +59,7 @@
public class TransientValueData implements ValueData
{
- protected final static Log LOG = ExoLogger.getLogger("jcr.TransientValueData");
+ protected final static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TransientValueData");
protected ValueData delegate;
@@ -839,7 +839,7 @@
{
this(0, value);
}
-
+
/**
* Creates TransientValueData with incoming byte array.
* @param orderNumber
@@ -1055,7 +1055,7 @@
{
this(0, value);
}
-
+
/**
* Constructor for Reference value data.
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -44,7 +44,7 @@
public class ACLInheritanceSupportedWorkspaceDataManager implements SharedDataManager
{
- private static Log LOG = ExoLogger.getLogger("jcr.ACLInheritanceSupportedWorkspaceDataManager");
+ private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ACLInheritanceSupportedWorkspaceDataManager");
protected final CacheableWorkspaceDataManager persistentManager;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CleanableFilePersistedValueData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -39,7 +39,7 @@
public class CleanableFilePersistedValueData extends FilePersistedValueData
{
- protected final static Log LOG = ExoLogger.getLogger("jcr.CleanableFileStreamValueData");
+ protected final static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CleanableFileStreamValueData");
protected FileCleaner cleaner;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LocalWorkspaceDataManagerStub.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LocalWorkspaceDataManagerStub.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LocalWorkspaceDataManagerStub.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -38,7 +38,7 @@
public class LocalWorkspaceDataManagerStub extends VersionableWorkspaceDataManager
{
- private static Log log = ExoLogger.getLogger("jcr.LocalWorkspaceDataManagerStub");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.LocalWorkspaceDataManagerStub");
public LocalWorkspaceDataManagerStub(CacheableWorkspaceDataManager persistentManager)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TxIsolatedOperation.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -23,7 +23,7 @@
*/
public abstract class TxIsolatedOperation
{
- protected static final Log LOG = ExoLogger.getLogger("jcr.TxIsolatedOperation");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TxIsolatedOperation");
protected final TransactionManager txManager;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -53,7 +53,7 @@
public class VersionableWorkspaceDataManager extends ACLInheritanceSupportedWorkspaceDataManager
{
- private static Log log = ExoLogger.getLogger("jcr.VersionableWorkspaceDataManager");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.VersionableWorkspaceDataManager");
private ACLInheritanceSupportedWorkspaceDataManager versionDataManager;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -41,11 +41,8 @@
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
-import org.exoplatform.services.jcr.impl.storage.value.fs.FileIOChannel;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
-import org.exoplatform.services.jcr.storage.value.ValueIOChannel;
-import org.exoplatform.services.jcr.storage.value.ValueStoragePluginProvider;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -59,7 +56,6 @@
import java.util.Set;
import javax.jcr.InvalidItemStateException;
-import javax.jcr.PropertyType;
import javax.jcr.RepositoryException;
/**
@@ -76,7 +72,7 @@
/**
* Logger.
*/
- protected static final Log LOG = ExoLogger.getLogger("jcr.WorkspacePersistentDataManager");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.WorkspacePersistentDataManager");
/**
* Workspace data container (persistent storage).
@@ -271,7 +267,7 @@
protected PlainChangesLogImpl save(PlainChangesLog changesLog) throws InvalidItemStateException,
RepositoryException, IOException
- {
+ {
// copy state
PlainChangesLogImpl newLog =
new PlainChangesLogImpl(new ArrayList<ItemState>(), changesLog.getSessionId(), changesLog.getEventType(),
@@ -367,7 +363,7 @@
prevState.isInternallyCreated(), prevState.isPersisted());
newLog.add(itemState);
-
+
// save state
if (itemState.isPersisted())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -21,8 +21,6 @@
import org.exoplatform.container.configuration.ConfigurationManager;
import org.exoplatform.services.jcr.access.AccessControlList;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.config.SimpleParameterEntry;
-import org.exoplatform.services.jcr.config.TemplateConfigurationHelper;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
@@ -40,14 +38,9 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.transaction.TransactionService;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
@@ -96,7 +89,7 @@
public class JBossCacheWorkspaceStorageCache implements WorkspaceStorageCache
{
- private static final Log LOG = ExoLogger.getLogger("jcr.JBossCacheWorkspaceStorageCache");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JBossCacheWorkspaceStorageCache");
public static final String JBOSSCACHE_CONFIG = "jbosscache-configuration";
@@ -277,7 +270,7 @@
{
factory = new ExoJBossCacheFactory<Serializable, Object>(cfm);
}
-
+
this.cache = new BufferedJBossCache(factory.createCache(wsConfig.getCache()));
this.itemsRoot = Fqn.fromElements(ITEMS);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/ParentNodeEvictionActionPolicy.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -22,7 +22,6 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.eviction.DefaultEvictionActionPolicy;
import org.jboss.cache.eviction.EvictionActionPolicy;
import java.util.Set;
@@ -40,7 +39,7 @@
{
Cache<?, ?> cache;
- private static final Log log = LogFactory.getLog(DefaultEvictionActionPolicy.class);
+ private static final Log log = LogFactory.getLog("exo.jcr.component.core.DefaultEvictionActionPolicy");
public void setCache(Cache<?, ?> cache)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -55,7 +55,7 @@
// VersionableWorkspaceDataManager.save(CompositeChangesLog changesLog)
private LocalWorkspaceDataManagerStub storageDataManager;
- protected static Log LOG = ExoLogger.getLogger("jcr.TransactionableDataManager");
+ protected static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.TransactionableDataManager");
private TransactionChangesLog transactionLog;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionCatalog.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -44,7 +44,7 @@
public class SessionActionCatalog extends ActionCatalog
{
- private static Log log = ExoLogger.getLogger("jcr.SessionActionCatalog");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.SessionActionCatalog");
private final LocationFactory locFactory;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionInterceptor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionInterceptor.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/ext/action/SessionActionInterceptor.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -52,7 +52,7 @@
private final ExoContainer container;
- private static Log log = ExoLogger.getLogger("jcr.SessionActionInterceptor");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.SessionActionInterceptor");
/**
* SessionActionInterceptor is per session, and only one action per session/time can be active.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryContainerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryContainerImpl.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryContainerImpl.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -37,7 +37,7 @@
public class InmemoryContainerImpl extends WorkspaceDataContainerBase
{
- private static Log log = ExoLogger.getLogger("jcr.InmemoryContainerImpl");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.InmemoryContainerImpl");
private String name;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -50,7 +50,7 @@
public class InmemoryStorageConnection implements WorkspaceStorageConnection
{
- private static Log log = ExoLogger.getLogger("jcr.InmemoryStorageConnection");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.InmemoryStorageConnection");
private TreeMap items;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -91,7 +91,7 @@
/**
* Connection logger.
*/
- protected static final Log LOG = ExoLogger.getLogger("jcr.JDBCStorageConnection");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JDBCStorageConnection");
/**
* NODE type.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -63,7 +63,7 @@
public class JDBCWorkspaceDataContainer extends WorkspaceDataContainerBase implements Startable
{
- protected static final Log LOG = ExoLogger.getLogger("jcr.JDBCWorkspaceDataContainer");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JDBCWorkspaceDataContainer");
/**
* Indicates if the statistics has to be enabled.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -42,7 +42,7 @@
*/
public class GenericConnectionFactory implements WorkspaceStorageConnectionFactory
{
- protected final Log log = ExoLogger.getLogger("jcr.GenericConnectionFactory");
+ protected final Log log = ExoLogger.getLogger("exo.jcr.component.core.GenericConnectionFactory");
protected final DataSource dbDataSource;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -69,7 +69,7 @@
/**
* Connection logger.
*/
- protected static final Log LOG = ExoLogger.getLogger("jcr.optimisation.CQJDBCStorageConnection");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CQJDBCStorageConnection");
/**
* FIND_NODES_BY_PARENTID NEW.
@@ -100,9 +100,9 @@
public int compare(ValueData vd1, ValueData vd2)
{
return vd1.getOrderNumber() - vd2.getOrderNumber();
- }
+ }
};
-
+
/**
* Class needed to store node details (property also) since result set is not sorted in valid way.
*/
@@ -132,15 +132,16 @@
cnordernumb = item.getInt(COLUMN_NORDERNUM);
}
}
-
+
/**
* store temporary property data to allow to sort it manually
*/
private static class TempPropertyData implements Comparable<TempPropertyData>
{
int orderNum;
+
byte[] data;
-
+
public TempPropertyData(ResultSet item) throws SQLException
{
orderNum = item.getInt(COLUMN_VORDERNUM);
@@ -306,7 +307,7 @@
isNotLast = resultSet.next();
}
while (isNotLast && resultSet.getString(COLUMN_ID).equals(cid));
-
+
// To avoid using a temporary table, we sort the values manually
Collections.sort(data, COMPARATOR_VALUE_DATA);
//create property
@@ -382,7 +383,8 @@
* @return ACL owner
* @throws IllegalACLException
*/
- protected String readACLOwner(String cid, Map<String, SortedSet<TempPropertyData>> properties) throws IllegalACLException
+ protected String readACLOwner(String cid, Map<String, SortedSet<TempPropertyData>> properties)
+ throws IllegalACLException
{
SortedSet<TempPropertyData> ownerValues = properties.get(Constants.EXO_OWNER.getAsString());
if (ownerValues != null)
@@ -431,7 +433,7 @@
return loadNodeRecord(parentPath, tempData.cname, tempData.cid, tempData.cpid, tempData.cindex,
tempData.cversion, tempData.cnordernumb, tempData.properties, parentACL);
}
-
+
/**
* Create a new node from the given parameter.
*/
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -58,7 +58,7 @@
/**
* The logger
*/
- private static final Log LOG = ExoLogger.getLogger(StatisticsJDBCStorageConnection.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.StatisticsJDBCStorageConnection");
/**
* The description of the statistics corresponding to the method
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/update/StorageUpdateManager.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -44,7 +44,7 @@
public class StorageUpdateManager
{
- protected static Log log = ExoLogger.getLogger("jcr.StorageUpdateManager");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.StorageUpdateManager");
public static final String STORAGE_VERSION_1_0_0 = "1.0";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/StandaloneStoragePluginProvider.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -53,7 +53,7 @@
private static final long serialVersionUID = 4537116106932443262L;
- private static Log log = ExoLogger.getLogger("jcr.ValueStoragePluginFactory");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.StandaloneStoragePluginProvider");
/**
* ValueData resorces holder (Files etc). It's singleton feature.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/cas/JDBCValueContentAddressStorageImpl.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -77,7 +77,7 @@
/**
* LOG.
*/
- private static final Log LOG = ExoLogger.getLogger("jcr.JDBCValueContentAddressStorageImpl");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.JDBCValueContentAddressStorageImpl");
/**
* MYSQL_PK_CONSTRAINT_DETECT_PATTERN.
@@ -88,8 +88,8 @@
/**
* MYSQL_PK_CONSTRAINT_DETECT.
*/
- private static final Pattern MYSQL_PK_CONSTRAINT_DETECT = Pattern.compile(MYSQL_PK_CONSTRAINT_DETECT_PATTERN,
- Pattern.CASE_INSENSITIVE);
+ private static final Pattern MYSQL_PK_CONSTRAINT_DETECT =
+ Pattern.compile(MYSQL_PK_CONSTRAINT_DETECT_PATTERN, Pattern.CASE_INSENSITIVE);
/**
* DB2_PK_CONSTRAINT_DETECT_PATTERN.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableIOSupport.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -40,7 +40,7 @@
public class CASableIOSupport
{
- private static Log LOG = ExoLogger.getLogger("jcr.CASeableIOSupport");
+ private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CASeableIOSupport");
public static final int HASHFILE_ORDERNUMBER = 0;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableSimpleFileIOChannel.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -42,7 +42,7 @@
public class CASableSimpleFileIOChannel extends SimpleFileIOChannel
{
- static private final Log LOG = ExoLogger.getLogger("jcr.CASableSimpleFileIOChannel");
+ static private final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CASableSimpleFileIOChannel");
private final CASableIOSupport cas;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/CASableTreeFileIOChannel.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -41,7 +41,7 @@
public class CASableTreeFileIOChannel extends TreeFileIOChannel
{
- static private final Log LOG = ExoLogger.getLogger("jcr.CASableTreeFileIOChannel");
+ static private final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.CASableTreeFileIOChannel");
private final ValueContentAddressStorage vcas;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileIOChannel.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -46,7 +46,7 @@
/**
* Logger.
*/
- private static Log LOG = ExoLogger.getLogger("jcr.FileIOChannel");
+ private static Log LOG = ExoLogger.getLogger("exo.jcr.component.core.FileIOChannel");
/**
* Temporary directory. Used for I/O transaction operations and locks.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/FileValueStorage.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -40,7 +40,7 @@
public abstract class FileValueStorage extends ValueStoragePlugin
{
- private Log log = ExoLogger.getLogger("jcr.FileValueStorage");
+ private Log log = ExoLogger.getLogger("exo.jcr.component.core.FileValueStorage");
public final static String PATH = "path";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -36,7 +36,7 @@
{
/** Files log */
- private static Log fLog = ExoLogger.getLogger("jcr.TreeFile");
+ private static Log fLog = ExoLogger.getLogger("exo.jcr.component.core.TreeFile");
private static final long serialVersionUID = 5125295927077006487L;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileIOHelper.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -57,7 +57,7 @@
/**
* Helper logger.
*/
- protected static final Log LOG = ExoLogger.getLogger("jcr.ValueFileIOHelper");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ValueFileIOHelper");
/**
* Read value from file.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/operations/ValueFileOperation.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -56,7 +56,7 @@
/**
* Logger.
*/
- protected static final Log LOG = ExoLogger.getLogger("jcr.ValueFileOperation");
+ protected static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ValueFileOperation");
/**
* File cleaner.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/StringConverter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/StringConverter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/StringConverter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -41,7 +41,7 @@
private static final int ENCODE_CHARS = 7;
- private static Log log = ExoLogger.getLogger("jcr.StringConverter");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.StringConverter");
private static class DNChar
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/FileCleaner.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -38,7 +38,7 @@
protected static final long DEFAULT_TIMEOUT = 30000;
- protected static Log log = ExoLogger.getLogger("jcr.FileCleaner");
+ protected static Log log = ExoLogger.getLogger("exo.jcr.component.core.FileCleaner");
protected Set<File> files = new LinkedHashSet<File>();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/SpoolFile.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/SpoolFile.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/io/SpoolFile.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -51,7 +51,7 @@
public class SpoolFile extends File
{
- private static Log log = ExoLogger.getLogger("jcr.SpoolFile");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.SpoolFile");
protected Map<Object, Long> users = new WeakHashMap<Object, Long>();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/VersionHistoryRemover.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -51,7 +51,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.VersionHistoryRemover");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.VersionHistoryRemover");
/**
* Version history identifier.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/WorkspaceSystemViewStreamExporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/WorkspaceSystemViewStreamExporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/exporting/WorkspaceSystemViewStreamExporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -48,7 +48,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.WorkspaceSystemViewStreamExporter");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.WorkspaceSystemViewStreamExporter");
public WorkspaceSystemViewStreamExporter(XMLStreamWriter writer, ItemDataConsumer dataManager,
NamespaceRegistry namespaceRegistry, ValueFactoryImpl systemValueFactory, boolean skipBinary, boolean noRecurse)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -81,7 +81,7 @@
/**
*
*/
- private static Log log = ExoLogger.getLogger("jcr.DocNodeImporter");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.DocumentViewImporter");
/**
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/StreamImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/StreamImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/StreamImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -56,7 +56,7 @@
public class StreamImporter implements RawDataImporter
{
- private final Log log = ExoLogger.getLogger("jcr.StreamImporter");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.StreamImporter");
private final ContentImporter importer;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/SystemViewImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -71,7 +71,7 @@
/**
*
*/
- private static Log log = ExoLogger.getLogger(SystemViewImporter.class);
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.SystemViewImporter");
protected PropertyInfo propertyInfo = new PropertyInfo();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceContentImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -52,7 +52,7 @@
/**
* Class logger.
*/
- protected final Log log = ExoLogger.getLogger("jcr.WorkspaceContentImporter");
+ protected final Log log = ExoLogger.getLogger("exo.jcr.component.core.WorkspaceContentImporter");
/**
* The flag indicates whether a verified that the first element is the root.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceDataImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceDataImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceDataImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -44,7 +44,7 @@
*/
public class WorkspaceDataImporter extends StreamImporter
{
- private final Log log = ExoLogger.getLogger("jcr.WorkspaceDataImporter");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.WorkspaceDataImporter");
public WorkspaceDataImporter(NodeData parent, int uuidBehavior, ItemDataKeeper dataKeeper,
ItemDataConsumer dataConsumer, NodeTypeDataManager ntManager, LocationFactory locationFactory,
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceRestoreContentImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceRestoreContentImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/WorkspaceRestoreContentImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -50,7 +50,7 @@
public class WorkspaceRestoreContentImporter extends WorkspaceContentImporter
{
- protected final Log log = ExoLogger.getLogger("jcr.WorkspaceRestoreContentImporter");
+ protected final Log log = ExoLogger.getLogger("exo.jcr.component.core.WorkspaceRestoreContentImporter");
/**
* Class used to import content of workspace, using "System View XML Mapping",
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -42,7 +42,7 @@
/**
*
*/
- private static Log log = ExoLogger.getLogger("jcr.ImportedNodeData");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ImportNodeData");
/**
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportPropertyData.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -38,7 +38,7 @@
/**
* Logger.
*/
- private static Log log = ExoLogger.getLogger("jcr.ImportedPropertyData");
+ private static Log log = ExoLogger.getLogger("exo.jcr.component.core.ImportPropertyData");
/**
* Default constructor.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/PropertyInfo.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/PropertyInfo.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/PropertyInfo.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -37,7 +37,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.PropertyInfo");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.PropertyInfo");
/**
*
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -64,7 +64,7 @@
private ConfigurationManager configurationManager;
- private final Log log = ExoLogger.getLogger(ExoJBossCacheFactory.class);
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ExoJBossCacheFactory");
/**
* Creates ExoJbossCacheFactory with provided configuration transaction managers.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/observation/ExtendedEventType.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/observation/ExtendedEventType.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/observation/ExtendedEventType.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -34,7 +34,7 @@
/**
* Class logger.
*/
- private final Log log = ExoLogger.getLogger("jcr.ExtendedEventType");
+ private final Log log = ExoLogger.getLogger("exo.jcr.component.core.ExtendedEventType");
public static final String NODE_ADDED = "Node is added";
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/ConfigurationFormat.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -34,7 +34,7 @@
public class ConfigurationFormat
{
- private static final Log LOG = ExoLogger.getLogger("jcr.ConfigurationFormat");
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.ConfigurationFormat");
public static int parseInt(String text)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/VersionHistoryImporter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/VersionHistoryImporter.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/util/VersionHistoryImporter.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -55,7 +55,7 @@
/**
* Class logger.
*/
- private static final Log LOG = ExoLogger.getLogger(VersionHistoryImporter.class);
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.VersionHistoryImporter");
/**
* Versioned node.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java 2010-03-25 15:51:39 UTC (rev 2139)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java 2010-03-25 15:56:25 UTC (rev 2140)
@@ -46,8 +46,8 @@
/**
* The logger
*/
- private static final Log LOG = ExoLogger.getLogger(GenericTransactionService.class);
-
+ private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.core.GenericTransactionService");
+
/**
* The default value of a transaction timeout in seconds
*/
@@ -236,7 +236,7 @@
* The default timeout of the {@link Transaction}
*/
private final int defaultTimeout;
-
+
/**
* This is used to know if a timeout has already been set for the next transaction
*/
@@ -268,7 +268,7 @@
catch (Exception e)
{
LOG.warn("Cannot set the transaction timeout", e);
- }
+ }
}
// Start the transaction
tm.begin();
14 years, 2 months
exo-jcr SVN: r2139 - in jcr/trunk/exo.jcr.component.ext: src/main/java/org/exoplatform/services/jcr/ext/backup/server and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-25 11:51:39 -0400 (Thu, 25 Mar 2010)
New Revision: 2139
Modified:
jcr/trunk/exo.jcr.component.ext/pom.xml
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java
Log:
EXOJCR-549: fix bugs
Modified: jcr/trunk/exo.jcr.component.ext/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.ext/pom.xml 2010-03-25 15:44:18 UTC (rev 2138)
+++ jcr/trunk/exo.jcr.component.ext/pom.xml 2010-03-25 15:51:39 UTC (rev 2139)
@@ -174,13 +174,14 @@
<include>**/replication/*.java</include>
<include>**/replication/external/*.java</include>
<include>**/replication/async/**/*.java</include>
+ <include>**/**/HTTPBackupAgentTest.java</include>
</includes>
<excludes>
<exclude>**/BaseStandaloneTest.java</exclude>
<exclude>**/replication/*.java</exclude>
<exclude>**/replication/external/*.java</exclude>
<exclude>**/replication/external/BaseTestCaseChecker.java</exclude>
- <exclude>**/backup/*.java</exclude>
+ <!--exclude>**/backup/*.java</exclude-->
<exclude>**/access/*.java</exclude>
<exclude>**/LocalStorageMultithreadTest.java</exclude>
</excludes>
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-03-25 15:44:18 UTC (rev 2138)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-03-25 15:51:39 UTC (rev 2139)
@@ -114,6 +114,11 @@
public static final String RESTORE = "/restore";
/**
+ * Restore repository operations.
+ */
+ public static final String RESTORE_REPOSITORY = "/restore-repository";
+
+ /**
* Stop backup operations.
*/
public static final String STOP_BACKUP = "/stop";
@@ -190,6 +195,11 @@
public static final String GET_DEFAULT_WORKSPACE_CONFIG = "/info/default-ws-config";
/**
+ * The get default repository configuration.
+ */
+ public static final String GET_DEFAULT_REPOSITORY_CONFIG = "/info/default-repository-config";
+
+ /**
* OperationType constructor.
*/
private OperationType()
@@ -1450,6 +1460,28 @@
}
/**
+ * Will be returned the default repository configuration.
+ *
+ * @return Response return the JSON to WorkspaceEntry
+ */
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @RolesAllowed("administrators")
+ @Path("/info/default-repository-config")
+ public Response getDefaultRepositoryConfig()
+ {
+ try
+ {
+ return Response.ok(repositoryService.getDefaultRepository().getConfiguration()).cacheControl(noCache).build();
+ }
+ catch (Throwable e)
+ {
+ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(
+ "Can not get default workspace configuration.").type(MediaType.TEXT_PLAIN).cacheControl(noCache).build();
+ }
+ }
+
+ /**
* validateRepositoryName.
*
* @param repositoryName
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java 2010-03-25 15:44:18 UTC (rev 2138)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgentTest.java 2010-03-25 15:51:39 UTC (rev 2139)
@@ -20,6 +20,7 @@
import org.exoplatform.services.jcr.config.ContainerEntry;
import org.exoplatform.services.jcr.config.QueryHandlerEntry;
+import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.ext.BaseStandaloneTest;
@@ -192,76 +193,75 @@
{
// login to workspace '/db6/ws2'
// Start repository backup
- {
- Session session_db6_ws2 = repositoryService.getRepository("db6").login(credentials, "ws2");
- assertNotNull(session_db6_ws2);
- session_db6_ws2.getRootNode().addNode("NODE_NAME_TO_TEST");
- session_db6_ws2.save();
+ Session session_db6_ws2 = repositoryService.getRepository("db6").login(credentials, "ws2");
+ assertNotNull(session_db6_ws2);
- File f = new File("target/temp/backup/" + System.currentTimeMillis());
- f.mkdirs();
+ session_db6_ws2.getRootNode().addNode("NODE_NAME_TO_TEST");
+ session_db6_ws2.save();
- BackupConfigBean configBean = new BackupConfigBean(BackupManager.FULL_AND_INCREMENTAL, f.getPath(), 10000l);
+ File f = new File("target/temp/backup/" + System.currentTimeMillis());
+ f.mkdirs();
- JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
- JsonValue json = generatorImpl.createJsonObject(configBean);
+ BackupConfigBean configBean = new BackupConfigBean(BackupManager.FULL_AND_INCREMENTAL, f.getPath(), 10000l);
- MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
- headers.putSingle("Content-Type", "application/json; charset=UTF-8");
- ContainerRequestUserRole creq =
- new ContainerRequestUserRole("POST", new URI(HTTP_BACKUP_AGENT_PATH
- + HTTPBackupAgent.Constants.OperationType.START_BACKUP + "/db6"), new URI(""), new ByteArrayInputStream(
- json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));
+ JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
+ JsonValue json = generatorImpl.createJsonObject(configBean);
- ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
- ContainerResponse cres = new ContainerResponse(responseWriter);
- handler.handleRequest(creq, cres);
-
- assertEquals(200, cres.getStatus());
-
- Thread.sleep(10000);
- }
-
- // Get repository backup id for backup on workspace /db6/ws2
- String id = null;
-
- {
- MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
- ContainerRequestUserRole creq =
- new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
- + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""), null,
- new InputHeadersMap(headers));
-
- ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
- ContainerResponse cres = new ContainerResponse(responseWriter);
- handler.handleRequest(creq, cres);
-
- assertEquals(200, cres.getStatus());
-
- ShortInfoList infoList = (ShortInfoList)getObject(ShortInfoList.class, responseWriter.getBody());
- List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());
-
- assertEquals(1, list.size());
-
- ShortInfo info = list.get(0);
-
- assertEquals(info.getRepositoryName(), "db6");
-
- id = info.getBackupId();
- }
-
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.putSingle("Content-Type", "application/json; charset=UTF-8");
ContainerRequestUserRole creq =
- new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
- + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP_REPOSITORY + "/" + id), new URI(""), null,
- new InputHeadersMap(headers));
+ new ContainerRequestUserRole("POST", new URI(HTTP_BACKUP_AGENT_PATH
+ + HTTPBackupAgent.Constants.OperationType.START_BACKUP + "/db6"), new URI(""), new ByteArrayInputStream(
+ json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));
ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
ContainerResponse cres = new ContainerResponse(responseWriter);
handler.handleRequest(creq, cres);
assertEquals(200, cres.getStatus());
+
+ Thread.sleep(10000);
+
+ // // Get repository backup id for backup on workspace /db6/ws2
+ // String id = null;
+ //
+ // {
+ // MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ // ContainerRequestUserRole creq =
+ // new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
+ // + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""), null,
+ // new InputHeadersMap(headers));
+ //
+ // ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
+ // ContainerResponse cres = new ContainerResponse(responseWriter);
+ // handler.handleRequest(creq, cres);
+ //
+ // assertEquals(200, cres.getStatus());
+ //
+ // ShortInfoList infoList = (ShortInfoList)getObject(ShortInfoList.class, responseWriter.getBody());
+ // List<ShortInfo> list = new ArrayList<ShortInfo>(infoList.getBackups());
+ //
+ // assertEquals(1, list.size());
+ //
+ // ShortInfo info = list.get(0);
+ //
+ // assertEquals(info.getRepositoryName(), "db6");
+ //
+ // id = info.getBackupId();
+ // }
+ //
+ // MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ // ContainerRequestUserRole creq =
+ // new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
+ // + HTTPBackupAgent.Constants.OperationType.STOP_BACKUP_REPOSITORY + "/" + id), new URI(""), null,
+ // new InputHeadersMap(headers));
+ //
+ // ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
+ // ContainerResponse cres = new ContainerResponse(responseWriter);
+ // handler.handleRequest(creq, cres);
+ //
+ // assertEquals(200, cres.getStatus());
}
public void testInfoBackup() throws Exception
@@ -769,7 +769,7 @@
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
ContainerRequestUserRole creq =
new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
- + HTTPBackupAgent.Constants.OperationType.COMPLETED_BACKUPS_REPOSITORY_INFO), new URI(""), null,
+ + HTTPBackupAgent.Constants.OperationType.CURRENT_BACKUPS_REPOSITORY_INFO), new URI(""), null,
new InputHeadersMap(headers));
ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
@@ -786,13 +786,29 @@
ShortInfo info = list.get(0);
assertEquals(info.getRepositoryName(), "db6");
- assertEquals(info.getWorkspaceName(), "ws2");
id = info.getBackupId();
}
+ // Getting default RepositoryEntry
+ RepositoryEntry defREntry;
+ {
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ ContainerRequestUserRole creq =
+ new ContainerRequestUserRole("GET", new URI(HTTP_BACKUP_AGENT_PATH
+ + HTTPBackupAgent.Constants.OperationType.GET_DEFAULT_REPOSITORY_CONFIG), new URI(""), null,
+ new InputHeadersMap(headers));
+
+ ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
+ ContainerResponse cres = new ContainerResponse(responseWriter);
+ handler.handleRequest(creq, cres);
+
+ assertEquals(200, cres.getStatus());
+ defREntry = (RepositoryEntry)getObject(RepositoryEntry.class, responseWriter.getBody());
+ }
+
// Getting default WorkspaceEntry
- WorkspaceEntry defEntry;
+ WorkspaceEntry defWEntry;
{
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
ContainerRequestUserRole creq =
@@ -805,16 +821,18 @@
handler.handleRequest(creq, cres);
assertEquals(200, cres.getStatus());
- defEntry = (WorkspaceEntry)getObject(WorkspaceEntry.class, responseWriter.getBody());
+ defWEntry = (WorkspaceEntry)getObject(WorkspaceEntry.class, responseWriter.getBody());
}
- WorkspaceEntry wEntry = makeWorkspaceEntry(defEntry, "db6", "ws3", "jdbcjcr24");
+ ArrayList<WorkspaceEntry> wsEntries = new ArrayList<WorkspaceEntry>();
+ wsEntries.add(makeWorkspaceEntry(defWEntry, "db7", "ws1", "jdbcjcr24"));
+ wsEntries.add(makeWorkspaceEntry(defWEntry, "db7", "ws2", "jdbcjcr24"));
+ RepositoryEntry rEntry = makeRepositoryEntry(defREntry, "db7", wsEntries);
// Check the workspace /db6/ws3 not exists.
try
{
- Session sessin_ws3 = repositoryService.getRepository("db6").login(credentials, "ws3");
- fail("The workspace /db6/ws3 should not exists.");
+ repositoryService.getRepository("db7");
}
catch (Exception e)
{
@@ -825,14 +843,14 @@
{
// Create JSON to WorkspaceEntry
JsonGeneratorImpl generatorImpl = new JsonGeneratorImpl();
- JsonValue json = generatorImpl.createJsonObject(wEntry);
+ JsonValue json = generatorImpl.createJsonObject(rEntry);
// Execute restore
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.putSingle("Content-Type", "application/json; charset=UTF-8");
ContainerRequestUserRole creq =
new ContainerRequestUserRole("POST", new URI(HTTP_BACKUP_AGENT_PATH
- + HTTPBackupAgent.Constants.OperationType.RESTORE + "/" + "db6" + "/" + id), new URI(""),
+ + HTTPBackupAgent.Constants.OperationType.RESTORE_REPOSITORY + "/" + id), new URI(""),
new ByteArrayInputStream(json.toString().getBytes("UTF-8")), new InputHeadersMap(headers));
ByteArrayContainerResponseWriter responseWriter = new ByteArrayContainerResponseWriter();
@@ -952,6 +970,22 @@
return ws1back;
}
+ protected RepositoryEntry makeRepositoryEntry(RepositoryEntry defREntry, String repoName,
+ ArrayList<WorkspaceEntry> wsEntries)
+ {
+ RepositoryEntry rEntry = new RepositoryEntry();
+ rEntry.setAccessControl(defREntry.getAccessControl());
+ rEntry.setAuthenticationPolicy(defREntry.getAuthenticationPolicy());
+ rEntry.setDefaultWorkspaceName(defREntry.getDefaultWorkspaceName());
+ rEntry.setName(repoName);
+ rEntry.setSecurityDomain(defREntry.getSecurityDomain());
+ rEntry.setSessionTimeOut(defREntry.getSessionTimeOut());
+ rEntry.setSystemWorkspaceName(defREntry.getSystemWorkspaceName());
+ rEntry.setWorkspaceEntries(wsEntries);
+
+ return rEntry;
+ }
+
/**
* Will be created the Object from JSON binary data.
*
14 years, 2 months