Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[build][core] removing scalacheck, adding context

  • Loading branch information...
commit df9d43447813c028ec07d765bc05e2c58d7df131 1 parent fad73d7
@florianleibert florianleibert authored
Showing with 10 additions and 33 deletions.
  1. +1 −29 pom.xml
  2. +9 −4 src/main/scala/com/airbnb/notification/MailClient.scala
View
30 pom.xml
@@ -158,12 +158,6 @@
<!-- Test scope -->
<dependency>
- <groupId>org.scalastyle</groupId>
- <artifactId>scalastyle-maven-plugin</artifactId>
- <version>0.2.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
@@ -382,29 +376,7 @@
<scalaVersion>${scala.version}</scalaVersion>
</configuration>
</plugin>
-
- <plugin>
- <groupId>org.scalastyle</groupId>
- <artifactId>scalastyle-maven-plugin</artifactId>
- <version>0.2.0</version>
- <configuration>
- <verbose>false</verbose>
- <failOnViolation>true</failOnViolation>
- <includeTestSourceDirectory>true</includeTestSourceDirectory>
- <failOnWarning>false</failOnWarning>
- <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
- <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
- <configLocation>${basedir}/scalastyle_config.xml</configLocation>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
+ <!-- TODO: Add maven/scalastyle-check -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
View
13 src/main/scala/com/airbnb/notification/MailClient.scala
@@ -20,7 +20,6 @@ class MailClient(
extends Actor {
private[this] val log = Logger.getLogger(getClass.getName)
- private[this] val dateFormat = new SimpleDateFormat
private[this] val split = """(.*):([0-9]*)""".r
private[this] val split(mailHost, mailPortStr) = mailServerString
@@ -29,17 +28,23 @@ class MailClient(
val email = new SimpleEmail
email.setHostName(mailHost)
- if (!mailUser.isEmpty && !password.isEmpty)
+ if (!mailUser.isEmpty && !password.isEmpty) {
email.setAuthenticator(new DefaultAuthenticator(mailUser.get, password.get))
+ }
email.addTo(to)
email.setFrom(fromUser)
email.setSubject(subject)
- if (!message.isEmpty) email.setMsg(message.get)
+
+ if (!message.isEmpty) {
+ email.setMsg(message.get)
+ }
+
email.setSSL(true)
email.setSmtpPort(mailPort)
- log.info("Sending email, response:" + email.send())
+ val response = email.send
+ log.info("Sent email to '%s' with subject: '%s', got response '%s'".format(to, subject, response))
}
def act() {
Please sign in to comment.
Something went wrong with that request. Please try again.