Elffuss BraidHub

kikocis/java-driver public

Merge pull request #635 from datastax/java1133

JAVA-1133: Add OSGi headers to cassandra-driver-extras.
Changesetae86723b0d851a7b832472777caaddf1e05d1f9e2c190fbd508023244b560495
AuthorOlivier Michallat <olim7t@users.noreply.github.com> · 2016-04-26 16:11 +02:00
CommitterOlivier Michallat <olim7t@users.noreply.github.com> · 2016-04-26 16:11 +02:00
Parentsced5ba920359, 28340c9afa42

Browse the files at this changeset

21 files changed

modified changelog/README.md +1 −0
@@ -15,6 +15,7 @@
1515 - [improvement] JAVA-1113: Support Cassandra 3.4 LIKE operator in QueryBuilder.
1616 - [improvement] JAVA-1086: Support Cassandra 3.2 CAST function in QueryBuilder.
1717 - [bug] JAVA-1095: Check protocol version for custom payload before sending the query.
18+- [improvement] JAVA-1133: Add OSGi headers to cassandra-driver-extras.
1819
1920 Merged from 2.1 branch:
2021
modified driver-core/pom.xml +15 −1
@@ -136,6 +136,20 @@
136136 <scope>test</scope>
137137 </dependency>
138138
139+ <dependency>
140+ <groupId>log4j</groupId>
141+ <artifactId>log4j</artifactId>
142+ <version>${log4j.version}</version>
143+ <scope>test</scope>
144+ </dependency>
145+
146+ <dependency>
147+ <groupId>org.slf4j</groupId>
148+ <artifactId>slf4j-log4j12</artifactId>
149+ <version>${slf4j-log4j12.version}</version>
150+ <scope>test</scope>
151+ </dependency>
152+
139153 </dependencies>
140154
141155 <build>
@@ -173,7 +187,7 @@
173187 <Bundle-SymbolicName>com.datastax.driver.core</Bundle-SymbolicName>
174188 <Bundle-Version>${project.version}</Bundle-Version>
175189 <_include>-osgi.bnd</_include>
176- <Import-Package><![CDATA[com.google.common*;version="[16.0.1,19)",*]]></Import-Package>
190+ <Import-Package><![CDATA[com.google.common*;version="[16.0.1,20)",*]]></Import-Package>
177191 </instructions>
178192 <supportedProjectTypes>
179193 <supportedProjectType>jar</supportedProjectType>
modified driver-examples/osgi/README.md +14 −9
@@ -3,28 +3,33 @@
33 A simple example application that demonstrates using the Java Driver in
44 an OSGi service.
55
6-MailboxService is an activated service that uses Cassandra to
7-persist a Mailbox by email address.
6+`MailboxService` is an OSGi service that uses Cassandra to
7+store messages that can be retrieved by email address.
88
99 ## Usage
1010
11-To build the bundle and run tests execute the following maven task::
11+To build the bundle and run tests, execute the following Maven goal:
1212
13- mvn integration-test -P short
13+ mvn verify -P short
1414
15-The short profile needs to be activated since the tests run under
15+The "short" profile needs to be activated since the tests run under
1616 this group.
1717
18-After which the bundle jar will be present in the target/ directory.
18+Note: tests will try to load the jars of 3 dependent modules:
19+`driver-core`, `driver-mapping` and `driver-extras`.
20+For this to succeed, you need to run `mvn package`
21+first for these modules and make sure the jars are present
22+in each module's `target/` subdirectory.
1923
20-The project includes an integration test that verifies the service can
24+Once `mvn verify` completes, the bundle jar will be present in the `target/` directory.
25+
26+The project includes integration tests that verify the service can
2127 be activated and used in an OSGi container. It also verifies that
2228 driver-core can be used in an OSGi container in the following
2329 configurations:
2430
2531 1. Default (default classifier with all dependencies)
2632 2. Netty-Shaded (shaded classifier with all depedencies w/o Netty)
27-3. Guava 15 (default classifier with Guava 15.0)
28-4. Guava 16
2933 5. Guava 17
3034 6. Guava 18
35+7. Guava 19
modified driver-examples/osgi/pom.xml +71 −28
@@ -23,6 +23,7 @@
2323 <artifactId>cassandra-driver-examples-parent</artifactId>
2424 <version>3.0.1-SNAPSHOT</version>
2525 </parent>
26+
2627 <artifactId>cassandra-driver-examples-osgi</artifactId>
2728 <packaging>bundle</packaging>
2829 <name>DataStax Java Driver for Apache Cassandra Examples - OSGi</name>
@@ -30,19 +31,41 @@
3031 <url>https://github.com/datastax/java-driver</url>
3132
3233 <properties>
34+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
3335 <felix.version>4.6.0</felix.version>
36+ <!-- more recent version require JDK7+ -->
3437 <pax-exam.version>3.6.0</pax-exam.version>
3538 <logback.version>1.1.3</logback.version>
39+ <test.groups>none</test.groups>
40+ <!--
41+ Skip tests by default, short or long profile is required to run tests in this module
42+ since pax-exam will throw exception if it encounters a
43+ test with no matching methods.
44+ -->
45+ <test.skip>true</test.skip>
3646 <main.basedir>${project.parent.parent.basedir}</main.basedir>
3747 </properties>
3848
3949 <dependencies>
50+
4051 <dependency>
4152 <groupId>com.datastax.cassandra</groupId>
4253 <artifactId>cassandra-driver-core</artifactId>
4354 <version>${project.parent.version}</version>
4455 </dependency>
4556
57+ <dependency>
58+ <groupId>com.datastax.cassandra</groupId>
59+ <artifactId>cassandra-driver-mapping</artifactId>
60+ <version>${project.parent.version}</version>
61+ </dependency>
62+
63+ <dependency>
64+ <groupId>com.datastax.cassandra</groupId>
65+ <artifactId>cassandra-driver-extras</artifactId>
66+ <version>${project.parent.version}</version>
67+ </dependency>
68+
4669 <dependency>
4770 <groupId>org.apache.felix</groupId>
4871 <artifactId>org.apache.felix.framework</artifactId>
@@ -131,16 +154,46 @@
131154 <artifactId>logback-core</artifactId>
132155 <version>${logback.version}</version>
133156 </dependency>
157+
134158 </dependencies>
135159
136160 <build>
161+
137162 <plugins>
163+
164+ <!--
165+ this project has no unit tests;
166+ this plugin is declared just so that Maven properties
167+ get automatically passed to tests run with IntelliJ
168+ -->
169+ <plugin>
170+ <groupId>org.apache.maven.plugins</groupId>
171+ <artifactId>maven-surefire-plugin</artifactId>
172+ <version>2.18.1</version>
173+ <configuration>
174+ <skip>true</skip>
175+ <systemPropertyVariables>
176+ <cassandra.version>${cassandra.version}</cassandra.version>
177+ <ipprefix>${ipprefix}</ipprefix>
178+ </systemPropertyVariables>
179+ </configuration>
180+ </plugin>
181+
138182 <plugin>
139183 <groupId>org.apache.maven.plugins</groupId>
140184 <artifactId>maven-failsafe-plugin</artifactId>
141- <version>2.16</version>
185+ <version>2.18.1</version>
186+ <configuration>
187+ <skip>${test.skip}</skip>
188+ <groups>${test.groups}</groups>
189+ <systemPropertyVariables>
190+ <cassandra.version>${cassandra.version}</cassandra.version>
191+ <ipprefix>${ipprefix}</ipprefix>
192+ </systemPropertyVariables>
193+ </configuration>
142194 <executions>
143195 <execution>
196+ <id>default</id>
144197 <goals>
145198 <goal>integration-test</goal>
146199 <goal>verify</goal>
@@ -148,6 +201,7 @@
148201 </execution>
149202 </executions>
150203 </plugin>
204+
151205 <plugin>
152206 <groupId>org.apache.felix</groupId>
153207 <artifactId>maven-bundle-plugin</artifactId>
@@ -160,6 +214,7 @@
160214 <Export-Package>com.datastax.driver.osgi.api,!com.datastax.driver.osgi.impl</Export-Package>
161215 <Bundle-Activator>com.datastax.driver.osgi.impl.Activator</Bundle-Activator>
162216 <_include>-osgi.bnd</_include>
217+ <Import-Package><![CDATA[com.google.common*;version="[16.0.1,20)",*]]></Import-Package>
163218 </instructions>
164219 <supportedProjectTypes>
165220 <supportedProjectType>jar</supportedProjectType>
@@ -177,41 +232,29 @@
177232 </execution>
178233 </executions>
179234 </plugin>
235+
180236 </plugins>
237+
181238 </build>
182239
183240 <profiles>
241+
242+ <profile>
243+ <id>short</id>
244+ <properties>
245+ <test.groups>unit,short</test.groups>
246+ <test.skip>false</test.skip>
247+ </properties>
248+ </profile>
249+
184250 <profile>
185- <!-- Skip test by default, short or long is required to run unit tests since pax-exam will throw exception if it encounters a
186- test with no matching methods. -->
187- <id>default</id>
251+ <id>long</id>
188252 <properties>
189- <env>default</env>
253+ <test.groups>unit,short,long</test.groups>
254+ <test.skip>false</test.skip>
190255 </properties>
191- <activation>
192- <activeByDefault>true</activeByDefault>
193- </activation>
194- <build>
195- <plugins>
196- <plugin>
197- <groupId>org.apache.maven.plugins</groupId>
198- <artifactId>maven-surefire-plugin</artifactId>
199- <version>2.16</version>
200- <configuration>
201- <skip>true</skip>
202- </configuration>
203- </plugin>
204- <plugin>
205- <groupId>org.apache.maven.plugins</groupId>
206- <artifactId>maven-failsafe-plugin</artifactId>
207- <version>2.16</version>
208- <configuration>
209- <skip>true</skip>
210- </configuration>
211- </plugin>
212- </plugins>
213- </build>
214256 </profile>
257+
215258 </profiles>
216259
217260 <licenses>
modified driver-examples/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxMessage.java +59 −14
@@ -15,15 +15,41 @@
1515 */
1616 package com.datastax.driver.osgi.api;
1717
18-import java.util.Date;
18+import com.datastax.driver.extras.codecs.date.SimpleTimestampCodec;
19+import com.datastax.driver.mapping.annotations.ClusteringColumn;
20+import com.datastax.driver.mapping.annotations.Column;
21+import com.datastax.driver.mapping.annotations.PartitionKey;
22+import com.datastax.driver.mapping.annotations.Table;
23+import com.google.common.base.Objects;
1924
25+import static com.datastax.driver.osgi.api.MailboxMessage.TABLE;
26+
27+/**
28+ * A mailbox message entity mapped to the table <code>{@value #TABLE}</code>.
29+ */
30+@SuppressWarnings("unused")
31+@Table(name = TABLE)
2032 public class MailboxMessage {
33+
34+ public static final String TABLE = "mailbox";
35+
36+ @PartitionKey
2137 private String recipient;
22- private Date date;
38+
39+ @ClusteringColumn
40+ @Column(name = "time", codec = SimpleTimestampCodec.class)
41+ private long date;
42+
43+ @Column
2344 private String sender;
45+
46+ @Column
2447 private String body;
2548
26- public MailboxMessage(String recipient, Date date, String sender, String body) {
49+ public MailboxMessage() {
50+ }
51+
52+ public MailboxMessage(String recipient, long date, String sender, String body) {
2753 this.recipient = recipient;
2854 this.date = date;
2955 this.sender = sender;
@@ -34,28 +60,47 @@
3460 return recipient;
3561 }
3662
37- public Date getDate() {
63+ public void setRecipient(String recipient) {
64+ this.recipient = recipient;
65+ }
66+
67+ public long getDate() {
3868 return date;
3969 }
4070
71+ public void setDate(long date) {
72+ this.date = date;
73+ }
74+
4175 public String getSender() {
4276 return sender;
4377 }
4478
79+ public void setSender(String sender) {
80+ this.sender = sender;
81+ }
82+
4583 public String getBody() {
4684 return body;
4785 }
4886
87+ public void setBody(String body) {
88+ this.body = body;
89+ }
90+
91+ @Override
92+ public boolean equals(Object o) {
93+ if (this == o) return true;
94+ if (o == null || getClass() != o.getClass()) return false;
95+ MailboxMessage that = (MailboxMessage) o;
96+ return date == that.date &&
97+ Objects.equal(recipient, that.recipient) &&
98+ Objects.equal(sender, that.sender) &&
99+ Objects.equal(body, that.body);
100+ }
101+
49102 @Override
50- public boolean equals(Object that) {
51- if (that instanceof MailboxMessage) {
52- MailboxMessage thatM = (MailboxMessage) that;
53- return recipient.equals(thatM.getRecipient()) &&
54- date.equals(thatM.getDate()) &&
55- sender.equals(thatM.getSender()) &&
56- body.equals(thatM.getBody());
57- } else {
58- return false;
59- }
103+ public int hashCode() {
104+ return Objects.hashCode(recipient, date, sender, body);
60105 }
61106 }
modified driver-examples/osgi/src/main/java/com/datastax/driver/osgi/api/MailboxService.java +3 −6
@@ -15,9 +15,6 @@
1515 */
1616 package com.datastax.driver.osgi.api;
1717
18-import java.util.Collection;
19-import java.util.UUID;
20-
2118 public interface MailboxService {
2219
2320 /**
@@ -26,15 +23,15 @@
2623 * @param recipient User whose mailbox is being read.
2724 * @return All messages in the mailbox.
2825 */
29- public Collection<MailboxMessage> getMessages(String recipient) throws MailboxException;
26+ public Iterable<MailboxMessage> getMessages(String recipient) throws MailboxException;
3027
3128 /**
3229 * Stores the given message in the appropriate mailbox.
3330 *
3431 * @param message Message to send.
35- * @return UUID generated for the message.
32+ * @return The timestamp generated for the message (milliseconds since the Epoch).
3633 */
37- public UUID sendMessage(MailboxMessage message) throws MailboxException;
34+ public long sendMessage(MailboxMessage message) throws MailboxException;
3835
3936 /**
4037 * Deletes all mail for the given recipient.
modified driver-examples/osgi/src/main/java/com/datastax/driver/osgi/impl/Activator.java +40 −3
@@ -16,13 +16,19 @@
1616 package com.datastax.driver.osgi.impl;
1717
1818 import com.datastax.driver.core.Cluster;
19+import com.datastax.driver.core.CodecRegistry;
20+import com.datastax.driver.core.Metadata;
1921 import com.datastax.driver.core.Session;
22+import com.datastax.driver.core.exceptions.InvalidQueryException;
23+import com.datastax.driver.extras.codecs.date.SimpleTimestampCodec;
2024 import com.datastax.driver.osgi.api.MailboxService;
2125 import org.osgi.framework.BundleActivator;
2226 import org.osgi.framework.BundleContext;
2327
2428 import java.util.Hashtable;
2529
30+import static com.datastax.driver.osgi.api.MailboxMessage.TABLE;
31+
2632 public class Activator implements BundleActivator {
2733
2834 private Cluster cluster;
@@ -39,9 +45,29 @@
3945 if (keyspace == null) {
4046 keyspace = "mailbox";
4147 }
42-
43- cluster = Cluster.builder().addContactPoints(contactPoints).build();
44- Session session = cluster.connect();
48+ keyspace = Metadata.quote(keyspace);
49+
50+ cluster = Cluster.builder()
51+ .addContactPoints(contactPoints)
52+ .withCodecRegistry(new CodecRegistry().register(SimpleTimestampCodec.instance))
53+ .build();
54+
55+ Session session;
56+ try {
57+ session = cluster.connect(keyspace);
58+ } catch (InvalidQueryException e) {
59+ // Create the schema if it does not exist.
60+ session = cluster.connect();
61+ session.execute("CREATE KEYSPACE " + keyspace +
62+ " with replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}");
63+ session.execute("CREATE TABLE " + keyspace + "." + TABLE + " (" +
64+ "recipient text," +
65+ "time timestamp," +
66+ "sender text," +
67+ "body text," +
68+ "PRIMARY KEY (recipient, time))");
69+ session.execute("USE " + keyspace);
70+ }
4571
4672 MailboxImpl mailbox = new MailboxImpl(session, keyspace);
4773 mailbox.init();
@@ -53,6 +79,17 @@
5379 public void stop(BundleContext context) throws Exception {
5480 if (cluster != null) {
5581 cluster.close();
82+ /*
83+ Allow Netty ThreadDeathWatcher to terminate;
84+ unfortunately we can't explicitly call ThreadDeathWatcher.awaitInactivity()
85+ because Netty could be shaded.
86+ If this thread isn't terminated when this bundle is closed,
87+ we could get exceptions such as this one:
88+ Exception in thread "threadDeathWatcher-2-1" java.lang.NoClassDefFoundError: xxx
89+ Caused by: java.lang.ClassNotFoundException: Unable to load class 'xxx' because the bundle wiring for xxx is no longer valid.
90+ Although ugly, they are harmless and can be safely ignored.
91+ */
92+ Thread.sleep(1000);
5693 }
5794 }
5895 }
modified driver-examples/osgi/src/main/java/com/datastax/driver/osgi/impl/MailboxImpl.java +17 −56
@@ -15,24 +15,20 @@
1515 */
1616 package com.datastax.driver.osgi.impl;
1717
18-import com.datastax.driver.core.*;
19-import com.datastax.driver.core.exceptions.InvalidQueryException;
20-import com.datastax.driver.core.utils.UUIDs;
18+import com.datastax.driver.core.BoundStatement;
19+import com.datastax.driver.core.PreparedStatement;
20+import com.datastax.driver.core.Session;
21+import com.datastax.driver.mapping.Mapper;
22+import com.datastax.driver.mapping.MappingManager;
2123 import com.datastax.driver.osgi.api.MailboxException;
2224 import com.datastax.driver.osgi.api.MailboxMessage;
2325 import com.datastax.driver.osgi.api.MailboxService;
2426
25-import java.util.ArrayList;
26-import java.util.Collection;
27-import java.util.Date;
28-import java.util.UUID;
29-
3027 import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
28+import static com.datastax.driver.osgi.api.MailboxMessage.TABLE;
3129
3230 public class MailboxImpl implements MailboxService {
3331
34- private static final String TABLE = "mailbox";
35-
3632 private final Session session;
3733
3834 private final String keyspace;
@@ -41,10 +37,10 @@
4137
4238 private PreparedStatement retrieveStatement;
4339
44- private PreparedStatement insertStatement;
45-
4640 private PreparedStatement deleteStatement;
4741
42+ private Mapper<MailboxMessage> mapper;
43+
4844 public MailboxImpl(Session session, String keyspace) {
4945 this.session = session;
5046 this.keyspace = keyspace;
@@ -54,71 +50,36 @@
5450 if (initialized)
5551 return;
5652
57- // Create the schema if it does not exist.
58- try {
59- session.execute("USE " + keyspace);
60- } catch (InvalidQueryException e) {
61- session.execute("CREATE KEYSPACE " + keyspace +
62- " with replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}");
63-
64- session.execute("CREATE TABLE " + keyspace + "." + TABLE + " (" +
65- "recipient text," +
66- "time timeuuid," +
67- "sender text," +
68- "body text," +
69- "PRIMARY KEY (recipient, time))");
70- }
71-
7253 retrieveStatement = session.prepare(select()
7354 .from(keyspace, TABLE)
7455 .where(eq("recipient", bindMarker())));
7556
76- insertStatement = session.prepare(insertInto(keyspace, TABLE)
77- .value("recipient", bindMarker())
78- .value("time", bindMarker())
79- .value("sender", bindMarker())
80- .value("body", bindMarker()));
81-
8257 deleteStatement = session.prepare(delete().from(keyspace, TABLE)
8358 .where(eq("recipient", bindMarker())));
8459
60+ MappingManager mappingManager = new MappingManager(session);
61+
62+ mapper = mappingManager.mapper(MailboxMessage.class);
63+
8564 initialized = true;
8665 }
8766
8867 @Override
89- public Collection<MailboxMessage> getMessages(String recipient) throws MailboxException {
68+ public Iterable<MailboxMessage> getMessages(String recipient) throws MailboxException {
9069 try {
9170 BoundStatement statement = new BoundStatement(retrieveStatement);
9271 statement.setString(0, recipient);
93- ResultSet result = session.execute(statement);
94-
95- Collection<MailboxMessage> messages = new ArrayList<MailboxMessage>();
96- for (Row input : result) {
97- Date date = new Date(UUIDs.unixTimestamp(input.getUUID("time")));
98- messages.add(new MailboxMessage(input.getString("recipient"),
99- date,
100- input.getString("sender"),
101- input.getString("body")));
102- }
103- return messages;
72+ return mapper.map(session.execute(statement));
10473 } catch (Exception e) {
10574 throw new MailboxException(e);
10675 }
10776 }
10877
10978 @Override
110- public UUID sendMessage(MailboxMessage message) throws MailboxException {
79+ public long sendMessage(MailboxMessage message) throws MailboxException {
11180 try {
112- UUID time = UUIDs.startOf(message.getDate().getTime());
113-
114- BoundStatement statement = new BoundStatement(insertStatement);
115- statement.setString(0, message.getRecipient());
116- statement.setUUID(1, time);
117- statement.setString(2, message.getSender());
118- statement.setString(3, message.getBody());
119-
120- session.execute(statement);
121- return time;
81+ mapper.save(message);
82+ return message.getDate();
12283 } catch (Exception e) {
12384 throw new MailboxException(e);
12485 }
modified driver-examples/osgi/src/test/java/com/datastax/driver/osgi/BundleOptions.java +8 −0
@@ -36,6 +36,14 @@
3636 return bundle("reference:file:" + PathUtils.getBaseDir() + "/../../driver-core/target/cassandra-driver-core-" + projectVersion() + classifier + ".jar");
3737 }
3838
39+ public static UrlProvisionOption mappingBundle() {
40+ return bundle("reference:file:" + PathUtils.getBaseDir() + "/../../driver-mapping/target/cassandra-driver-mapping-" + projectVersion() + ".jar");
41+ }
42+
43+ public static UrlProvisionOption extrasBundle() {
44+ return bundle("reference:file:" + PathUtils.getBaseDir() + "/../../driver-extras/target/cassandra-driver-extras-" + projectVersion() + ".jar");
45+ }
46+
3947 public static MavenArtifactProvisionOption guavaBundle() {
4048 return mavenBundle("com.google.guava", "guava", "16.0.1");
4149 }
deleted driver-examples/osgi/src/test/java/com/datastax/driver/osgi/GuavaSanityCheckNegativeIT.java +0 −100
@@ -1,100 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.osgi;
17-
18-import com.datastax.driver.core.Cluster;
19-import org.ops4j.pax.exam.Configuration;
20-import org.ops4j.pax.exam.Option;
21-import org.ops4j.pax.exam.testng.listener.PaxExam;
22-import org.testng.annotations.Listeners;
23-import org.testng.annotations.Test;
24-
25-import static com.datastax.driver.osgi.BundleOptions.*;
26-import static org.ops4j.pax.exam.CoreOptions.options;
27-import static org.testng.Assert.assertTrue;
28-import static org.testng.Assert.fail;
29-
30-/**
31- * This test is no longer valid since the driver bundle has the following new requirement
32- * for Guava: {@code [16.0.1,19)}.
33- */
34-@Listeners({PaxExam.class})
35-@Test(groups = "short", enabled = false)
36-public class GuavaSanityCheckNegativeIT {
37-
38- @Configuration
39- public Option[] guava14_0_1Config() {
40- return options(
41- driverBundle(),
42- nettyBundles(),
43- guavaBundle().version("14.0.1"),
44- defaultOptions()
45- );
46- }
47-
48- @Configuration
49- public Option[] guava15Config() {
50- return options(
51- driverBundle(),
52- nettyBundles(),
53- guavaBundle().version("15.0"),
54- defaultOptions()
55- );
56- }
57-
58- @Configuration
59- public Option[] guava16Config() {
60- return options(
61- driverBundle(),
62- nettyBundles(),
63- guavaBundle().version("16.0"),
64- defaultOptions()
65- );
66- }
67-
68- /**
69- * <p>
70- * Validates that the driver is able to detect that the guava library in the classpath is
71- * less than version 16.01 and throws an {@link IllegalStateException} in this case and
72- * is raised as the cause of an {@link ExceptionInInitializerError} since the failure
73- * occurs at static initialization.
74- * </p>
75- * <p/>
76- * The following configurations are tried (defined via methods with the @Configuration annotation):
77- * <ol>
78- * <li>With Guava 14.0.1</li>
79- * <li>With Guava 15.0</li>
80- * <li>With Guava 16.0</li>
81- * </ol>
82- *
83- * @test_category packaging
84- * @expected_result An {@link IllegalStateException} is thrown.
85- * @jira_ticket JAVA-961
86- * @since 3.0.0-beta1
87- */
88- public void should_raise_guava_version_error_if_lt_16_0_1() throws Throwable {
89- try {
90- Cluster.builder();
91- fail("Expected an IllegalStateException for Guava version incompatibility");
92- } catch (ExceptionInInitializerError e) {
93- try {
94- throw e.getCause();
95- } catch (IllegalStateException ise) {
96- assertTrue(ise.getMessage().contains("Detected Guava issue #1635"));
97- }
98- }
99- }
100-}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceDefaultIT.java +57 −0
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import org.ops4j.pax.exam.Configuration;
20+import org.ops4j.pax.exam.Option;
21+import org.ops4j.pax.exam.testng.listener.PaxExam;
22+import org.testng.annotations.Listeners;
23+import org.testng.annotations.Test;
24+
25+import static com.datastax.driver.osgi.BundleOptions.*;
26+import static org.ops4j.pax.exam.CoreOptions.options;
27+
28+@Listeners({CCMBridgeListener.class, PaxExam.class})
29+public class MailboxServiceDefaultIT extends MailboxServiceTests {
30+
31+ @Configuration
32+ public Option[] defaultConfig() {
33+ return options(
34+ defaultOptions(),
35+ nettyBundles(),
36+ guavaBundle(),
37+ driverBundle(),
38+ extrasBundle(),
39+ mappingBundle(),
40+ mailboxBundle()
41+ );
42+ }
43+
44+ /**
45+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver with
46+ * default configuration (driver with all of its regular dependencies).
47+ *
48+ * @test_category packaging
49+ * @expected_result Can create, retrieve and delete data using the mailbox service.
50+ * @jira_ticket JAVA-620
51+ * @since 2.0.10, 2.1.5
52+ */
53+ @Test(groups = "short")
54+ public void test_default() throws MailboxException {
55+ checkService();
56+ }
57+}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava17IT.java +57 −0
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import org.ops4j.pax.exam.Configuration;
20+import org.ops4j.pax.exam.Option;
21+import org.ops4j.pax.exam.testng.listener.PaxExam;
22+import org.testng.annotations.Listeners;
23+import org.testng.annotations.Test;
24+
25+import static com.datastax.driver.osgi.BundleOptions.*;
26+import static org.ops4j.pax.exam.CoreOptions.options;
27+
28+@Listeners({CCMBridgeListener.class, PaxExam.class})
29+public class MailboxServiceGuava17IT extends MailboxServiceTests {
30+
31+ @Configuration
32+ public Option[] guava17Config() {
33+ return options(
34+ defaultOptions(),
35+ nettyBundles(),
36+ guavaBundle().version("17.0"),
37+ driverBundle(),
38+ mappingBundle(),
39+ extrasBundle(),
40+ mailboxBundle()
41+ );
42+ }
43+
44+ /**
45+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver with
46+ * Guava 17 explicitly enforced.
47+ *
48+ * @test_category packaging
49+ * @expected_result Can create, retrieve and delete data using the mailbox service.
50+ * @jira_ticket JAVA-620
51+ * @since 2.0.10, 2.1.5
52+ */
53+ @Test(groups = "short")
54+ public void test_guava_17() throws MailboxException {
55+ checkService();
56+ }
57+}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava18IT.java +57 −0
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import org.ops4j.pax.exam.Configuration;
20+import org.ops4j.pax.exam.Option;
21+import org.ops4j.pax.exam.testng.listener.PaxExam;
22+import org.testng.annotations.Listeners;
23+import org.testng.annotations.Test;
24+
25+import static com.datastax.driver.osgi.BundleOptions.*;
26+import static org.ops4j.pax.exam.CoreOptions.options;
27+
28+@Listeners({CCMBridgeListener.class, PaxExam.class})
29+public class MailboxServiceGuava18IT extends MailboxServiceTests {
30+
31+ @Configuration
32+ public Option[] guava18Config() {
33+ return options(
34+ defaultOptions(),
35+ nettyBundles(),
36+ guavaBundle().version("18.0"),
37+ driverBundle(),
38+ extrasBundle(),
39+ mappingBundle(),
40+ mailboxBundle()
41+ );
42+ }
43+
44+ /**
45+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver with
46+ * Guava 18 explicitly enforced.
47+ *
48+ * @test_category packaging
49+ * @expected_result Can create, retrieve and delete data using the mailbox service.
50+ * @jira_ticket JAVA-620
51+ * @since 2.0.10, 2.1.5
52+ */
53+ @Test(groups = "short")
54+ public void test_guava_18() throws MailboxException {
55+ checkService();
56+ }
57+}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceGuava19IT.java +57 −0
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import org.ops4j.pax.exam.Configuration;
20+import org.ops4j.pax.exam.Option;
21+import org.ops4j.pax.exam.testng.listener.PaxExam;
22+import org.testng.annotations.Listeners;
23+import org.testng.annotations.Test;
24+
25+import static com.datastax.driver.osgi.BundleOptions.*;
26+import static org.ops4j.pax.exam.CoreOptions.options;
27+
28+@Listeners({CCMBridgeListener.class, PaxExam.class})
29+public class MailboxServiceGuava19IT extends MailboxServiceTests {
30+
31+ @Configuration
32+ public Option[] guava19Config() {
33+ return options(
34+ defaultOptions(),
35+ nettyBundles(),
36+ guavaBundle().version("19.0"),
37+ driverBundle(),
38+ extrasBundle(),
39+ mappingBundle(),
40+ mailboxBundle()
41+ );
42+ }
43+
44+ /**
45+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver with
46+ * Guava 19 explicitly enforced.
47+ *
48+ * @test_category packaging
49+ * @expected_result Can create, retrieve and delete data using the mailbox service.
50+ * @jira_ticket JAVA-620
51+ * @since 2.0.10, 2.1.5
52+ */
53+ @Test(groups = "short")
54+ public void test_guava_19() throws MailboxException {
55+ checkService();
56+ }
57+}
deleted driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceIT.java +0 −124
@@ -1,124 +0,0 @@
1-/*
2- * Copyright (C) 2012-2015 DataStax Inc.
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package com.datastax.driver.osgi;
17-
18-import com.datastax.driver.osgi.api.MailboxException;
19-import com.datastax.driver.osgi.api.MailboxMessage;
20-import com.datastax.driver.osgi.api.MailboxService;
21-import org.ops4j.pax.exam.Configuration;
22-import org.ops4j.pax.exam.Option;
23-import org.ops4j.pax.exam.testng.listener.PaxExam;
24-import org.testng.annotations.Listeners;
25-import org.testng.annotations.Test;
26-
27-import javax.inject.Inject;
28-import java.util.ArrayList;
29-import java.util.Collection;
30-import java.util.GregorianCalendar;
31-
32-import static com.datastax.driver.osgi.BundleOptions.*;
33-import static org.ops4j.pax.exam.CoreOptions.options;
34-import static org.testng.Assert.assertEquals;
35-
36-@Listeners({CCMBridgeListener.class, PaxExam.class})
37-@Test(groups = "short")
38-public class MailboxServiceIT {
39- @Inject
40- MailboxService service;
41-
42- @Configuration
43- public Option[] shadedConfig() {
44- return options(
45- driverBundle(true),
46- mailboxBundle(),
47- guavaBundle(),
48- defaultOptions()
49- );
50- }
51-
52- @Configuration
53- public Option[] defaultConfig() {
54- return options(
55- driverBundle(),
56- mailboxBundle(),
57- guavaBundle(),
58- nettyBundles(),
59- defaultOptions()
60- );
61- }
62-
63- @Configuration
64- public Option[] guava17Config() {
65- return options(
66- driverBundle(),
67- mailboxBundle(),
68- nettyBundles(),
69- guavaBundle().version("17.0"),
70- defaultOptions()
71- );
72- }
73-
74- @Configuration
75- public Option[] guava18Config() {
76- return options(
77- driverBundle(),
78- mailboxBundle(),
79- nettyBundles(),
80- guavaBundle().version("18.0"),
81- defaultOptions()
82- );
83- }
84-
85- /**
86- * <p>
87- * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver. Ensures that
88- * queries can be made through the service with the current given configuration.
89- * </p>
90- * <p/>
91- * The following configurations are tried (defined via methods with the @Configuration annotation):
92- * <ol>
93- * <li>Default bundle (Driver with all of it's dependencies)</li>
94- * <li>Shaded bundle (Driver with netty shaded)</li>
95- * <li>With Guava 16.0.1</li>
96- * <li>With Guava 17</li>
97- * <li>With Guava 18</li>
98- * </ol>
99- *
100- * @test_category packaging
101- * @expected_result Can create, retrieve and delete data using the mailbox service.
102- * @jira_ticket JAVA-620
103- * @since 2.0.10, 2.1.5
104- */
105- public void service_api_functional() throws MailboxException {
106- // Insert some data into mailbox for a particular user.
107- String recipient = "user@datastax.com";
108-
109- try {
110- Collection<MailboxMessage> inMessages = new ArrayList<MailboxMessage>();
111- for (int i = 0; i < 30; i++) {
112- MailboxMessage message = new MailboxMessage(recipient, new GregorianCalendar(2015, 1, i).getTime(), recipient, "" + i);
113- inMessages.add(message);
114- service.sendMessage(message);
115- }
116-
117- Collection<MailboxMessage> messages = service.getMessages(recipient);
118-
119- assertEquals(messages, inMessages);
120- } finally {
121- service.clearMailbox(recipient);
122- }
123- }
124-}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceShadedIT.java +56 −0
@@ -0,0 +1,56 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import org.ops4j.pax.exam.Configuration;
20+import org.ops4j.pax.exam.Option;
21+import org.ops4j.pax.exam.testng.listener.PaxExam;
22+import org.testng.annotations.Listeners;
23+import org.testng.annotations.Test;
24+
25+import static com.datastax.driver.osgi.BundleOptions.*;
26+import static org.ops4j.pax.exam.CoreOptions.options;
27+
28+@Listeners({CCMBridgeListener.class, PaxExam.class})
29+public class MailboxServiceShadedIT extends MailboxServiceTests {
30+
31+ @Configuration
32+ public Option[] shadedConfig() {
33+ return options(
34+ defaultOptions(),
35+ guavaBundle(),
36+ extrasBundle(),
37+ mappingBundle(),
38+ driverBundle(true),
39+ mailboxBundle()
40+ );
41+ }
42+
43+ /**
44+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver with
45+ * shaded configuration (driver with Netty shaded).
46+ *
47+ * @test_category packaging
48+ * @expected_result Can create, retrieve and delete data using the mailbox service.
49+ * @jira_ticket JAVA-620
50+ * @since 2.0.10, 2.1.5
51+ */
52+ @Test(groups = "short")
53+ public void test_shaded() throws MailboxException {
54+ checkService();
55+ }
56+}
added driver-examples/osgi/src/test/java/com/datastax/driver/osgi/MailboxServiceTests.java +81 −0
@@ -0,0 +1,81 @@
1+/*
2+ * Copyright (C) 2012-2015 DataStax Inc.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package com.datastax.driver.osgi;
17+
18+import com.datastax.driver.osgi.api.MailboxException;
19+import com.datastax.driver.osgi.api.MailboxMessage;
20+import com.datastax.driver.osgi.api.MailboxService;
21+import org.osgi.framework.Bundle;
22+import org.osgi.framework.BundleContext;
23+import org.slf4j.Logger;
24+import org.slf4j.LoggerFactory;
25+
26+import javax.inject.Inject;
27+import java.util.ArrayList;
28+import java.util.Collection;
29+import java.util.GregorianCalendar;
30+
31+import static org.testng.Assert.assertEquals;
32+
33+public abstract class MailboxServiceTests {
34+
35+ private static final Logger LOGGER = LoggerFactory.getLogger(MailboxServiceTests.class);
36+
37+ @Inject
38+ MailboxService service;
39+
40+ @Inject
41+ BundleContext bundleContext;
42+
43+ /**
44+ * <p>
45+ * Exercises a 'mailbox' service provided by an OSGi bundle that depends on the driver. Ensures that
46+ * queries can be made through the service with the current given configuration.
47+ * </p>
48+ * <p/>
49+ * The following configurations are tried (defined via methods with the @Configuration annotation):
50+ * <ol>
51+ * <li>Default bundle (Driver with all of it's dependencies and Guava 16.0.1)</li>
52+ * <li>Shaded bundle (Driver with netty shaded and Guava 16.0.1)</li>
53+ * <li>With Guava 17</li>
54+ * <li>With Guava 18</li>
55+ * <li>With Guava 19</li>
56+ * </ol>
57+ */
58+ protected void checkService() throws MailboxException {
59+ if (LOGGER.isDebugEnabled()) {
60+ for (Bundle bundle : bundleContext.getBundles()) {
61+ LOGGER.debug("Loaded bundle: {} {}", bundle.getSymbolicName(), bundle.getVersion());
62+ }
63+ }
64+ // Insert some data into mailbox for a particular user.
65+ String recipient = "user@datastax.com";
66+ try {
67+ Collection<MailboxMessage> inMessages = new ArrayList<MailboxMessage>();
68+ for (int i = 0; i < 30; i++) {
69+ MailboxMessage message = new MailboxMessage(recipient, new GregorianCalendar(2015, 1, i).getTimeInMillis(), recipient, "" + i);
70+ inMessages.add(message);
71+ service.sendMessage(message);
72+ }
73+
74+ Iterable<MailboxMessage> messages = service.getMessages(recipient);
75+
76+ assertEquals(messages, inMessages);
77+ } finally {
78+ service.clearMailbox(recipient);
79+ }
80+ }
81+}
modified driver-examples/osgi/src/test/resources/logback.xml +26 −3
@@ -16,12 +16,35 @@
1616
1717 -->
1818 <configuration>
19+
1920 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
20- <layout class="ch.qos.logback.classic.PatternLayout">
21- <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
22- </layout>
21+ <encoder>
22+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
23+ </encoder>
2324 </appender>
25+
2426 <root level="INFO">
2527 <appender-ref ref="STDOUT"/>
2628 </root>
29+
30+ <!-- debug Pax Exam -->
31+ <!--<logger name="org.ops4j.pax" level="DEBUG" additivity="false">-->
32+ <!--<appender-ref ref="STDOUT"/>-->
33+ <!--</logger>-->
34+
35+ <!-- print loaded bundles -->
36+ <!--<logger name="com.datastax.driver.osgi.MailboxServiceTests" level="DEBUG" additivity="false">-->
37+ <!--<appender-ref ref="STDOUT"/>-->
38+ <!--</logger>-->
39+
40+ <!-- this guy is a bit too verbose -->
41+ <logger name="org.ops4j.pax.exam.nat.internal.NativeTestContainer" level="WARN" additivity="false">
42+ <appender-ref ref="STDOUT"/>
43+ </logger>
44+
45+ <!-- this one too -->
46+ <logger name="com.jcabi.manifests.Manifests" level="WARN" additivity="false">
47+ <appender-ref ref="STDOUT"/>
48+ </logger>
49+
2750 </configuration>
modified driver-extras/pom.xml +16 −1
@@ -24,7 +24,7 @@
2424 <modelVersion>4.0.0</modelVersion>
2525
2626 <artifactId>cassandra-driver-extras</artifactId>
27-
27+ <packaging>bundle</packaging>
2828 <name>DataStax Java Driver for Apache Cassandra - Extras</name>
2929 <description>Extended functionality for the Java driver.</description>
3030 <url>https://github.com/datastax/java-driver</url>
@@ -120,6 +120,20 @@
120120 <scope>test</scope>
121121 </dependency>
122122
123+ <dependency>
124+ <groupId>log4j</groupId>
125+ <artifactId>log4j</artifactId>
126+ <version>${log4j.version}</version>
127+ <scope>test</scope>
128+ </dependency>
129+
130+ <dependency>
131+ <groupId>org.slf4j</groupId>
132+ <artifactId>slf4j-log4j12</artifactId>
133+ <version>${slf4j-log4j12.version}</version>
134+ <scope>test</scope>
135+ </dependency>
136+
123137 </dependencies>
124138
125139 <build>
@@ -216,6 +230,7 @@
216230 <Bundle-SymbolicName>com.datastax.driver.extras</Bundle-SymbolicName>
217231 <Bundle-Version>${project.version}</Bundle-Version>
218232 <_include>-osgi.bnd</_include>
233+ <Import-Package><![CDATA[com.google.common*;version="[16.0.1,20)",*]]></Import-Package>
219234 </instructions>
220235 <supportedProjectTypes>
221236 <supportedProjectType>jar</supportedProjectType>
modified driver-mapping/pom.xml +16 −0
@@ -94,6 +94,21 @@
9494 <version>4.1</version>
9595 </dependency>
9696 -->
97+
98+ <dependency>
99+ <groupId>log4j</groupId>
100+ <artifactId>log4j</artifactId>
101+ <version>${log4j.version}</version>
102+ <scope>test</scope>
103+ </dependency>
104+
105+ <dependency>
106+ <groupId>org.slf4j</groupId>
107+ <artifactId>slf4j-log4j12</artifactId>
108+ <version>${slf4j-log4j12.version}</version>
109+ <scope>test</scope>
110+ </dependency>
111+
97112 </dependencies>
98113
99114 <build>
@@ -117,6 +132,7 @@
117132 <Bundle-SymbolicName>com.datastax.driver.mapping</Bundle-SymbolicName>
118133 <Bundle-Version>${project.version}</Bundle-Version>
119134 <_include>-osgi.bnd</_include>
135+ <Import-Package><![CDATA[com.google.common*;version="[16.0.1,20)",*]]></Import-Package>
120136 </instructions>
121137 <supportedProjectTypes>
122138 <supportedProjectType>jar</supportedProjectType>
modified pom.xml +0 −16
@@ -74,22 +74,6 @@
7474 <javadoc.opts/>
7575 </properties>
7676
77- <dependencies>
78- <dependency>
79- <groupId>log4j</groupId>
80- <artifactId>log4j</artifactId>
81- <version>${log4j.version}</version>
82- <scope>test</scope>
83- </dependency>
84-
85- <dependency>
86- <groupId>org.slf4j</groupId>
87- <artifactId>slf4j-log4j12</artifactId>
88- <version>${slf4j-log4j12.version}</version>
89- <scope>test</scope>
90- </dependency>
91- </dependencies>
92-
9377 <profiles>
9478 <profile>
9579 <id>default</id>