Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.Serializable;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public static void setUpTags() {
mapper = new ObjectMapper();
}

@Test
public void testSerializability() {
LuceneSimpleTaggingProcessor processor = new LuceneSimpleTaggingProcessor("testCommunity", new String[]{"test","path"});
LuceneSimpleTaggingProcessor clone = SerializationUtils.clone(processor);
}

@Test
public void testActivityJsonString() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.apache.streams.tika;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List;

public class CategoryParser
public class CategoryParser implements Serializable
{
/**
* This method takes a URL and from that text alone determines what categories that URL belongs in.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses 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 org.apache.streams.tika;

import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;

public class TestCategoryParser {

@Test
public void testSerializability() {
CategoryParser parser = new CategoryParser();
CategoryParser clone = SerializationUtils.clone(parser);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses 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 org.apache.streams.tika;

import org.apache.commons.lang3.SerializationUtils;
import org.junit.Test;

public class TestTikaProcessor {
@Test
public void testSerializability() {
TikaProcessor processor = new TikaProcessor();
TikaProcessor clone = SerializationUtils.clone(processor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
Expand All @@ -23,7 +24,7 @@
* [t.co behavior] https://dev.twitter.com/docs/tco-redirection-behavior
*/

public class LinkResolver
public class LinkResolver implements Serializable
{
private final static Logger LOGGER = LoggerFactory.getLogger(LinkResolver.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"type": "object",
"$schema": "http://json-schema.org/draft-03/schema",
"id": "#",
"javaType": "org.apache.streams.urls.LinkDetails",
"javaInterfaces": ["java.io.Serializable"],
"properties": {
"linkStatus" : {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.streams.core.StreamsDatum;
import org.apache.streams.jackson.StreamsJacksonModule;
import org.apache.streams.pojo.json.Activity;
Expand All @@ -18,6 +19,18 @@ public class TestLinkUnwinderProcessor {

private static String activityString;

@Test
public void testLinkResolverSerializability() {
LinkResolver resolver = new LinkResolver("http://bit.ly/1cX5Rh4");
LinkResolver clone = SerializationUtils.clone(resolver);
}

@Test
public void testLinkResolverProcessorSerializability() {
LinkResolverProcessor processor = new LinkResolverProcessor();
LinkResolverProcessor clone = SerializationUtils.clone(processor);
}

@Test
public void testActivityLinkUnwinderProcessorBitly() throws Exception{
testActivityUnwinderHelper(Lists.newArrayList("http://bit.ly/1cX5Rh4"), Lists.newArrayList("http://www.wcgworld.com/"));
Expand Down