From eac891118ef565a6f753a1e92211d0296747ebfb Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Tekuri Date: Tue, 4 Aug 2015 22:31:48 +0530 Subject: [PATCH] added copyright header to test classes --- .../core/graph/sequences/SequenceTest.java | 21 +++--- .../graph/sequences/SequenceTestFactory.java | 21 +++--- .../core/graph/sequences/TOCSequence.java | 21 +++--- .../test/java/jlibs/core/i18n/Bundle1.java | 21 +++--- .../test/java/jlibs/core/i18n/Bundle2.java | 21 +++--- .../jlibs/core/i18n/ResourceBundleTest.java | 21 +++--- pom.xml | 1 + .../jlibs/wamp4j/SubscriptionOperator.java | 75 +++++++++++++++++++ .../jlibs/xml/sax/NamespaceReplacerTest.java | 16 ++++ 9 files changed, 158 insertions(+), 60 deletions(-) create mode 100644 wamp4j-core/src/test/java/jlibs/wamp4j/SubscriptionOperator.java diff --git a/core/src/test/java/jlibs/core/graph/sequences/SequenceTest.java b/core/src/test/java/jlibs/core/graph/sequences/SequenceTest.java index 3d4c2db6..fa27e29e 100644 --- a/core/src/test/java/jlibs/core/graph/sequences/SequenceTest.java +++ b/core/src/test/java/jlibs/core/graph/sequences/SequenceTest.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.graph.sequences; diff --git a/core/src/test/java/jlibs/core/graph/sequences/SequenceTestFactory.java b/core/src/test/java/jlibs/core/graph/sequences/SequenceTestFactory.java index a1d1cb62..e8993548 100644 --- a/core/src/test/java/jlibs/core/graph/sequences/SequenceTestFactory.java +++ b/core/src/test/java/jlibs/core/graph/sequences/SequenceTestFactory.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.graph.sequences; diff --git a/core/src/test/java/jlibs/core/graph/sequences/TOCSequence.java b/core/src/test/java/jlibs/core/graph/sequences/TOCSequence.java index 314ddbd7..7d33434d 100644 --- a/core/src/test/java/jlibs/core/graph/sequences/TOCSequence.java +++ b/core/src/test/java/jlibs/core/graph/sequences/TOCSequence.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.graph.sequences; diff --git a/i18n-apt/src/test/java/jlibs/core/i18n/Bundle1.java b/i18n-apt/src/test/java/jlibs/core/i18n/Bundle1.java index 74cbbb17..d1f0ceb5 100644 --- a/i18n-apt/src/test/java/jlibs/core/i18n/Bundle1.java +++ b/i18n-apt/src/test/java/jlibs/core/i18n/Bundle1.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.i18n; diff --git a/i18n-apt/src/test/java/jlibs/core/i18n/Bundle2.java b/i18n-apt/src/test/java/jlibs/core/i18n/Bundle2.java index 5fd64200..ce7e635f 100644 --- a/i18n-apt/src/test/java/jlibs/core/i18n/Bundle2.java +++ b/i18n-apt/src/test/java/jlibs/core/i18n/Bundle2.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.i18n; diff --git a/i18n-apt/src/test/java/jlibs/core/i18n/ResourceBundleTest.java b/i18n-apt/src/test/java/jlibs/core/i18n/ResourceBundleTest.java index 79c10e64..15c79f1a 100644 --- a/i18n-apt/src/test/java/jlibs/core/i18n/ResourceBundleTest.java +++ b/i18n-apt/src/test/java/jlibs/core/i18n/ResourceBundleTest.java @@ -1,16 +1,17 @@ /** - * JLibs: Common Utilities for Java - * Copyright (C) 2009 Santhosh Kumar T + * Copyright 2015 Santhosh Kumar Tekuri * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. + * The JLibs authors license this file to you 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: * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * 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. */ package jlibs.core.i18n; diff --git a/pom.xml b/pom.xml index 36936d3e..df8aed6d 100644 --- a/pom.xml +++ b/pom.xml @@ -138,6 +138,7 @@
src/etc/header.txt
**/src/main/** + **/src/test/** **/bin/** diff --git a/wamp4j-core/src/test/java/jlibs/wamp4j/SubscriptionOperator.java b/wamp4j-core/src/test/java/jlibs/wamp4j/SubscriptionOperator.java new file mode 100644 index 00000000..5159852a --- /dev/null +++ b/wamp4j-core/src/test/java/jlibs/wamp4j/SubscriptionOperator.java @@ -0,0 +1,75 @@ +/** + * Copyright 2015 Santhosh Kumar Tekuri + * + * The JLibs authors license this file to you 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. + */ + +package jlibs.wamp4j; + +import com.fasterxml.jackson.databind.node.ObjectNode; +import jlibs.wamp4j.client.Subscription; +import jlibs.wamp4j.client.WAMPClient; +import jlibs.wamp4j.msg.EventMessage; + +import java.util.concurrent.atomic.AtomicReference; + +import static org.testng.Assert.assertEquals; + +/** + * @author Santhosh Kumar Tekuri + */ +public class SubscriptionOperator{ + private Subscription subscription; + private final AtomicReference atomic = new AtomicReference(); + + public SubscriptionOperator(String topic){ + subscription = new Subscription(topic){ + @Override + public void onSubscribe(WAMPClient client){ + atomic.set(true); + } + + @Override + public void onUnsubscribe(WAMPClient client){ + atomic.set(false); + } + + @Override + public void onEvent(EventMessage event){ + onMessage(event); + } + + @Override + public void onError(WAMPClient client, WAMPException error){ + atomic.set(error); + } + }; + } + + public void onMessage(EventMessage event){} + + private ClientOperator client; + public void subscribeWith(ObjectNode options, ClientOperator client) throws Throwable{ + atomic.set(null); + client.client.subscribe(options, subscription); + assertEquals(Await.getResult(atomic), Boolean.TRUE); + this.client = client; + } + + public void unsubscribe() throws Throwable{ + atomic.set(null); + client.client.unsubscribe(subscription); + assertEquals(Await.getResult(atomic), Boolean.FALSE); + client = null; + } +} diff --git a/xml/src/test/java/jlibs/xml/sax/NamespaceReplacerTest.java b/xml/src/test/java/jlibs/xml/sax/NamespaceReplacerTest.java index b84b8a9d..226a94c7 100644 --- a/xml/src/test/java/jlibs/xml/sax/NamespaceReplacerTest.java +++ b/xml/src/test/java/jlibs/xml/sax/NamespaceReplacerTest.java @@ -1,3 +1,19 @@ +/** + * Copyright 2015 Santhosh Kumar Tekuri + * + * The JLibs authors license this file to you 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. + */ + package jlibs.xml.sax; import jlibs.xml.xsl.TransformerUtil;