Skip to content

Commit

Permalink
[build][core] removing scalacheck, adding context
Browse files Browse the repository at this point in the history
  • Loading branch information
florianleibert committed Mar 19, 2013
1 parent fad73d7 commit df9d434
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 33 deletions.
30 changes: 1 addition & 29 deletions pom.xml
Expand Up @@ -157,12 +157,6 @@
</dependency> </dependency>


<!-- Test scope --> <!-- Test scope -->
<dependency>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.2.0</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
Expand Down Expand Up @@ -382,29 +376,7 @@
<scalaVersion>${scala.version}</scalaVersion> <scalaVersion>${scala.version}</scalaVersion>
</configuration> </configuration>
</plugin> </plugin>

<!-- TODO: Add maven/scalastyle-check -->
<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>

<plugin> <plugin>
<artifactId>maven-clean-plugin</artifactId> <artifactId>maven-clean-plugin</artifactId>
<version>2.5</version> <version>2.5</version>
Expand Down
13 changes: 9 additions & 4 deletions src/main/scala/com/airbnb/notification/MailClient.scala
Expand Up @@ -20,7 +20,6 @@ class MailClient(
extends Actor { extends Actor {


private[this] val log = Logger.getLogger(getClass.getName) 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 = """(.*):([0-9]*)""".r
private[this] val split(mailHost, mailPortStr) = mailServerString private[this] val split(mailHost, mailPortStr) = mailServerString


Expand All @@ -29,17 +28,23 @@ class MailClient(
val email = new SimpleEmail val email = new SimpleEmail
email.setHostName(mailHost) email.setHostName(mailHost)


if (!mailUser.isEmpty && !password.isEmpty) if (!mailUser.isEmpty && !password.isEmpty) {
email.setAuthenticator(new DefaultAuthenticator(mailUser.get, password.get)) email.setAuthenticator(new DefaultAuthenticator(mailUser.get, password.get))
}


email.addTo(to) email.addTo(to)
email.setFrom(fromUser) email.setFrom(fromUser)


email.setSubject(subject) email.setSubject(subject)
if (!message.isEmpty) email.setMsg(message.get)
if (!message.isEmpty) {
email.setMsg(message.get)
}

email.setSSL(true) email.setSSL(true)
email.setSmtpPort(mailPort) 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() { def act() {
Expand Down

0 comments on commit df9d434

Please sign in to comment.