Skip to content
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

Override of NodeIndexConfig throwing compile error #6

Closed
khein opened this issue Jun 4, 2012 · 10 comments
Closed

Override of NodeIndexConfig throwing compile error #6

khein opened this issue Jun 4, 2012 · 10 comments

Comments

@khein
Copy link

khein commented Jun 4, 2012

Receiving the following compiler error:

type mismatch; found : List[(java.lang.String, ScalaObject with Equals)] required: List[(String, examples.wyrzytDatastore.IndexCustomConfig)]

Error location points to the '::' operator separating the two List elements. Using neo4j-scala 0.2.0-M1 with Scala 2.9.2.

When removing either List element, compiles fine. Since this is almost verbatim code as in the neo4j-scala readme, thought I'd report as an issue.

code is: --- ---

object datastore extends Neo4jWrapper with SingletonEmbeddedGraphDatabaseServiceProvider with Neo4jIndexProvider with TypedTraverser {

def neo4jStoreDir = "data/datastore.db"

override def NodeIndexConfig = ("personIndex", Map("provider" -> "lucene", "type" -> "fulltext")) :: ("eventIndex", Map("provider" -> "lucene", "type" -> "fulltext")) :: Nil


@FaKod
Copy link
Owner

FaKod commented Jun 4, 2012

Can you check if this works for you?

class datastore extends Neo4jWrapper with SingletonEmbeddedGraphDatabaseServiceProvider with Neo4jIndexProvider {

  def neo4jStoreDir = "data/datastore.db"

  override def NodeIndexConfig = ("personIndex", Some(Map("provider" -> "lucene", "type" -> "fulltext"))) ::
    ("eventIndex", Some(Map("provider" -> "lucene", "type" -> "fulltext"))) ::
    Nil
}

@FaKod
Copy link
Owner

FaKod commented Jun 4, 2012

Tested it with the additional "Some" - should work. I updated the README.
Thanks

@FaKod FaKod closed this as completed Jun 4, 2012
@khein
Copy link
Author

khein commented Jun 4, 2012

Christopher,

Excellent! Thanks for the information. The neo4j-scala library has been very eye-opening with regard to the DSL capabilities of Scala. The language almost expresses exactly what the comment would read...

I'm new to Scala as wells as Neo4j and haven't come across 'Some' yet... still a bit baffled, but I'll track down what is it doing, good reason to dig a bit deeper.

Been reading 'Programming in Scala' to pickup the language, see 'Some' listed on page 313 while I'm still at 185 or so. Learning while doing with more than a single new technology can be such a challenge.

Do you have any suggested learning resources for Scala? Especially for a Java/Spring Architect? The language/syntax is challenging enough, but I really feel I am missing the 'best design' type practices piece of the puzzle.

Thanks again for the quick fix/information...

Kevin

On 5/06/2012, at 3:32 AM, Christopher Schmidt wrote:

Tested it with the additional "Some" - should work. I updated the README.
Thanks


Reply to this email directly or view it on GitHub:
#6 (comment)

@khein
Copy link
Author

khein commented Jun 4, 2012

Thanks! The addition of "Some" worked fine.

@FaKod
Copy link
Owner

FaKod commented Jun 5, 2012

"'best design' type practices" - difficult answer... Scala provides a lot more ways to so do things. So I think that best practices are still evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in Depth (http://www.manning.com/suereth/) after reading Programming in Scala.

@khein
Copy link
Author

khein commented Jul 27, 2012

Hi Christopher,

Quick question... are the surefire/unit tests with neo4j-scala currently working? (mvn clean install)

When I build locally with mvn they fail, just checking if it my environment or just the current state.

thanks,

Kevin

On 6/06/2012, at 12:02 AM, Christopher Schmidt wrote:

"'best design' type practices" - difficult answer... Scala provides a lot more ways to so do things. So I think that best practices are still evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in Depth (http://www.manning.com/suereth/) after reading Programming in Scala.


Reply to this email directly or view it on GitHub:
#6 (comment)

@FaKod
Copy link
Owner

FaKod commented Jul 27, 2012

Yes - they should. Which one fails?

On Fri, Jul 27, 2012 at 5:39 AM, khein <
reply@reply.github.com

wrote:

Hi Christopher,

Quick question... are the surefire/unit tests with neo4j-scala currently
working? (mvn clean install)

When I build locally with mvn they fail, just checking if it my
environment or just the current state.

thanks,

Kevin

On 6/06/2012, at 12:02 AM, Christopher Schmidt wrote:

"'best design' type practices" - difficult answer... Scala provides a
lot more ways to so do things. So I think that best practices are still
evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in
Depth (http://www.manning.com/suereth/) after reading Programming in
Scala.


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

@khein
Copy link
Author

khein commented Jul 27, 2012

Here's the failing area...


Results :

Failed tests: NeoWrapper should::read a property in a node in node['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>
NeoWrapper should::read a property in a relationship in rel['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>

Tests in error:
NeoWrapper should::create a new relationship in --> relType --> notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::create a new relationship in --> "relName" --> notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::create a new relationship in <-- relType <-- notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::create a new relationship in <-- "relName" <-- notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::allow relationships of the same direction to be chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::allow relationships of different directions to be chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as JSON ''
NeoWrapper should::ignore a relationshipBuilder with no end node(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Rest Batch Request has not been executed, results only available after successful execution.
NeoWrapper should::create a property in a node in node['property']=value notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {1}
NeoWrapper should::create a property in a relationship in rel['property']=value notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {3}
NeoWrapper should::throw a UnsupportedOperationException using the old traverser(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): java.net.ConnectException: Connection refused
org.neo4j.scala.unittest.TypedTraverserRESTSpec: None.get

Tests run: 36, Failures: 2, Errors: 11, Skipped: 0

On 27/07/2012, at 4:01 PM, Christopher Schmidt wrote:

Yes - they should. Which one fails?

On Fri, Jul 27, 2012 at 5:39 AM, khein <
reply@reply.github.com

wrote:

Hi Christopher,

Quick question... are the surefire/unit tests with neo4j-scala currently
working? (mvn clean install)

When I build locally with mvn they fail, just checking if it my
environment or just the current state.

thanks,

Kevin

On 6/06/2012, at 12:02 AM, Christopher Schmidt wrote:

"'best design' type practices" - difficult answer... Scala provides a
lot more ways to so do things. So I think that best practices are still
evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in
Depth (http://www.manning.com/suereth/) after reading Programming in
Scala.


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

@FaKod
Copy link
Owner

FaKod commented Jul 27, 2012

These are the REST tests. You have to start a Neo4j server before...

On Fri, Jul 27, 2012 at 6:06 AM, khein <
reply@reply.github.com

wrote:

Here's the failing area...


Results :

Failed tests: NeoWrapper should::read a property in a node in
node['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>
NeoWrapper should::read a property in a relationship in
rel['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>

Tests in error:
NeoWrapper should::create a new relationship in --> relType -->
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in --> "relName" -->
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in <-- relType <--
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in <-- "relName" <--
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::allow relationships of the same direction to be
chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::allow relationships of different directions to be
chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::ignore a relationshipBuilder with no end
node(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Rest Batch Request has
not been executed, results only available after successful execution.
NeoWrapper should::create a property in a node in
node['property']=value
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {1}
NeoWrapper should::create a property in a relationship in
rel['property']=value
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {3}
NeoWrapper should::throw a UnsupportedOperationException using the old
traverser(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
java.net.ConnectException: Connection refused
org.neo4j.scala.unittest.TypedTraverserRESTSpec: None.get

Tests run: 36, Failures: 2, Errors: 11, Skipped: 0

On 27/07/2012, at 4:01 PM, Christopher Schmidt wrote:

Yes - they should. Which one fails?

On Fri, Jul 27, 2012 at 5:39 AM, khein <
reply@reply.github.com

wrote:

Hi Christopher,

Quick question... are the surefire/unit tests with neo4j-scala
currently
working? (mvn clean install)

When I build locally with mvn they fail, just checking if it my
environment or just the current state.

thanks,

Kevin

On 6/06/2012, at 12:02 AM, Christopher Schmidt wrote:

"'best design' type practices" - difficult answer... Scala provides a
lot more ways to so do things. So I think that best practices are still
evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in
Depth (http://www.manning.com/suereth/) after reading Programming in
Scala.


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

@khein
Copy link
Author

khein commented Jul 27, 2012

oh, that makes sense. I haven't used anything restful yet, just embedded. Thanks!

On 27/07/2012, at 4:13 PM, Christopher Schmidt wrote:

These are the REST tests. You have to start a Neo4j server before...

On Fri, Jul 27, 2012 at 6:06 AM, khein <
reply@reply.github.com

wrote:

Here's the failing area...


Results :

Failed tests: NeoWrapper should::read a property in a node in
node['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>
NeoWrapper should::read a property in a relationship in
rel['property'] notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
'None' is not equal to 'Some(bar)' expected:<[Some(bar)]> but was:<[None]>

Tests in error:
NeoWrapper should::create a new relationship in --> relType -->
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in --> "relName" -->
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in <-- relType <--
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::create a new relationship in <-- "relName" <--
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::allow relationships of the same direction to be
chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::allow relationships of different directions to be
chained(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Error reading as
JSON ''
NeoWrapper should::ignore a relationshipBuilder with no end
node(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): Rest Batch Request has
not been executed, results only available after successful execution.
NeoWrapper should::create a property in a node in
node['property']=value
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {1}
NeoWrapper should::create a property in a relationship in
rel['property']=value
notation(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec): 'foo' on {3}
NeoWrapper should::throw a UnsupportedOperationException using the old
traverser(org.neo4j.scala.unittest.Neo4jWrapperRESTSpec):
java.net.ConnectException: Connection refused
org.neo4j.scala.unittest.TypedTraverserRESTSpec: None.get

Tests run: 36, Failures: 2, Errors: 11, Skipped: 0

On 27/07/2012, at 4:01 PM, Christopher Schmidt wrote:

Yes - they should. Which one fails?

On Fri, Jul 27, 2012 at 5:39 AM, khein <
reply@reply.github.com

wrote:

Hi Christopher,

Quick question... are the surefire/unit tests with neo4j-scala
currently
working? (mvn clean install)

When I build locally with mvn they fail, just checking if it my
environment or just the current state.

thanks,

Kevin

On 6/06/2012, at 12:02 AM, Christopher Schmidt wrote:

"'best design' type practices" - difficult answer... Scala provides a
lot more ways to so do things. So I think that best practices are still
evolving.

Personally I like examples. I would recommend Joshua Suereth's Scala in
Depth (http://www.manning.com/suereth/) after reading Programming in
Scala.


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)


Reply to this email directly or view it on GitHub:
#6 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants