Skip to content

Fix Java 6 #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ env:

script: admin/build.sh

addons:
apt:
packages:
- openjdk-6-jdk

jdk:
- openjdk6
- oraclejdk8
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lazy val xml = crossProject.in(file("."))

libraryDependencies += "junit" % "junit" % "4.11" % "test",
libraryDependencies += "com.novocode" % "junit-interface" % "0.10" % "test",
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.6" % "test",
libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.5" % "test",
libraryDependencies += ("org.scala-lang" % "scala-compiler" % scalaVersion.value % "test").exclude("org.scala-lang.modules", s"scala-xml_${scalaVersion.value}")
)
.jsSettings(
Expand Down
9 changes: 0 additions & 9 deletions jvm/src/test/scala/scala/xml/JavaByteSerialization.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package scala.xml

import java.io.Serializable
import java.util.Base64
import org.apache.commons.lang3.SerializationUtils

object JavaByteSerialization {
Expand All @@ -16,12 +15,4 @@ object JavaByteSerialization {
def deserialize[T <: Serializable](in: Array[Byte]): T = {
SerializationUtils.deserialize(in)
}

def base64Encode[T <: Serializable](in: T): String = {
Base64.getEncoder.encodeToString(serialize[T](in))
}

def base64Decode[T <: Serializable](in: String): T = {
deserialize[T](Base64.getDecoder.decode(in))
}
}
7 changes: 0 additions & 7 deletions jvm/src/test/scala/scala/xml/SerializationTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,4 @@ class SerializationTest {
val asNodeSeq: NodeSeq = children
assertEquals(asNodeSeq, JavaByteSerialization.roundTrip(asNodeSeq))
}

@Test
def base64Encode: Unit = {
val str = JavaByteSerialization.base64Encode(NodeSeq.Empty)
assertEquals("rO0ABXNy", str.take(8))
assertEquals("AHhweA==", str.takeRight(8))
}
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.12")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.20")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.19")