Skip to content

Commit

Permalink
#1 add start at test configs
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Jul 5, 2017
1 parent a7dc965 commit c113aa1
Show file tree
Hide file tree
Showing 18 changed files with 886 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package org.irods.jargon2.core.pub.io.plugin.nio.utils;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketOption;
import java.nio.ByteBuffer;
import java.nio.channels.NetworkChannel;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Stub out socket channel, very likely to change
*
* @author mcc
*
*/
public class MockSocketChannel implements java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.ByteChannel,
java.nio.channels.Channel, java.nio.channels.GatheringByteChannel, java.nio.channels.InterruptibleChannel,
java.nio.channels.NetworkChannel, java.nio.channels.ReadableByteChannel,
java.nio.channels.ScatteringByteChannel, java.nio.channels.WritableByteChannel {

public static final Logger log = LoggerFactory.getLogger(MockSocketChannel.class);

public MockSocketChannel() {
}

@Override
public int write(ByteBuffer arg0) throws IOException {
return 0;
}

@Override
public long read(ByteBuffer[] arg0) throws IOException {
return 0;
}

@Override
public long read(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
return 0;
}

@Override
public int read(ByteBuffer arg0) throws IOException {
return 0;
}

@Override
public NetworkChannel bind(SocketAddress arg0) throws IOException {
return new MockSocketChannel();
}

@Override
public SocketAddress getLocalAddress() throws IOException {
return new InetSocketAddress(1247);
}

@Override
public <T> T getOption(SocketOption<T> arg0) throws IOException {
return null;
}

@Override
public <T> NetworkChannel setOption(SocketOption<T> arg0, T arg1) throws IOException {
return null;
}

@Override
public Set<SocketOption<?>> supportedOptions() {
return null;
}

@Override
public long write(ByteBuffer[] arg0) throws IOException {
return 0;
}

@Override
public long write(ByteBuffer[] arg0, int arg1, int arg2) throws IOException {
return 0;
}

@Override
public boolean isOpen() {
return true;
}

@Override
public void close() throws IOException {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/**
* Testing and other utils
*
* @author mcc
*
*/
package org.irods.jargon2.core.pub.io.plugin.nio.utils;
9 changes: 9 additions & 0 deletions io-plugin-nio/src/test/resources/log4j.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Set root logger level and appender
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
*
*/
package org.irods.jargon2.common.auth;

/**
* Identity of an iRODS user
*
* @author mcc
*
*/
public class IrodsPrincipal {

/**
*
*/
public IrodsPrincipal() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

/**
* Auth and identity support
*
* @author mcc
*
*/
package org.irods.jargon2.common.auth;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
*
*/
package org.irods.jargon2.exception.configuration;

import org.irods.jargon2.exception.JargonException;

/**
* General exception caused by using Test utilities
*
* @author Mike Conway, DICE (10/16/2009)
* @since 10/16/2009
*
*/
public class TestConfigurationException extends JargonException {

/**
*
*/
private static final long serialVersionUID = 2124699560973645080L;

/**
*
*/
public TestConfigurationException() {
super();
}

/**
* @param arg0
*/
public TestConfigurationException(final String arg0) {
super(arg0);

}

/**
* @param arg0
*/
public TestConfigurationException(final Throwable arg0) {
super(arg0);

}

/**
* @param arg0
* @param arg1
*/
public TestConfigurationException(final String arg0, final Throwable arg1) {
super(arg0, arg1);

}

}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,6 @@
<module>jargon2-core-if</module>
<module>jargon2-core-common</module>
<module>io-plugin-nio</module>
<module>test-support</module>
</modules>
</project>
22 changes: 22 additions & 0 deletions test-support/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.irods</groupId>
<artifactId>jargon2</artifactId>
<version>4.3.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-support</artifactId>
<packaging>jar</packaging>
<description>Utility support for unit tests</description>
<name>test-support</name>
<dependencies>
<dependency>
<groupId>org.irods</groupId>
<artifactId>jargon2-core-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

Empty file.
Loading

0 comments on commit c113aa1

Please sign in to comment.