These are chat archives for read-write-web/chat

7th
Dec 2015
mo-seph
@mo-seph
Dec 07 2015 15:16
@bblfish just playing with rww-play now. How do you run your tests? I can't find any objects, only classes so the normal scalatest mechanisms don't seem to work?
Henry Story
@bblfish
Dec 07 2015 15:16
it's the same as the way banana-rdf tests are run
just type
> test
or
> testOnly ...
mo-seph
@mo-seph
Dec 07 2015 15:17
in activator? (I'm coming from mvn/eclipse, so not quite up to speed on the sbt side of things)
I get errors, unfortunately:
Henry Story
@bblfish
Dec 07 2015 15:19
ah! use the dev branch
mo-seph
@mo-seph
Dec 07 2015 15:19
'[RWWeb] $ test
[error] Uncaught exception when running tests: java.lang.NoClassDefFoundError: test/ldp/RWWActorSubdomainsTest (wrong name: test/ldp/RwwActorSubdomainsTest)
[trace] Stack trace suppressed: run last test:test for the full output.
Exception in thread "Thread-12" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2608)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at sbt.React.react(ForkTests.scala:114)
at sbt.ForkTests$$anonfun$mainTestTask$1$Acceptor$2$.run(ForkTests.scala:74)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-16" java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2608)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1319)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1$React.react(Framework.scala:953)
at org.scalatest.tools.Framework$ScalaTestRunner$Skeleton$1.run(Framework.scala:942)
at java.lang.Thread.run(Thread.java:745)
[info] ScalaTest
[info] Run completed in 723 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[success] Total time: 2 s, completed 07-Dec-2015 15:19:03'
Henry Story
@bblfish
Dec 07 2015 15:20
which branch are you in?
mo-seph
@mo-seph
Dec 07 2015 15:20
git status On branch dev Your branch is up-to-date with 'origin/dev'.
Henry Story
@bblfish
Dec 07 2015 15:20
what JVM are you using?
java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
mo-seph
@mo-seph
Dec 07 2015 15:22
should be 1.8:
java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
Henry Story
@bblfish
Dec 07 2015 15:22
mhh that should be fine
mo-seph
@mo-seph
Dec 07 2015 15:22
activator complained when an old $JAVA_HOME had me using 1.7
Henry Story
@bblfish
Dec 07 2015 15:23
yep, I think I made it impossible to use an older version.
did you first run compile?
I am not exactly sure what this can be due to.... I should run the tests on travis, then these things would not happen.
mo-seph
@mo-seph
Dec 07 2015 15:24

[RWWeb] $ run -Dhttps.port=8443 -Dhttps.trustStore=noCA -Drww.subdomains=true -Dhttp.hostname=localhost -Drww.subdomains=true -Dsmtp.password=secret

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/dmrust/.ivy2/cache/ch.qos.logback/logback-classic/jars/logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/dmrust/.ivy2/cache/org.slf4j/slf4j-log4j12/jars/slf4j-log4j12-1.7.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
--- (Running the application, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
[info] play - Listening for HTTPS on port /0:0:0:0:0:0:0:0:8443

(Server started, use Ctrl+D to stop and go back to the console...)

Henry Story
@bblfish
Dec 07 2015 15:24
Play compiles on first connection.
so it's better to run
> compile
first
mo-seph
@mo-seph
Dec 07 2015 15:25
[RWWeb] $ compile
[success] Total time: 0 s, completed 07-Dec-2015 15:24:39
Henry Story
@bblfish
Dec 07 2015 15:27
do you have the file ./test/ldp/RWWActorSubdomainsTest.scala
mo-seph
@mo-seph
Dec 07 2015 15:28
(just tried making a connection, I get an empty response when visiting localhost:8443)
Henry Story
@bblfish
Dec 07 2015 15:29
mo-seph
@mo-seph
Dec 07 2015 15:29
yes, got that file (activator complains about having classes which only differ in capitalisation)
Henry Story
@bblfish
Dec 07 2015 15:29
ah...
are you on Mac non case sensitive file system?
It may be that somehow I have two classes with a name clash
which classes does it complain about?
mo-seph
@mo-seph
Dec 07 2015 15:31
[error] Uncaught exception when running tests: java.lang.NoClassDefFoundError: test/ldp/RWWActorSubdomainsTest (wrong name: test/ldp/RwwActorSubdomainsTest)
Henry Story
@bblfish
Dec 07 2015 15:32
ah indeed
mo-seph
@mo-seph
Dec 07 2015 15:33
ack, yes, case insensitive :( bloody apple...
Henry Story
@bblfish
Dec 07 2015 15:34
I am also on apple, but with non case sensitive fs
but anyway, it's a bit silly to do things like that
mo-seph
@mo-seph
Dec 07 2015 15:35
(I used to have case sensitive fs, but it seemed to confuse some things)
Henry Story
@bblfish
Dec 07 2015 15:35
I have both
what should I call this thing?
mo-seph
@mo-seph
Dec 07 2015 15:37
I've changed the abstract class to have abstract in the name :/
Henry Story
@bblfish
Dec 07 2015 15:38
Wait let me do a push
mo-seph
@mo-seph
Dec 07 2015 15:38
tests now work :)
Henry Story
@bblfish
Dec 07 2015 15:38
ah good
mo-seph
@mo-seph
Dec 07 2015 15:38
"Base" is probably better than "Abstract", tho
Henry Story
@bblfish
Dec 07 2015 15:39
One is generic on RDF
the other uses a hard coded RDF
if one were to make this into its own library, one could test it against Jena, Sesame and Plantain
mo-seph
@mo-seph
Dec 07 2015 15:41
yup! I've done things like this as contracts, so I'd call the generic one a contract, and then have a test for each implimentation
Henry Story
@bblfish
Dec 07 2015 15:41
ok made a push
just git reset --hard and git pull
mo-seph
@mo-seph
Dec 07 2015 15:42
I'm still a bit confused as to where RwwActorSubdomainsTest gets baseUri and dir from to run the test
Henry Story
@bblfish
Dec 07 2015 15:42
in TestSetup
you should be able to click on variables in Eclipse and reach the def.
my naming convetion is not good btw.
In banana-rdf you'll see there are always Jena...Test, Sesame...Test etc... classes or objects. Here's the name is a bit silly because I chose one particular implementation of RDF, partly because of issues with banana-rdf and SPARQL support.
mo-seph
@mo-seph
Dec 07 2015 15:46
Argh, I'm a muppet, and totally misparsed the code.
Henry Story
@bblfish
Dec 07 2015 15:47
also note that I am on an version 0.7 of banana-rdf published on my repository.
for the reason that I have not had time to upgrade, and because it used to get quite tiring following banana-rdf.
Do you use Play btw?
mo-seph
@mo-seph
Dec 07 2015 15:49
ah, OK, I'm on 0.8
Henry Story
@bblfish
Dec 07 2015 15:49
There's not that much difference in use.
mo-seph
@mo-seph
Dec 07 2015 15:49
Not used play at all - I started with Lift when that seemed to be the right direction, and haven't re-invested
Henry Story
@bblfish
Dec 07 2015 15:50
Ah ok. I am actually just waiting for akka streams to work, and then will be a good time to re-write a lot of this.
which should be quite soon.
mo-seph
@mo-seph
Dec 07 2015 15:50
Currently using finagle for setting up a simple REST api
Henry Story
@bblfish
Dec 07 2015 15:51
Ah its the Twitter lib?
Yes, well that's probably why it's useful to produce this as a lib. Then different groups can implement it in their favorite framework.
mo-seph
@mo-seph
Dec 07 2015 15:54
Yup. I had a look through, seems plausible
The only slightly tricky thing was the play Iteratees dependency
Henry Story
@bblfish
Dec 07 2015 15:54
It would probably not be that much work to upgrade it to 0.8 of banana-rdf, though you may loose some functionality then.
mo-seph
@mo-seph
Dec 07 2015 15:54
but I think they do that as a standalone?
Henry Story
@bblfish
Dec 07 2015 15:54
yes.
they made all those libs standalone now
Actually one should move away from iteratees and towrads packpressure aware streams
Also it would be great to have streaming serialisers and parsers.
But we got a bit stuck with banana-rdf there, as alexander did not see the point of it.
but it's obviously really important.
mo-seph
@mo-seph
Dec 07 2015 15:57
It also looked like about 70% or so of the code would be needed/part of a standalone library (from a cursory exploration of deleting everything with 'play' in the name ;) )
Henry Story
@bblfish
Dec 07 2015 15:58
So a few years ago I took a lot of the parsers and implemented them with Iteratees, hoping it would be easy to move to that a few years ago. I think I know how to do that, but it's silly to invest time in Iteratees now, one should move straight to akka streams
yes.
The play code is only doing the front end LDP commands and auth.
mo-seph
@mo-seph
Dec 07 2015 16:01
OK, great, so my general plan would be along the lines of:
  • copy the project to a new ID
  • delete all of the play-specific code
  • remove any unnecessary dependencies
Henry Story
@bblfish
Dec 07 2015 16:14
yep. I think that would give you a good initial project quickly to do quite a lot of experimentation with.