diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-07-17 09:27:29 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-08-27 10:26:21 -0700 |
commit | 9c50dd52743b7ff4de19548669dfa7e7a0304034 (patch) | |
tree | 8b0044529b3106ea84bca046dc5710fada708cce /test/files/pos/t715 | |
parent | 7817efe2468480317965fc5baece52be392f0f7a (diff) | |
download | scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.tar.gz scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.tar.bz2 scala-9c50dd52743b7ff4de19548669dfa7e7a0304034.zip |
Prepare removal of scala-xml, scala-parser-combinators
Every test deleted here has found its way to the respective
repositories of scala-xml and scala-parser-combinators,
where they will continue to be tested with partest.
The modified tests became independent of these modules,
as they should've been from the start.
Diffstat (limited to 'test/files/pos/t715')
-rw-r--r-- | test/files/pos/t715/meredith_1.scala | 98 | ||||
-rw-r--r-- | test/files/pos/t715/runner_2.scala | 3 |
2 files changed, 0 insertions, 101 deletions
diff --git a/test/files/pos/t715/meredith_1.scala b/test/files/pos/t715/meredith_1.scala deleted file mode 100644 index c28afb4a9b..0000000000 --- a/test/files/pos/t715/meredith_1.scala +++ /dev/null @@ -1,98 +0,0 @@ -package com.sap.dspace.model.othello; - -import scala.xml._ - -trait XMLRenderer { - type T <: Any {def getClass(): java.lang.Class[_]} - val valueTypes = - List( - classOf[java.lang.Boolean], - classOf[java.lang.Integer], - classOf[java.lang.Float], - classOf[java.lang.String] - // more to come - ) - - def value2XML( - value: Object, - field: java.lang.reflect.Field, - pojo: T - ): Node = { - value match { - case null => Text("null") - case vUnmatched => - if (value.isInstanceOf[java.lang.Boolean]) - Text(value.asInstanceOf[java.lang.Boolean].toString) - else if (value.isInstanceOf[java.lang.Integer]) - Text(value.asInstanceOf[java.lang.Integer].toString) - else if (value.isInstanceOf[java.lang.Float]) - Text(value.asInstanceOf[java.lang.Float].toString) - // else if (value.isInstanceOf[T]) - // pojo2XML(value.asInstanceOf[T]) - else - <unmatchedType> - <theType> - {vUnmatched.getClass.toString} - </theType> - <theValue> - {vUnmatched.toString} - </theValue> - </unmatchedType> - } - } - - def field2XML( - field: java.lang.reflect.Field, - pojo: T - ): Elem = { - - val accessible = field.isAccessible - field.setAccessible(true) - // BUGBUG lgm need to disambiguate on type and possibly make - // recursive call to pojo2XML - val fldValXML = value2XML(field.get( pojo ), field, pojo) - field.setAccessible( accessible ) - - Elem( - null, - field.getName, - null, - TopScope, - fldValXML - ) - } - - def pojo2XML(pojo: T): Elem = { - val progeny = - for (field <- pojo.getClass.getDeclaredFields) - yield field2XML(field, pojo) - - Elem( - null, - pojo.getClass.getName, - null, - TopScope, - progeny.asInstanceOf[Array[scala.xml.Node]]: _* - ) - } -} - -case class POJO2XMLRenderer(recurse: Boolean) - extends XMLRenderer { - type T = java.io.Serializable - override def value2XML( - value: Object, - field: java.lang.reflect.Field, - pojo: java.io.Serializable - ): Node = { - if (recurse) super.value2XML(value, field, pojo) - else Text(value + "") - } -} - -object thePOJO2XMLRenderer extends POJO2XMLRenderer(true) { -} - -object Test extends App { - println(com.sap.dspace.model.othello.thePOJO2XMLRenderer) -} diff --git a/test/files/pos/t715/runner_2.scala b/test/files/pos/t715/runner_2.scala deleted file mode 100644 index d54805629a..0000000000 --- a/test/files/pos/t715/runner_2.scala +++ /dev/null @@ -1,3 +0,0 @@ -object Test extends App { - println(com.sap.dspace.model.othello.thePOJO2XMLRenderer) -} |