You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2010/09/10 15:20:27 UTC

svn commit: r995786 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java

Author: gtully
Date: Fri Sep 10 13:20:27 2010
New Revision: 995786

URL: http://svn.apache.org/viewvc?rev=995786&view=rev
Log:
add missing class for:  https://issues.apache.org/activemq/browse/AMQ-2880 

Added:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java   (with props)

Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java?rev=995786&view=auto
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java (added)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java Fri Sep 10 13:20:27 2010
@@ -0,0 +1,47 @@
+/**
+ * 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.apache.activemq.store.jdbc;
+
+import java.io.IOException;
+
+import org.apache.activemq.broker.ConnectionContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+class BrokenPersistenceAdapter extends JDBCPersistenceAdapter {
+
+    private final Log LOG = LogFactory.getLog(BrokenPersistenceAdapter.class);
+
+    private boolean shouldBreak = false;
+
+    @Override
+    public void commitTransaction(ConnectionContext context) throws IOException {
+        if ( shouldBreak ) {
+            LOG.warn("Throwing exception on purpose");
+            throw new IOException("Breaking on purpose");
+        }
+        LOG.debug("in commitTransaction");
+        super.commitTransaction(context);
+    }
+
+    public void setShouldBreak(boolean shouldBreak) {
+        this.shouldBreak = shouldBreak;
+    }
+}
+

Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/jdbc/BrokenPersistenceAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date