Skip to content

Commit

Permalink
Merge pull request #6 from benjchristensen/refactoring
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
benjchristensen committed Jan 16, 2013
2 parents d95439f + e9d98fc commit c11126d
Show file tree
Hide file tree
Showing 52 changed files with 573 additions and 342 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rx.lang.clojure;
package rx.lang.clojure;

import java.util.Arrays;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.rx.functions.FunctionLanguageAdaptor;
import org.rx.reactive.Observer;

import rx.observables.Observer;
import rx.util.FunctionLanguageAdaptor;

import clojure.lang.IFn;
import clojure.lang.RT;
Expand Down Expand Up @@ -99,7 +100,7 @@ public void before() {

@Test
public void testTake() {
runClojureScript("(-> (org.rx.reactive.Observable/toObservable [\"one\" \"two\" \"three\"]) (.take 2) (.subscribe (fn [arg] (println arg))))");
runClojureScript("(-> (rx.observables.Observable/toObservable [\"one\" \"two\" \"three\"]) (.take 2) (.subscribe (fn [arg] (println arg))))");
}

// commented out for now as I can't figure out how to set the var 'a' with the 'assertion' instance when running the code from java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rx.lang.groovy;
package rx.lang.groovy;

import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
Expand All @@ -28,11 +28,12 @@
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.rx.functions.FunctionLanguageAdaptor;
import org.rx.reactive.Notification;
import org.rx.reactive.Observable;
import org.rx.reactive.Observer;
import org.rx.reactive.Subscription;

import rx.observables.Notification;
import rx.observables.Observable;
import rx.observables.Observer;
import rx.observables.Subscription;
import rx.util.FunctionLanguageAdaptor;

public class GroovyAdaptor implements FunctionLanguageAdaptor {

Expand Down Expand Up @@ -208,7 +209,7 @@ private void runGroovyScript(String script) {
Binding binding = new Binding();
binding.setVariable("mockApiCall", new TestFactory());
binding.setVariable("a", assertion);
binding.setVariable("o", org.rx.reactive.Observable.class);
binding.setVariable("o", rx.observables.Observable.class);

/* parse the script and execute it */
InvokerHelper.createScript(loader.parseClass(script), binding).run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rx.lang.jruby;
package rx.lang.jruby;

import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
Expand All @@ -29,11 +29,12 @@
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.rx.functions.FunctionLanguageAdaptor;
import org.rx.reactive.Notification;
import org.rx.reactive.Observable;
import org.rx.reactive.Observer;
import org.rx.reactive.Subscription;

import rx.observables.Notification;
import rx.observables.Observable;
import rx.observables.Observer;
import rx.observables.Subscription;
import rx.util.FunctionLanguageAdaptor;

public class JRubyAdaptor implements FunctionLanguageAdaptor {

Expand Down Expand Up @@ -162,7 +163,7 @@ private void runGroovyScript(String script) {

StringBuilder b = new StringBuilder();
// force JRuby to always use subscribe(Object)
b.append("import org.rx.reactive.Observable").append("\n");
b.append("import \"rx.observables.Observable\"").append("\n");
b.append("class Observable").append("\n");
b.append(" java_alias :subscribe, :subscribe, [java.lang.Object]").append("\n");
b.append("end").append("\n");
Expand Down
44 changes: 0 additions & 44 deletions rxjava-core/src/main/java/org/rx/reactive/package.html

This file was deleted.

19 changes: 19 additions & 0 deletions rxjava-core/src/main/java/rx/concurrency/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2013 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Rx Schedulers
*/
package rx.concurrency;
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rx.reactive;
package rx.observables;

import java.util.ArrayList;
import java.util.Collection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.rx.reactive;
package rx.observables;

/**
* An object representing a notification sent to a Observable.
Expand Down
Loading

0 comments on commit c11126d

Please sign in to comment.