SimpleName:IDENTIFIER 66 expected expected

SimpleName:IDENTIFIER 66 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 67 testFailGetColumn testFailGetColumn

SimpleName:IDENTIFIER 68 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 69 RowScaledMatrix RowScaledMatrix

SimpleName:IDENTIFIER 70 getColumn getColumn

@Test(expected = UnsupportedOperationException.class)
public void testFailGetColumn() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.getColumn(0);
}

package edu.ucla.sspace.matrix;

import edu.ucla.sspace.vector.DenseVector;
import edu.ucla.sspace.vector.DoubleVector;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_RowScaledMatrixTest {

    public static final double[][] VALUES = new double[][] { { 1, 2, 3, 4, 5 }, { 5, 6, 7, 8, 9 }, { 1, 1, 0, 0, 1 } };

    public static final double[] SCALES = new double[] { 10, .4, 1 };

    public static final DoubleVector SCALE = new DenseVector(SCALES);
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 75 expected expected

SimpleName:IDENTIFIER 75 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 76 testFailGetColumn testFailGetColumn

SimpleName:IDENTIFIER 78 RowScaledSparseMatrix RowScaledSparseMatrix

SimpleName:IDENTIFIER 79 getColumn getColumn

@Test(expected = UnsupportedOperationException.class)
public void testFailGetColumn() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.getColumn(0);
}

package edu.ucla.sspace.matrix;

import edu.ucla.sspace.vector.DenseVector;
import edu.ucla.sspace.vector.DoubleVector;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_RowScaledSparseMatrixTest {

    public static final double[][] VALUES = new double[][] { { 1, 2, 3, 4, 5 }, { 5, 6, 7, 8, 9 }, { 1, 1, 0, 0, 1 } };

    public static final double[] SCALES = new double[] { 10, .4, 1 };

    public static final DoubleVector SCALE = new DenseVector(SCALES);

    public SparseMatrix matrix() {
        SparseMatrix m = new YaleSparseMatrix(VALUES.length, VALUES[0].length);
        for (int r = 0; r < m.rows(); ++r) for (int c = 0; c < m.columns(); ++c) if (VALUES[r][c] != 0d)
            m.set(r, c, VALUES[r][c]);
        return m;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 73 expected expected

SimpleName:IDENTIFIER 73 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 74 testFailGetColumnVector testFailGetColumnVector

SimpleName:IDENTIFIER 75 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 76 RowScaledMatrix RowScaledMatrix

SimpleName:IDENTIFIER 77 getColumnVector getColumnVector

@Test(expected = UnsupportedOperationException.class)
public void testFailGetColumnVector() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.getColumnVector(0);
}


SimpleName:IDENTIFIER 80 expected expected

SimpleName:IDENTIFIER 80 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 81 testFailSet testFailSet

SimpleName:IDENTIFIER 82 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 83 RowScaledMatrix RowScaledMatrix

@Test(expected = UnsupportedOperationException.class)
public void testFailSet() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.set(0, 0, 0);
}

SimpleName:IDENTIFIER 89 expected expected

SimpleName:IDENTIFIER 89 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 90 testFailSet testFailSet

SimpleName:IDENTIFIER 92 RowScaledSparseMatrix RowScaledSparseMatrix

@Test(expected = UnsupportedOperationException.class)
public void testFailSet() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.set(0, 0, 0);
}


SimpleName:IDENTIFIER 87 expected expected

SimpleName:IDENTIFIER 87 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 88 testFailSetColumn testFailSetColumn

SimpleName:IDENTIFIER 89 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 90 RowScaledMatrix RowScaledMatrix

SimpleName:IDENTIFIER 91 setColumn setColumn

@Test(expected = UnsupportedOperationException.class)
public void testFailSetColumn() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.setColumn(0, new double[] { 1, 1, 1 });
}

SimpleName:IDENTIFIER 96 expected expected

SimpleName:IDENTIFIER 96 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 97 testFailSetColumn testFailSetColumn

SimpleName:IDENTIFIER 99 RowScaledSparseMatrix RowScaledSparseMatrix

SimpleName:IDENTIFIER 100 setColumn setColumn

@Test(expected = UnsupportedOperationException.class)
public void testFailSetColumn() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.setColumn(0, new double[] { 1, 1, 1 });
}


SimpleName:IDENTIFIER 94 expected expected

SimpleName:IDENTIFIER 94 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 95 testFailSetColumnFull testFailSetColumnFull

SimpleName:IDENTIFIER 96 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 97 RowScaledMatrix RowScaledMatrix

SimpleName:IDENTIFIER 98 setColumn setColumn

SimpleName:IDENTIFIER 98 DenseVector DenseVector

@Test(expected = UnsupportedOperationException.class)
public void testFailSetColumnFull() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.setColumn(0, new DenseVector(new double[] { 1, 1, 1 }));
}

SimpleName:IDENTIFIER 103 expected expected

SimpleName:IDENTIFIER 103 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 104 testFailSetColumnFull testFailSetColumnFull

SimpleName:IDENTIFIER 106 RowScaledSparseMatrix RowScaledSparseMatrix

SimpleName:IDENTIFIER 107 setColumn setColumn

SimpleName:IDENTIFIER 107 DenseVector DenseVector

@Test(expected = UnsupportedOperationException.class)
public void testFailSetColumnFull() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.setColumn(0, new DenseVector(new double[] { 1, 1, 1 }));
}


SimpleName:IDENTIFIER 101 expected expected

SimpleName:IDENTIFIER 101 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 102 testFailSetRow testFailSetRow

SimpleName:IDENTIFIER 103 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 104 RowScaledMatrix RowScaledMatrix

@Test(expected = UnsupportedOperationException.class)
public void testFailSetRow() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.setRow(0, VALUES[0]);
}

SimpleName:IDENTIFIER 110 expected expected

SimpleName:IDENTIFIER 110 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 111 testFailSetRow testFailSetRow

SimpleName:IDENTIFIER 113 RowScaledSparseMatrix RowScaledSparseMatrix

@Test(expected = UnsupportedOperationException.class)
public void testFailSetRow() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.setRow(0, VALUES[0]);
}


SimpleName:IDENTIFIER 108 expected expected

SimpleName:IDENTIFIER 108 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 109 testFailSetRowFull testFailSetRowFull

SimpleName:IDENTIFIER 110 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 111 RowScaledMatrix RowScaledMatrix

SimpleName:IDENTIFIER 112 DenseVector DenseVector

@Test(expected = UnsupportedOperationException.class)
public void testFailSetRowFull() {
    Matrix base = new ArrayMatrix(VALUES);
    Matrix scaled = new RowScaledMatrix(base, SCALE);
    scaled.setRow(0, new DenseVector(VALUES[0]));
}

SimpleName:IDENTIFIER 117 expected expected

SimpleName:IDENTIFIER 117 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 118 testFailSetRowFull testFailSetRowFull

SimpleName:IDENTIFIER 120 RowScaledSparseMatrix RowScaledSparseMatrix

SimpleName:IDENTIFIER 121 DenseVector DenseVector

@Test(expected = UnsupportedOperationException.class)
public void testFailSetRowFull() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.setRow(0, new DenseVector(VALUES[0]));
}


SimpleName:IDENTIFIER 35 expected expected

SimpleName:IDENTIFIER 35 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 36 testConstructorIllegalSize testConstructorIllegalSize

SimpleName:IDENTIFIER 37 OnDiskMatrix OnDiskMatrix

@Test(expected = IllegalArgumentException.class)
public void testConstructorIllegalSize() {
    new OnDiskMatrix(0, 0);
}

package edu.ucla.sspace.matrix;

import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_OnDiskMatrixTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 39 expected expected

SimpleName:IDENTIFIER 39 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 40 testRemove testRemove

SimpleName:IDENTIFIER 40 Exception Exception

SimpleName:IDENTIFIER 41 getMatlabFile getMatlabFile

SimpleName:IDENTIFIER 42 MatlabSparseFileIterator MatlabSparseFileIterator

@Test(expected = UnsupportedOperationException.class)
public void testRemove() throws Exception {
    File f = getMatlabFile();
    Iterator<MatrixEntry> it = new MatlabSparseFileIterator(f);
    it.remove();
}

package edu.ucla.sspace.matrix;

import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_MatlabSparseFileIteratorTests {

    private static final double[][] testMatrix = { { 2.3, 0, 4.2 }, { 0, 1.3, 2.2 }, { 3.8, 0, 0.5 } };

    public static File getMatlabFile() throws Exception {
        File f = File.createTempFile("unit-test", ".dat");
        PrintWriter pw = new PrintWriter(f);
        for (int r = 0; r < testMatrix.length; ++r) for (int c = 0; c < testMatrix[0].length; ++c) pw.printf("%d %d %f\n", r + 1, c + 1, testMatrix[r][c]);
        pw.close();
        return f;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 34 expected expected

SimpleName:IDENTIFIER 34 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 35 testRemove testRemove

SimpleName:IDENTIFIER 35 Exception Exception

SimpleName:IDENTIFIER 36 getSparseBinarySVDLIBCFile getSparseBinarySVDLIBCFile

SimpleName:IDENTIFIER 37 SvdlibcSparseBinaryFileIterator SvdlibcSparseBinaryFileIterator

@Test(expected = UnsupportedOperationException.class)
public void testRemove() throws Exception {
    File f = getSparseBinarySVDLIBCFile();
    Iterator<MatrixEntry> it = new SvdlibcSparseBinaryFileIterator(f);
    it.remove();
}

package edu.ucla.sspace.matrix;

import java.io.*;
import java.util.*;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SvdlibcSparseBinaryFileIteratorTests {

    public static File getSparseBinarySVDLIBCFile() throws Exception {
        File f = File.createTempFile("unit-test", ".dat");
        DataOutputStream pw = new DataOutputStream(new FileOutputStream(f));
        pw.writeInt(3);
        pw.writeInt(3);
        pw.writeInt(6);
        pw.writeInt(2);
        pw.writeInt(0);
        pw.writeFloat(2.3f);
        pw.writeInt(2);
        pw.writeFloat(3.8f);
        pw.writeInt(1);
        pw.writeInt(1);
        pw.writeFloat(1.3f);
        pw.writeInt(3);
        pw.writeInt(0);
        pw.writeFloat(4.2f);
        pw.writeInt(1);
        pw.writeFloat(2.2f);
        pw.writeInt(2);
        pw.writeFloat(0.5f);
        pw.close();
        return f;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 82 expected expected

SimpleName:IDENTIFIER 82 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 83 testFailGetColumnVector testFailGetColumnVector

SimpleName:IDENTIFIER 85 RowScaledSparseMatrix RowScaledSparseMatrix

SimpleName:IDENTIFIER 86 getColumnVector getColumnVector

@Test(expected = UnsupportedOperationException.class)
public void testFailGetColumnVector() {
    SparseMatrix base = matrix();
    Matrix scaled = new RowScaledSparseMatrix(base, SCALE);
    scaled.getColumnVector(0);
}


SimpleName:IDENTIFIER 104 expected expected

SimpleName:IDENTIFIER 104 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 105 testBelowZeroOrdering testBelowZeroOrdering

SimpleName:IDENTIFIER 106 baseMatrix baseMatrix

SimpleName:IDENTIFIER 106 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 108 reordering reordering

SimpleName:IDENTIFIER 109 RowMaskedMatrix RowMaskedMatrix

SimpleName:IDENTIFIER 109 baseMatrix baseMatrix

SimpleName:IDENTIFIER 109 reordering reordering

@Test(expected = IllegalArgumentException.class)
public void testBelowZeroOrdering() {
    Matrix baseMatrix = new ArrayMatrix(VALUES);
    int[] reordering = new int[] { 1, -1, 3 };
    RowMaskedMatrix mapped = new RowMaskedMatrix(baseMatrix, reordering);
}

package edu.ucla.sspace.matrix;

import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_RowMaskedMatrixTest {

    public static final double[][] VALUES = { { 1, 2, 4, 5, 6 }, { .1, .2, .3, .4, .5 }, { 7, 8, 9, 0, 11 }, { .1, .2, .3, .4, .5 } };
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 112 expected expected

SimpleName:IDENTIFIER 112 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 113 testOutOfBoundsOrdering testOutOfBoundsOrdering

SimpleName:IDENTIFIER 114 baseMatrix baseMatrix

SimpleName:IDENTIFIER 114 ArrayMatrix ArrayMatrix

SimpleName:IDENTIFIER 116 reordering reordering

SimpleName:IDENTIFIER 117 RowMaskedMatrix RowMaskedMatrix

SimpleName:IDENTIFIER 117 baseMatrix baseMatrix

SimpleName:IDENTIFIER 117 reordering reordering

@Test(expected = IllegalArgumentException.class)
public void testOutOfBoundsOrdering() {
    Matrix baseMatrix = new ArrayMatrix(VALUES);
    int[] reordering = new int[] { 1, 2, 4 };
    RowMaskedMatrix mapped = new RowMaskedMatrix(baseMatrix, reordering);
}


SimpleName:IDENTIFIER 316 testNoWriteKeyInArray testNoWriteKeyInArray

SimpleName:IDENTIFIER 316 IOException IOException

SimpleName:IDENTIFIER 317 AJsonSerHelper AJsonSerHelper

SimpleName:IDENTIFIER 317 ByteArrayOutputStream ByteArrayOutputStream

SimpleName:IDENTIFIER 318 startArray startArray

SimpleName:IDENTIFIER 320 writeKey writeKey

@Test
public void testNoWriteKeyInArray() throws IOException {
    final AJsonSerHelper ser = new AJsonSerHelper(new ByteArrayOutputStream());
    ser.startArray();
    ser.writeKey("a");
}

@Test(expected = IllegalStateException.class)
public void testNoWriteKeyInArray() throws IOException {
    final AJsonSerHelper ser = new AJsonSerHelper(new ByteArrayOutputStream());
    ser.startArray();
    ser.writeKey("a");
}

package com.ajjpj.afoundation.io;

import com.ajjpj.afoundation.io.AJsonSerHelper;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import static org.junit.Assert.*;

public class adhoc_AJsonSerHelperTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 75 testCycle testCycle

SimpleName:IDENTIFIER 76 ADiGraph ADiGraph

SimpleName:IDENTIFIER 78 assertTrue assertTrue

SimpleName:IDENTIFIER 80 assertTrue assertTrue

SimpleName:IDENTIFIER 80 hasCycles hasCycles

SimpleName:IDENTIFIER 81 assertTrue assertTrue

SimpleName:IDENTIFIER 81 minimalCycles minimalCycles

SimpleName:IDENTIFIER 83 assertTrue assertTrue

SimpleName:IDENTIFIER 83 hasEdge hasEdge

SimpleName:IDENTIFIER 84 assertTrue assertTrue

SimpleName:IDENTIFIER 84 hasEdge hasEdge

SimpleName:IDENTIFIER 86 assertTrue assertTrue

SimpleName:IDENTIFIER 86 hasPath hasPath

SimpleName:IDENTIFIER 87 assertTrue assertTrue

SimpleName:IDENTIFIER 87 hasPath hasPath

SimpleName:IDENTIFIER 88 assertTrue assertTrue

SimpleName:IDENTIFIER 88 hasPath hasPath

SimpleName:IDENTIFIER 89 assertTrue assertTrue

SimpleName:IDENTIFIER 89 hasPath hasPath

SimpleName:IDENTIFIER 91 assertTrue assertTrue

SimpleName:IDENTIFIER 91 incomingEdges incomingEdges

SimpleName:IDENTIFIER 92 assertTrue assertTrue

SimpleName:IDENTIFIER 92 incomingEdges incomingEdges

SimpleName:IDENTIFIER 94 assertTrue assertTrue

SimpleName:IDENTIFIER 94 incomingPaths incomingPaths

SimpleName:IDENTIFIER 95 assertTrue assertTrue

SimpleName:IDENTIFIER 95 incomingPaths incomingPaths

SimpleName:IDENTIFIER 97 assertTrue assertTrue

SimpleName:IDENTIFIER 97 outgoingEdges outgoingEdges

SimpleName:IDENTIFIER 98 assertTrue assertTrue

SimpleName:IDENTIFIER 98 outgoingEdges outgoingEdges

SimpleName:IDENTIFIER 100 assertTrue assertTrue

SimpleName:IDENTIFIER 100 outgoingPaths outgoingPaths

SimpleName:IDENTIFIER 101 assertTrue assertTrue

SimpleName:IDENTIFIER 101 outgoingPaths outgoingPaths

SimpleName:IDENTIFIER 103 assertFalse assertFalse

SimpleName:IDENTIFIER 103 isAcyclic isAcyclic

SimpleName:IDENTIFIER 104 assertFalse assertFalse

SimpleName:IDENTIFIER 104 isForest isForest

SimpleName:IDENTIFIER 105 assertFalse assertFalse

SimpleName:IDENTIFIER 107 assertTrue assertTrue

SimpleName:IDENTIFIER 107 leafNodes leafNodes

SimpleName:IDENTIFIER 107 isEmpty isEmpty

SimpleName:IDENTIFIER 108 assertTrue assertTrue

SimpleName:IDENTIFIER 109 assertTrue assertTrue

SimpleName:IDENTIFIER 109 rootNodes rootNodes

SimpleName:IDENTIFIER 109 isEmpty isEmpty

SimpleName:IDENTIFIER 112 sortedNodesByReachability sortedNodesByReachability

@Test
public void testCycle() {
    final ADiGraph<String, ASimpleEdge<String>> graph = ADiGraph.create(Arrays.asList(edge("a", "b"), edge("b", "a")));
    assertTrue(eqSet(graph.edges(), edge("a", "b"), edge("b", "a")));
    assertTrue(graph.hasCycles());
    assertTrue(eqSet(graph.minimalCycles(), path("a", "b", "a"), path("b", "a", "b")));
    assertTrue(graph.hasEdge("a", "b"));
    assertTrue(graph.hasEdge("b", "a"));
    assertTrue(graph.hasPath("a", "b"));
    assertTrue(graph.hasPath("b", "a"));
    assertTrue(graph.hasPath("a", "a"));
    assertTrue(graph.hasPath("b", "b"));
    assertTrue(eqSet(graph.incomingEdges("a"), edge("b", "a")));
    assertTrue(eqSet(graph.incomingEdges("b"), edge("a", "b")));
    assertTrue(eqSet(graph.incomingPaths("a"), path("b", "a"), path("a", "b", "a")));
    assertTrue(eqSet(graph.incomingPaths("b"), path("a", "b"), path("b", "a", "b")));
    assertTrue(eqSet(graph.outgoingEdges("a"), edge("a", "b")));
    assertTrue(eqSet(graph.outgoingEdges("b"), edge("b", "a")));
    assertTrue(eqSet(graph.outgoingPaths("a"), path("a", "b"), path("a", "b", "a")));
    assertTrue(eqSet(graph.outgoingPaths("b"), path("b", "a"), path("b", "a", "b")));
    assertFalse(graph.isAcyclic());
    assertFalse(graph.isForest());
    assertFalse(graph.isTree());
    assertTrue(graph.leafNodes().isEmpty());
    assertTrue(eqSet(graph.nodes(), "a", "b"));
    assertTrue(graph.rootNodes().isEmpty());
    graph.sortedNodesByReachability();
}

@Test(expected = AGraphCircularityException.class)
public void testCycle() {
    final ADiGraph<String, ASimpleEdge<String>> graph = ADiGraph.create(Arrays.asList(edge("a", "b"), edge("b", "a")));
    assertTrue(eqSet(graph.edges(), edge("a", "b"), edge("b", "a")));
    assertTrue(graph.hasCycles());
    assertTrue(eqSet(graph.minimalCycles(), path("a", "b", "a"), path("b", "a", "b")));
    assertTrue(graph.hasEdge("a", "b"));
    assertTrue(graph.hasEdge("b", "a"));
    assertTrue(graph.hasPath("a", "b"));
    assertTrue(graph.hasPath("b", "a"));
    assertTrue(graph.hasPath("a", "a"));
    assertTrue(graph.hasPath("b", "b"));
    assertTrue(eqSet(graph.incomingEdges("a"), edge("b", "a")));
    assertTrue(eqSet(graph.incomingEdges("b"), edge("a", "b")));
    assertTrue(eqSet(graph.incomingPaths("a"), path("b", "a"), path("a", "b", "a")));
    assertTrue(eqSet(graph.incomingPaths("b"), path("a", "b"), path("b", "a", "b")));
    assertTrue(eqSet(graph.outgoingEdges("a"), edge("a", "b")));
    assertTrue(eqSet(graph.outgoingEdges("b"), edge("b", "a")));
    assertTrue(eqSet(graph.outgoingPaths("a"), path("a", "b"), path("a", "b", "a")));
    assertTrue(eqSet(graph.outgoingPaths("b"), path("b", "a"), path("b", "a", "b")));
    assertFalse(graph.isAcyclic());
    assertFalse(graph.isForest());
    assertFalse(graph.isTree());
    assertTrue(graph.leafNodes().isEmpty());
    assertTrue(eqSet(graph.nodes(), "a", "b"));
    assertTrue(graph.rootNodes().isEmpty());
    graph.sortedNodesByReachability();
}

package com.ajjpj.afoundation.collection.graph;

import com.ajjpj.afoundation.collection.immutable.AHashSet;
import com.ajjpj.afoundation.collection.immutable.AList;
import org.junit.Test;
import java.util.*;
import static org.junit.Assert.*;

@SuppressWarnings("unchecked")
public class adhoc_ADiGraphTest {

    private static ASimpleEdge<String> edge(String from, String to) {
        return new ASimpleEdge<>(from, to);
    }

    private static AEdgePath<String, ASimpleEdge<String>> path(String first, String... others) {
        final List<ASimpleEdge<String>> edges = new ArrayList<>();
        AHashSet<String> nodeSet = AHashSet.create(first);
        String from, to = first;
        for (String target : others) {
            nodeSet = nodeSet.with(target);
            from = to;
            to = target;
            edges.add(edge(from, to));
        }
        return new AEdgePath<>(AList.create(edges), nodeSet, to);
    }

    private <T> boolean eqSet(Iterable<T> coll1, T... values) {
        return eqSet(coll1, Arrays.asList(values));
    }

    private <T> boolean eqSet(Iterable<T> coll1, Iterable<T> coll2) {
        final Set<T> set1 = new HashSet<>();
        final Set<T> set2 = new HashSet<>();
        for (T o : coll1) {
            set1.add(o);
        }
        for (T o : coll2) {
            set2.add(o);
        }
        return set1.equals(set2);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 57 testNone testNone

SimpleName:IDENTIFIER 57 Exception Exception

SimpleName:IDENTIFIER 58 AOption AOption

@Test
public void testNone() throws Exception {
    final AOption<String> s = AOption.none();
    s.get();
}

@Test(expected = NoSuchElementException.class)
public void testNone() throws Exception {
    final AOption<String> s = AOption.none();
    s.get();
}

package com.ajjpj.afoundation.collection;

import com.ajjpj.afoundation.collection.immutable.AOption;
import com.ajjpj.afoundation.function.AFunction0NoThrow;
import com.ajjpj.afoundation.function.AFunction1;
import com.ajjpj.afoundation.function.APredicate;
import org.junit.Test;
import java.io.IOException;
import java.util.NoSuchElementException;
import static org.junit.Assert.*;

public class adhoc_AOptionTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 16 expected expected

SimpleName:IDENTIFIER 16 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 17 Exception Exception

SimpleName:IDENTIFIER 18 somefile somefile

SimpleName:IDENTIFIER 18 createTempFile createTempFile

StringLiteralExpr:LITERAL 18 "somefile" "somefile"

SimpleName:IDENTIFIER 19 compressedFile compressedFile

SimpleName:IDENTIFIER 19 CompressedFile CompressedFile

SimpleName:IDENTIFIER 19 somefile somefile

@Test(expected = IllegalArgumentException.class)
public void passingInAFileThatDoesNotHaveAFileNameEndingInGZOrBZ2ThrowsError() throws Exception {
    File somefile = File.createTempFile("somefile", ".tmp");
    CompressedFile compressedFile = new CompressedFile(somefile);
}

package com.lazerycode.selenium.extract;

import com.lazerycode.selenium.exceptions.InvalidFileTypeException;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import static com.lazerycode.selenium.extract.DownloadableFileType.TAR;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;

public class adhoc_CompressedFileTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 22 expected expected

SimpleName:IDENTIFIER 22 InvalidFileTypeException InvalidFileTypeException

SimpleName:IDENTIFIER 23 Exception Exception

SimpleName:IDENTIFIER 24 somefile somefile

SimpleName:IDENTIFIER 24 createTempFile createTempFile

StringLiteralExpr:LITERAL 24 "somefile" "somefile"

SimpleName:IDENTIFIER 25 compressedFile compressedFile

SimpleName:IDENTIFIER 25 CompressedFile CompressedFile

SimpleName:IDENTIFIER 25 somefile somefile

@Test(expected = InvalidFileTypeException.class)
public void passingInAFileThatDoesNotHaveAFileNameEndingInGZOrBZ2ButIsAKnownArchiveTypeThrowsError() throws Exception {
    File somefile = File.createTempFile("somefile", ".zip");
    CompressedFile compressedFile = new CompressedFile(somefile);
}


SimpleName:IDENTIFIER 137 expected expected

SimpleName:IDENTIFIER 137 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 138 tryToUntarAnArchiveThatIsNotATarFile tryToUntarAnArchiveThatIsNotATarFile

SimpleName:IDENTIFIER 138 Exception Exception

SimpleName:IDENTIFIER 139 fileExtractor fileExtractor

SimpleName:IDENTIFIER 139 FileExtractor FileExtractor

SimpleName:IDENTIFIER 140 fileExtractor fileExtractor

SimpleName:IDENTIFIER 140 extractFileFromArchive extractFileFromArchive

SimpleName:IDENTIFIER 140 getFile getFile

SimpleName:IDENTIFIER 140 tempDir tempDir

SimpleName:IDENTIFIER 140 BinaryType BinaryType

SimpleName:IDENTIFIER 140 PHANTOMJS PHANTOMJS

@Test(expected = IllegalArgumentException.class)
public void tryToUntarAnArchiveThatIsNotATarFile() throws Exception {
    FileExtractor fileExtractor = new FileExtractor(DO_NOT_OVERWRITE_EXISTING_FILES);
    fileExtractor.extractFileFromArchive(new File(test7ZipFile.getFile()), tempDir, BinaryType.PHANTOMJS);
}

package com.lazerycode.selenium.extract;

import com.lazerycode.selenium.repository.BinaryType;
import org.apache.commons.codec.digest.DigestUtils;
import org.hamcrest.Matcher;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertThat;

public class adhoc_FileExtractorTest {

    private static final boolean OVERWRITE_EXISTING_FILES = true;

    private static final boolean DO_NOT_OVERWRITE_EXISTING_FILES = false;

    private static final String VALID_HASH = "add36bb347a987b56e533c2034fd37b1";

    private static final String VALID_HASH_FOR_EXE = "0a263b6c69c81e137d74240350e293bc0ca604a3";

    private final URL test7ZipFile = this.getClass().getResource("/jetty/files/download.7z");

    private final URL testZipFile = this.getClass().getResource("/jetty/files/download.zip");

    private final URL testTarGZFile = this.getClass().getResource("/jetty/files/download.tar.gz");

    private final URL testTarBZ2File = this.getClass().getResource("/jetty/files/download.tar.bz2");

    private final URL textExeFile = this.getClass().getResource("/jetty/files/MicrosoftWebDriver.exe");

    private final URL testFirefoxZipFile = this.getClass().getResource("/jetty/files/FirefoxPortable.zip");

    private final URL testFirefoxTarFile = this.getClass().getResource("/jetty/files/FirefoxPortable.tar.bz2");

    private static File phantomJSTestFile;

    private static String tempDir;

    @Before
    public void initialiseFile() {
        String tempDirectory = System.getProperty("java.io.tmpdir");
        if (tempDirectory.endsWith(File.separator)) {
            tempDir = System.getProperty("java.io.tmpdir") + java.util.UUID.randomUUID();
        } else {
            tempDir = System.getProperty("java.io.tmpdir") + File.separator + java.util.UUID.randomUUID();
        }
        phantomJSTestFile = new File(tempDir + File.separator + "phantomjs");
    }

    @After
    public void cleanUp() {
        if (phantomJSTestFile.exists()) {
            assertThat(phantomJSTestFile.delete(), is(equalTo(true)));
        }
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 176 expected expected

SimpleName:IDENTIFIER 176 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 177 tryAndExtractFromAnUnsupportedArchive tryAndExtractFromAnUnsupportedArchive

SimpleName:IDENTIFIER 177 Exception Exception

SimpleName:IDENTIFIER 178 fileExtractor fileExtractor

SimpleName:IDENTIFIER 178 FileExtractor FileExtractor

SimpleName:IDENTIFIER 179 fileExtractor fileExtractor

SimpleName:IDENTIFIER 179 extractFileFromArchive extractFileFromArchive

SimpleName:IDENTIFIER 179 getFile getFile

SimpleName:IDENTIFIER 179 tempDir tempDir

SimpleName:IDENTIFIER 179 BinaryType BinaryType

SimpleName:IDENTIFIER 179 PHANTOMJS PHANTOMJS

@Test(expected = IllegalArgumentException.class)
public void tryAndExtractFromAnUnsupportedArchive() throws Exception {
    FileExtractor fileExtractor = new FileExtractor(DO_NOT_OVERWRITE_EXISTING_FILES);
    fileExtractor.extractFileFromArchive(new File(test7ZipFile.getFile()), tempDir, BinaryType.PHANTOMJS);
}


SimpleName:IDENTIFIER 79 expected expected

SimpleName:IDENTIFIER 79 MojoExecutionException MojoExecutionException

SimpleName:IDENTIFIER 80 downloadAFile downloadAFile

SimpleName:IDENTIFIER 80 Exception Exception

SimpleName:IDENTIFIER 81 fileDetails fileDetails

SimpleName:IDENTIFIER 81 DriverDetails DriverDetails

DriverDetails fileDetails = new DriverDetails()

DriverDetails fileDetails = new DriverDetails();

SimpleName:IDENTIFIER 82 fileDetails fileDetails

SimpleName:IDENTIFIER 82 fileLocation fileLocation

SimpleName:IDENTIFIER 82 downloadZipURL downloadZipURL

SimpleName:IDENTIFIER 83 fileDetails fileDetails

SimpleName:IDENTIFIER 83 hashType hashType

SimpleName:IDENTIFIER 84 fileDetails fileDetails

SimpleName:IDENTIFIER 85 driverMap driverMap

SimpleName:IDENTIFIER 85 DriverMap DriverMap

SimpleName:IDENTIFIER 86 driverMap driverMap

SimpleName:IDENTIFIER 86 getMapForDriverContext getMapForDriverContext

SimpleName:IDENTIFIER 86 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 86 GOOGLECHROME GOOGLECHROME

SimpleName:IDENTIFIER 86 fileDetails fileDetails

SimpleName:IDENTIFIER 87 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 87 DownloadHandler DownloadHandler

SimpleName:IDENTIFIER 87 downloadDirectory downloadDirectory

SimpleName:IDENTIFIER 87 oneRetryAttempt oneRetryAttempt

SimpleName:IDENTIFIER 87 connectTimeout connectTimeout

SimpleName:IDENTIFIER 87 readTimeout readTimeout

SimpleName:IDENTIFIER 87 doNotOverwriteFilesThatExist doNotOverwriteFilesThatExist

SimpleName:IDENTIFIER 87 checkFileHashes checkFileHashes

SimpleName:IDENTIFIER 87 doNotUseSystemProxy doNotUseSystemProxy

SimpleName:IDENTIFIER 87 getAllVersions getAllVersions

SimpleName:IDENTIFIER 88 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 88 downloadFile downloadFile

SimpleName:IDENTIFIER 88 fileDetails fileDetails

SimpleName:IDENTIFIER 88 checkFileHashes checkFileHashes

@Test(expected = MojoExecutionException.class)
public void downloadAFile() throws Exception {
    DriverDetails fileDetails = new DriverDetails();
    fileDetails.fileLocation = downloadZipURL;
    fileDetails.hashType = SHA1;
    fileDetails.hash = "";
    DriverMap driverMap = new DriverMap();
    driverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)).put("2.13", fileDetails);
    DownloadHandler downloadTestFile = new DownloadHandler(null, downloadDirectory, oneRetryAttempt, connectTimeout, readTimeout, null, doNotOverwriteFilesThatExist, checkFileHashes, doNotUseSystemProxy, getAllVersions);
    downloadTestFile.downloadFile(fileDetails, checkFileHashes);
}

package com.lazerycode.selenium.download;

import com.lazerycode.selenium.repository.DriverContext;
import com.lazerycode.selenium.repository.DriverDetails;
import com.lazerycode.selenium.repository.DriverMap;
import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.junit.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import static com.lazerycode.selenium.hash.HashType.SHA1;
import static com.lazerycode.selenium.repository.BinaryType.GOOGLECHROME;
import static com.lazerycode.selenium.repository.BinaryType.PHANTOMJS;
import static com.lazerycode.selenium.repository.DriverContext.binaryDataFor;
import static com.lazerycode.selenium.repository.OperatingSystem.OSX;
import static com.lazerycode.selenium.repository.SystemArchitecture.ARCHITECTURE_64_BIT;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.junit.Assert.assertThat;

public class adhoc_DownloadHandlerTest {

    private static final String webServerAddress = "http://localhost";

    private static final int webServerPort = 9081;

    private final String downloadDirectoryPath = System.getProperty("java.io.tmpdir") + File.separator + "download_test_file_dir";

    private final String rootStandaloneServerDirectoryPath = System.getProperty("java.io.tmpdir") + File.separator + "server_test_file_dir";

    private final String expectedDownloadedFilePath = downloadDirectoryPath + File.separator + "download.zip";

    private final int oneRetryAttempt = 1;

    private final int connectTimeout = 15000;

    private final int readTimeout = 15000;

    private final boolean overwriteFilesThatExist = true;

    private final boolean doNotOverwriteFilesThatExist = false;

    private final boolean doNotCheckFileHashes = false;

    private final boolean checkFileHashes = true;

    private final boolean doNotUseSystemProxy = false;

    private final boolean getAllVersions = false;

    private static final String validSHA1Hash = "8604c05969a0eefa0edf0d71ae809310832afdc7";

    private static final JettyServer localWebServer = new JettyServer();

    private static final String webServerURL = webServerAddress + ":" + webServerPort;

    private static DriverMap validDriverMap = new DriverMap();

    private static DriverDetails validFileDetails = new DriverDetails();

    private static File downloadDirectory;

    private static File rootStandaloneServerDirectory;

    private static URL downloadZipURL;

    @BeforeClass
    public static void start() throws Exception {
        localWebServer.startJettyServer(webServerPort);
        downloadZipURL = new URL(webServerURL + "/files/download.zip");
        validFileDetails.fileLocation = downloadZipURL;
        validFileDetails.hashType = SHA1;
        validFileDetails.hash = validSHA1Hash;
        validDriverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)).put("2.13", validFileDetails);
    }

    @AfterClass
    public static void stop() throws Exception {
        localWebServer.stopJettyServer();
    }

    @Before
    public void instantiateTestFiles() throws Exception {
        downloadDirectory = new File(downloadDirectoryPath);
        rootStandaloneServerDirectory = new File(rootStandaloneServerDirectoryPath);
    }

    @After
    public void cleanUpFiles() throws IOException {
        if (downloadDirectory.exists())
            FileUtils.deleteDirectory(downloadDirectory);
        if (rootStandaloneServerDirectory.exists())
            FileUtils.deleteDirectory(rootStandaloneServerDirectory);
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 91 expected expected

SimpleName:IDENTIFIER 91 MojoExecutionException MojoExecutionException

SimpleName:IDENTIFIER 92 invalidHashCheck invalidHashCheck

SimpleName:IDENTIFIER 92 Exception Exception

SimpleName:IDENTIFIER 93 fileDetails fileDetails

SimpleName:IDENTIFIER 93 DriverDetails DriverDetails

DriverDetails fileDetails = new DriverDetails()

DriverDetails fileDetails = new DriverDetails();

SimpleName:IDENTIFIER 94 fileDetails fileDetails

SimpleName:IDENTIFIER 94 fileLocation fileLocation

SimpleName:IDENTIFIER 94 downloadZipURL downloadZipURL

SimpleName:IDENTIFIER 95 fileDetails fileDetails

SimpleName:IDENTIFIER 95 hashType hashType

SimpleName:IDENTIFIER 96 fileDetails fileDetails

StringLiteralExpr:LITERAL 96 "invalidHash" "invalidHash"

SimpleName:IDENTIFIER 97 driverMap driverMap

SimpleName:IDENTIFIER 97 DriverMap DriverMap

SimpleName:IDENTIFIER 98 driverMap driverMap

SimpleName:IDENTIFIER 98 getMapForDriverContext getMapForDriverContext

SimpleName:IDENTIFIER 98 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 98 GOOGLECHROME GOOGLECHROME

SimpleName:IDENTIFIER 98 fileDetails fileDetails

SimpleName:IDENTIFIER 99 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 99 DownloadHandler DownloadHandler

SimpleName:IDENTIFIER 99 downloadDirectory downloadDirectory

SimpleName:IDENTIFIER 99 oneRetryAttempt oneRetryAttempt

SimpleName:IDENTIFIER 99 connectTimeout connectTimeout

SimpleName:IDENTIFIER 99 readTimeout readTimeout

SimpleName:IDENTIFIER 99 doNotOverwriteFilesThatExist doNotOverwriteFilesThatExist

SimpleName:IDENTIFIER 99 checkFileHashes checkFileHashes

SimpleName:IDENTIFIER 99 doNotUseSystemProxy doNotUseSystemProxy

SimpleName:IDENTIFIER 99 getAllVersions getAllVersions

SimpleName:IDENTIFIER 100 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 100 downloadFile downloadFile

SimpleName:IDENTIFIER 100 fileDetails fileDetails

SimpleName:IDENTIFIER 100 checkFileHashes checkFileHashes

@Test(expected = MojoExecutionException.class)
public void invalidHashCheck() throws Exception {
    DriverDetails fileDetails = new DriverDetails();
    fileDetails.fileLocation = downloadZipURL;
    fileDetails.hashType = SHA1;
    fileDetails.hash = "invalidHash";
    DriverMap driverMap = new DriverMap();
    driverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)).put("2.13", fileDetails);
    DownloadHandler downloadTestFile = new DownloadHandler(null, downloadDirectory, oneRetryAttempt, connectTimeout, readTimeout, null, doNotOverwriteFilesThatExist, checkFileHashes, doNotUseSystemProxy, getAllVersions);
    downloadTestFile.downloadFile(fileDetails, checkFileHashes);
}

SimpleName:IDENTIFIER 111 expected expected

SimpleName:IDENTIFIER 111 MojoExecutionException MojoExecutionException

SimpleName:IDENTIFIER 112 tryToDownloadAnInvalidFile tryToDownloadAnInvalidFile

SimpleName:IDENTIFIER 112 Exception Exception

SimpleName:IDENTIFIER 113 fileDetails fileDetails

SimpleName:IDENTIFIER 113 DriverDetails DriverDetails

DriverDetails fileDetails = new DriverDetails()

DriverDetails fileDetails = new DriverDetails();

SimpleName:IDENTIFIER 114 fileDetails fileDetails

SimpleName:IDENTIFIER 114 fileLocation fileLocation

SimpleName:IDENTIFIER 114 webServerURL webServerURL

new URL(webServerURL + "/files/null/download.zip")

SimpleName:IDENTIFIER 115 fileDetails fileDetails

SimpleName:IDENTIFIER 115 hashType hashType

SimpleName:IDENTIFIER 116 fileDetails fileDetails

SimpleName:IDENTIFIER 117 driverMap driverMap

SimpleName:IDENTIFIER 117 DriverMap DriverMap

SimpleName:IDENTIFIER 118 driverMap driverMap

SimpleName:IDENTIFIER 118 getMapForDriverContext getMapForDriverContext

SimpleName:IDENTIFIER 118 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 118 GOOGLECHROME GOOGLECHROME

SimpleName:IDENTIFIER 118 fileDetails fileDetails

SimpleName:IDENTIFIER 119 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 119 DownloadHandler DownloadHandler

SimpleName:IDENTIFIER 119 downloadDirectory downloadDirectory

SimpleName:IDENTIFIER 119 connectTimeout connectTimeout

SimpleName:IDENTIFIER 119 readTimeout readTimeout

SimpleName:IDENTIFIER 119 doNotOverwriteFilesThatExist doNotOverwriteFilesThatExist

SimpleName:IDENTIFIER 119 checkFileHashes checkFileHashes

SimpleName:IDENTIFIER 119 doNotUseSystemProxy doNotUseSystemProxy

SimpleName:IDENTIFIER 119 getAllVersions getAllVersions

SimpleName:IDENTIFIER 120 downloadTestFile downloadTestFile

SimpleName:IDENTIFIER 120 downloadFile downloadFile

SimpleName:IDENTIFIER 120 fileDetails fileDetails

SimpleName:IDENTIFIER 120 checkFileHashes checkFileHashes

@Test(expected = MojoExecutionException.class)
public void tryToDownloadAnInvalidFile() throws Exception {
    DriverDetails fileDetails = new DriverDetails();
    fileDetails.fileLocation = new URL(webServerURL + "/files/null/download.zip");
    fileDetails.hashType = SHA1;
    fileDetails.hash = validSHA1Hash;
    DriverMap driverMap = new DriverMap();
    driverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT)).put("2.13", fileDetails);
    DownloadHandler downloadTestFile = new DownloadHandler(null, downloadDirectory, 3, connectTimeout, readTimeout, null, doNotOverwriteFilesThatExist, checkFileHashes, doNotUseSystemProxy, getAllVersions);
    downloadTestFile.downloadFile(fileDetails, checkFileHashes);
}


SimpleName:IDENTIFIER 49 expected expected

SimpleName:IDENTIFIER 49 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 51 driverMap driverMap

SimpleName:IDENTIFIER 51 DriverMap DriverMap

SimpleName:IDENTIFIER 52 driverMap driverMap

SimpleName:IDENTIFIER 52 getDetailsForVersionOfDriverContext getDetailsForVersionOfDriverContext

SimpleName:IDENTIFIER 52 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 52 GOOGLECHROME GOOGLECHROME

@Test(expected = IllegalArgumentException.class)
public void willThrowAnExceptionWhenTryingToGetSpecificVersionMapForInvalidContext() {
    DriverMap driverMap = new DriverMap();
    driverMap.getDetailsForVersionOfDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT), "4");
}

package com.lazerycode.selenium.repository;

import com.lazerycode.selenium.hash.HashType;
import org.junit.Test;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
import static com.lazerycode.selenium.repository.BinaryType.GOOGLECHROME;
import static com.lazerycode.selenium.repository.BinaryType.OPERACHROMIUM;
import static com.lazerycode.selenium.repository.DriverContext.binaryDataFor;
import static com.lazerycode.selenium.repository.OperatingSystem.OSX;
import static com.lazerycode.selenium.repository.OperatingSystem.WINDOWS;
import static com.lazerycode.selenium.repository.SystemArchitecture.ARCHITECTURE_32_BIT;
import static com.lazerycode.selenium.repository.SystemArchitecture.ARCHITECTURE_64_BIT;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsInstanceOf.instanceOf;

public class adhoc_DriverMapTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 55 expected expected

SimpleName:IDENTIFIER 55 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 57 driverMap driverMap

SimpleName:IDENTIFIER 57 DriverMap DriverMap

SimpleName:IDENTIFIER 58 originalVersionMap originalVersionMap

SimpleName:IDENTIFIER 58 driverMap driverMap

SimpleName:IDENTIFIER 58 getMapForDriverContext getMapForDriverContext

SimpleName:IDENTIFIER 58 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 58 GOOGLECHROME GOOGLECHROME

SimpleName:IDENTIFIER 59 originalVersionMap originalVersionMap

SimpleName:IDENTIFIER 59 DriverDetails DriverDetails

SimpleName:IDENTIFIER 61 driverMap driverMap

SimpleName:IDENTIFIER 61 getDetailsForVersionOfDriverContext getDetailsForVersionOfDriverContext

SimpleName:IDENTIFIER 61 binaryDataFor binaryDataFor

SimpleName:IDENTIFIER 61 GOOGLECHROME GOOGLECHROME

@Test(expected = NoSuchElementException.class)
public void willThrowAnExceptionWhenTryingToGetAnInvalidVersion() {
    DriverMap driverMap = new DriverMap();
    Map originalVersionMap = driverMap.getMapForDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT));
    originalVersionMap.put("2.13", new DriverDetails());
    driverMap.getDetailsForVersionOfDriverContext(binaryDataFor(OSX, GOOGLECHROME, ARCHITECTURE_64_BIT), "4");
}


SimpleName:IDENTIFIER 15 expected expected

SimpleName:IDENTIFIER 15 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 17 OperatingSystem OperatingSystem

SimpleName:IDENTIFIER 17 getOperatingSystem getOperatingSystem

StringLiteralExpr:LITERAL 17 "foo" "foo"

@Test(expected = IllegalArgumentException.class)
public void willThrowAnIllegalArgumentExceptionIfOperatingSystemIsNotValid() {
    OperatingSystem.getOperatingSystem("foo");
}

package com.lazerycode.selenium.repository;

import org.junit.Test;
import java.util.HashSet;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.junit.Assert.assertThat;

public class adhoc_OperatingSystemTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 37 expected expected

SimpleName:IDENTIFIER 37 NullPointerException NullPointerException

SimpleName:IDENTIFIER 38 testCheckNotNullWithNull testCheckNotNullWithNull

SimpleName:IDENTIFIER 39 Preconditions Preconditions

SimpleName:IDENTIFIER 39 checkNotNull checkNotNull

{
    Preconditions.checkNotNull(null);
}

@Test(expected = NullPointerException.class)
public void testCheckNotNullWithNull() {
    Preconditions.checkNotNull(null);
}

{
    Preconditions.checkNotNull(null);
}

package com.stackify.api.common.util;

import org.junit.Test;

public class adhoc_PreconditionsTest {
    /*TEST PLACEHOLDER*/
}

testCheckNotNullWithNull


SimpleName:IDENTIFIER 53 expected expected

SimpleName:IDENTIFIER 53 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 54 testCheckArgumentFalse testCheckArgumentFalse

SimpleName:IDENTIFIER 55 Preconditions Preconditions

SimpleName:IDENTIFIER 55 checkArgument checkArgument

BooleanLiteralExpr:LITERAL 55 false false

{
    Preconditions.checkArgument(false);
}

@Test(expected = IllegalArgumentException.class)
public void testCheckArgumentFalse() {
    Preconditions.checkArgument(false);
}

{
    Preconditions.checkArgument(false);
}

testCheckArgumentFalse


SimpleName:IDENTIFIER 29 expected expected

SimpleName:IDENTIFIER 29 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 createWithNull createWithNull

SimpleName:IDENTIFIER 31 createInstance createInstance

@Test(expected = IllegalArgumentException.class)
public void createWithNull() {
    createInstance(null);
}

package com.bsb.common.vaadin.embed.util;

import org.junit.Test;
import java.util.Properties;
import static org.junit.Assert.assertEquals;

public class adhoc_PropertiesHelperTest {

    private PropertiesHelper createInstance(Properties properties) {
        return new PropertiesHelper(properties);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 42 testGetTopic testGetTopic

SimpleName:IDENTIFIER 44 Javametrics Javametrics

SimpleName:IDENTIFIER 44 getInstance getInstance

SimpleName:IDENTIFIER 44 getTopic getTopic

"Exception expected for Javametrics.getInstance().getTopic(null)"

"Exception expected for Javametrics.getInstance().getTopic(\"\")"

@Test
public void testGetTopic() {
    Javametrics.getInstance().getTopic(null);
}

@Test(expected = JavametricsException.class)
public void testGetTopic() {
    Javametrics.getInstance().getTopic(null);
}

package com.ibm.javametrics;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.junit.Test;

public class adhoc_JavametricsTest {
    /*TEST PLACEHOLDER*/
}

Test method for
{@link com.ibm.javametrics.Javametrics#getTopic(java.lang.String)}.


SimpleName:IDENTIFIER 50 expected expected

SimpleName:IDENTIFIER 50 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 51 testObfuscateInvalidVersion testObfuscateInvalidVersion

SimpleName:IDENTIFIER 52 obfuscate obfuscate

SimpleName:IDENTIFIER 52 masterKey masterKey

@Test(expected = IllegalArgumentException.class)
public void testObfuscateInvalidVersion() {
    String ob = engine.obfuscate(masterKey, data, 123);
}

package rs.in.zivanovic.obfuscator;

import java.nio.charset.StandardCharsets;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;

public class adhoc_JPasswordObfuscatorTest {

    private static final char[] masterKey = "masterKey".toCharArray();

    private static final char[] masterKey1 = "masterKey1".toCharArray();

    private static final char[] masterKey2 = "masterKey2".toCharArray();

    private static final byte[] data = "data".getBytes(StandardCharsets.UTF_8);

    private final JPasswordObfuscator engine = new JPasswordObfuscator();
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 81 expected expected

SimpleName:IDENTIFIER 81 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 82 testUnobfuscatedInvalidVersion testUnobfuscatedInvalidVersion

SimpleName:IDENTIFIER 83 Unobfuscated Unobfuscated

SimpleName:IDENTIFIER 83 asString asString

@Test(expected = IllegalArgumentException.class)
public void testUnobfuscatedInvalidVersion() {
    String o = new Unobfuscated(key, "$rizobf$-1$F6Krv4H91RE=$NjytmuPjmfZbwQjqUWcbDg==").asString();
}

package rs.in.zivanovic.obfuscator;

import java.nio.charset.StandardCharsets;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
import org.junit.Test;

public class adhoc_NewApiTest {

    private static final char[] key = "key".toCharArray();

    private static final String dataS = "data";

    private static final byte[] dataBA = dataS.getBytes(StandardCharsets.UTF_8);
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 33 faultyHeadersShouldBreak faultyHeadersShouldBreak

SimpleName:IDENTIFIER 34 headersAndValues headersAndValues

SimpleName:IDENTIFIER 36 headers headers

SimpleName:IDENTIFIER 36 HeaderUtil HeaderUtil

SimpleName:IDENTIFIER 36 getInstance getInstance

SimpleName:IDENTIFIER 37 createHeadersFromString createHeadersFromString

SimpleName:IDENTIFIER 37 headersAndValues headersAndValues

@Test
public void faultyHeadersShouldBreak() {
    String headersAndValues = "header1value1";
    Map<String, String> headers = HeaderUtil.getInstance().createHeadersFromString(headersAndValues);
}

@Test(expected = IllegalArgumentException.class)
public void faultyHeadersShouldBreak() {
    String headersAndValues = "header1value1";
    Map<String, String> headers = HeaderUtil.getInstance().createHeadersFromString(headersAndValues);
}

package com.soulgalore.crawler.util;

import static org.junit.Assert.*;
import static org.hamcrest.Matchers.is;
import java.util.Map;
import java.util.Set;
import org.apache.http.Header;
import org.junit.Test;

public class adhoc_WhenAHeaderIsParsed {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 18 authFromFaultyStringShouldNotWork authFromFaultyStringShouldNotWork

SimpleName:IDENTIFIER 20 createAuthsFromString createAuthsFromString

"If the auth are wrongly configured, an exception should be thrown"

@Test
public void authFromFaultyStringShouldNotWork() {
    util.createAuthsFromString("soulislove.com:80:name1password1");
}

@Test(expected = IllegalArgumentException.class)
public void authFromFaultyStringShouldNotWork() {
    util.createAuthsFromString("soulislove.com:80:name1password1");
}

package com.soulgalore.crawler.util;

import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.notNullValue;
import java.util.Set;
import org.junit.Test;

public class adhoc_WhenAnAuthObjectIsCreated {

    private AuthUtil util = AuthUtil.getInstance();
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 27 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 27 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullHtml() {
    final String html = null;
    final String url = "http://some.host.com";
    HtmlValidator.validate(html, url);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_HtmlValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 30 expected expected

SimpleName:IDENTIFIER 30 IllegalArgumentException IllegalArgumentException

StringLiteralExpr:LITERAL 32 "foo" "foo"

SimpleName:IDENTIFIER 34 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 34 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullUrl() {
    final String html = "foo";
    final String url = null;
    HtmlValidator.validate(html, url);
}

SimpleName:IDENTIFIER 37 expected expected

SimpleName:IDENTIFIER 37 IllegalArgumentException IllegalArgumentException

StringLiteralExpr:LITERAL 39 "<a>" "<a>"

SimpleName:IDENTIFIER 41 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 41 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_HtmlLessThanMinimumLength() {
    final String html = "<a>";
    final String url = "http://some.host.com";
    HtmlValidator.validate(html, url);
}

SimpleName:IDENTIFIER 44 expected expected

SimpleName:IDENTIFIER 44 IllegalArgumentException IllegalArgumentException

StringLiteralExpr:LITERAL 46 "foo" "foo"

SimpleName:IDENTIFIER 48 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 48 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_UrlLessThanMinimumLength() {
    final String html = "foo";
    final String url = "http://";
    HtmlValidator.validate(html, url);
}

SimpleName:IDENTIFIER 51 expected expected

SimpleName:IDENTIFIER 51 IllegalArgumentException IllegalArgumentException

StringLiteralExpr:LITERAL
53
"     <a>\t   \t\n"
"     <a>\t   \t\n"

final String html = "     <a>\t   \t\n";

SimpleName:IDENTIFIER 55 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 55 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_HtmlTrimmedLessThanMinimumLength() {
    final String html = "     <a>\t   \t\n";
    final String url = "http://some.host.com";
    HtmlValidator.validate(html, url);
}

SimpleName:IDENTIFIER 58 expected expected

SimpleName:IDENTIFIER 58 IllegalArgumentException IllegalArgumentException

StringLiteralExpr:LITERAL 60 "foo" "foo"

StringLiteralExpr:LITERAL
61
"\t\t\t\thttp://    \r\n"
"\t\t\t\thttp://    \r\n"

SimpleName:IDENTIFIER 62 HtmlValidator HtmlValidator

SimpleName:IDENTIFIER 62 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_UrlTrimmedLessThanMinimumLength() {
    final String html = "foo";
    final String url = "\t\t\t\thttp://    \r\n";
    HtmlValidator.validate(html, url);
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 ApiHostNameValidator ApiHostNameValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullHostName() {
    ApiHostNameValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_ApiHostNameValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 ApiHostNameValidator ApiHostNameValidator

SimpleName:IDENTIFIER 30 validate validate

{
    ApiHostNameValidator.validate("a");
}

@Test(expected = IllegalArgumentException.class)
public void testValidate_HostNameLessThanMinimumLength() {
    ApiHostNameValidator.validate("a");
}

{
    ApiHostNameValidator.validate("a");
}

SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 35 ApiHostNameValidator ApiHostNameValidator

SimpleName:IDENTIFIER 35 validate validate

StringLiteralExpr:LITERAL
35
"\ta\r\n  "
"\ta\r\n  "

@Test(expected = IllegalArgumentException.class)
public void testValidate_HostNameTrimmedLessThanMinimumLength() {
    ApiHostNameValidator.validate("\ta\r\n  ");
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 ApiKeyValidator ApiKeyValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullApiKey() {
    ApiKeyValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_ApiKeyValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 ApiKeyValidator ApiKeyValidator

SimpleName:IDENTIFIER 30 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_ApiKeyLessThanMinimumLength() {
    ApiKeyValidator.validate("a");
}

SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 35 ApiKeyValidator ApiKeyValidator

SimpleName:IDENTIFIER 35 validate validate

StringLiteralExpr:LITERAL
35
"\ta\r\n  "
"\ta\r\n  "

@Test(expected = IllegalArgumentException.class)
public void testValidate_ApiKeyTrimmedLessThanMinimumLength() {
    ApiKeyValidator.validate("\ta\r\n  ");
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 ApiKeyResourceValidator ApiKeyResourceValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_ResourceDoesNotExist() {
    ApiKeyResourceValidator.validate("aaaaaa11111111aaaaa.txt");
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_ApiKeyResourceValidatorTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 25 TextValidator TextValidator

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullText() {
    TextValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_TextValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 TextValidator TextValidator

SimpleName:IDENTIFIER 30 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_TextLessThanMinimumLength() {
    TextValidator.validate("a");
}

SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 35 TextValidator TextValidator

SimpleName:IDENTIFIER 35 validate validate

StringLiteralExpr:LITERAL
35
"\ta\r\n  "
"\ta\r\n  "

{
    TextValidator.validate("\ta\r\n  ");
}

@Test(expected = IllegalArgumentException.class)
public void testValidate_TextTrimmedLessThanMinimumLength() {
    TextValidator.validate("\ta\r\n  ");
}

{
    TextValidator.validate("\ta\r\n  ");
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 UrlValidator UrlValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullUrl() {
    UrlValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_UrlValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 UrlValidator UrlValidator

SimpleName:IDENTIFIER 30 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_UrlLessThanMinimumLength() {
    UrlValidator.validate("a");
}

SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 35 UrlValidator UrlValidator

SimpleName:IDENTIFIER 35 validate validate

StringLiteralExpr:LITERAL
35
"\ta\r\n  "
"\ta\r\n  "

{
    UrlValidator.validate("\ta\r\n  ");
}

@Test(expected = IllegalArgumentException.class)
public void testValidate_UrlTrimmedLessThanMinimumLength() {
    UrlValidator.validate("\ta\r\n  ");
}

{
    UrlValidator.validate("\ta\r\n  ");
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 OutputDocumentValidator OutputDocumentValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullOutputDocument() {
    OutputDocumentValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_OutputDocumentValidatorTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 34 IOException IOException

SimpleName:IDENTIFIER 35 outputMode outputMode

StringLiteralExpr:LITERAL 35 "foo" "foo"

SimpleName:IDENTIFIER 37 OutputModeValidator OutputModeValidator

SimpleName:IDENTIFIER 37 validate validate

SimpleName:IDENTIFIER 37 outputMode outputMode

@Test(expected = IllegalArgumentException.class)
public void testValidate_Unknown() throws IOException {
    final String outputMode = "foo";
    OutputModeValidator.validate(outputMode);
}

package com.likethecolor.alchemy.api.validator;

import com.likethecolor.alchemy.api.Constants;
import org.junit.Test;
import java.io.IOException;

public class adhoc_OutputModeValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 40 expected expected

SimpleName:IDENTIFIER 40 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 41 IOException IOException

SimpleName:IDENTIFIER 42 outputMode outputMode

SimpleName:IDENTIFIER 44 OutputModeValidator OutputModeValidator

SimpleName:IDENTIFIER 44 validate validate

SimpleName:IDENTIFIER 44 outputMode outputMode

@Test(expected = IllegalArgumentException.class)
public void testValidate_Null() throws IOException {
    final String outputMode = null;
    OutputModeValidator.validate(outputMode);
}

SimpleName:IDENTIFIER 47 expected expected

SimpleName:IDENTIFIER 47 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 48 IOException IOException

SimpleName:IDENTIFIER 49 outputMode outputMode

SimpleName:IDENTIFIER 51 OutputModeValidator OutputModeValidator

SimpleName:IDENTIFIER 51 validate validate

SimpleName:IDENTIFIER 51 outputMode outputMode

@Test(expected = IllegalArgumentException.class)
public void testValidate_EmptyString() throws IOException {
    final String outputMode = "";
    OutputModeValidator.validate(outputMode);
}

SimpleName:IDENTIFIER 54 expected expected

SimpleName:IDENTIFIER 54 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 55 IOException IOException

SimpleName:IDENTIFIER 56 outputMode outputMode

StringLiteralExpr:LITERAL
56
"\t\t    \r\n"
"\t\t    \r\n"

final String outputMode = "\t\t    \r\n"

final String outputMode = "\t\t    \r\n";

SimpleName:IDENTIFIER 58 OutputModeValidator OutputModeValidator

SimpleName:IDENTIFIER 58 validate validate

SimpleName:IDENTIFIER 58 outputMode outputMode

@Test(expected = IllegalArgumentException.class)
public void testValidate_EmptyWhiteSpaceString() throws IOException {
    final String outputMode = "\t\t    \r\n";
    OutputModeValidator.validate(outputMode);
}


SimpleName:IDENTIFIER 23 expected expected

SimpleName:IDENTIFIER 23 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 25 ApiKeyFileNameValidator ApiKeyFileNameValidator

SimpleName:IDENTIFIER 25 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_NullApiKeyFileName() {
    ApiKeyFileNameValidator.validate(null);
}

package com.likethecolor.alchemy.api.validator;

import org.junit.Test;

public class adhoc_ApiKeyFileNameValidatorTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 30 ApiKeyFileNameValidator ApiKeyFileNameValidator

SimpleName:IDENTIFIER 30 validate validate

@Test(expected = IllegalArgumentException.class)
public void testValidate_HostNameEqualsMinimumLength() {
    ApiKeyFileNameValidator.validate("");
}

SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 35 ApiKeyFileNameValidator ApiKeyFileNameValidator

SimpleName:IDENTIFIER 35 validate validate

StringLiteralExpr:LITERAL
35
"\t  \r\n"
"\t  \r\n"

@Test(expected = IllegalArgumentException.class)
public void testValidate_HostNameTrimmedEqualsMinimumLength() {
    ApiKeyFileNameValidator.validate("\t  \r\n");
}


SimpleName:IDENTIFIER 90 expected expected

SimpleName:IDENTIFIER 90 CborException CborException

SimpleName:IDENTIFIER 91 CborException CborException

SimpleName:IDENTIFIER 92 inputStream inputStream

SimpleName:IDENTIFIER 92 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 93 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 93 inputStream inputStream

SimpleName:IDENTIFIER 93 callGetLengthAsBigInteger callGetLengthAsBigInteger

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved1() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLengthAsBigInteger(28);
    fail();
}

package co.nstant.in.cbor.decoder;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.math.BigInteger;
import java.util.Arrays;
import org.junit.Test;
import co.nstant.in.cbor.CborException;
import co.nstant.in.cbor.model.UnicodeString;

public class adhoc_AbstractDecoderTest {

    private class TestableAbstractDecoder extends AbstractDecoder<UnicodeString> {

        public TestableAbstractDecoder(InputStream inputStream) {
            super(null, inputStream);
        }

        public void callNextSymbol() throws CborException {
            nextSymbol();
        }

        public byte[] callNextSymbols(int amount) throws CborException {
            return nextSymbols(amount);
        }

        public long callGetLength(int initialByte) throws CborException {
            return getLength(initialByte);
        }

        public BigInteger callGetLengthAsBigInteger(int initialByte) throws CborException {
            return getLengthAsBigInteger(initialByte);
        }

        @Override
        public UnicodeString decode(int initialByte) throws CborException {
            return null;
        }
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 97 expected expected

SimpleName:IDENTIFIER 97 CborException CborException

SimpleName:IDENTIFIER 98 CborException CborException

SimpleName:IDENTIFIER 99 inputStream inputStream

SimpleName:IDENTIFIER 99 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 100 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 100 inputStream inputStream

SimpleName:IDENTIFIER 100 callGetLengthAsBigInteger callGetLengthAsBigInteger

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved2() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLengthAsBigInteger(29);
    fail();
}

SimpleName:IDENTIFIER 104 expected expected

SimpleName:IDENTIFIER 104 CborException CborException

SimpleName:IDENTIFIER 105 CborException CborException

SimpleName:IDENTIFIER 106 inputStream inputStream

SimpleName:IDENTIFIER 106 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 107 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 107 inputStream inputStream

SimpleName:IDENTIFIER 107 callGetLengthAsBigInteger callGetLengthAsBigInteger

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved3() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLengthAsBigInteger(30);
    fail();
}


SimpleName:IDENTIFIER 111 expected expected

SimpleName:IDENTIFIER 111 CborException CborException

SimpleName:IDENTIFIER 112 CborException CborException

SimpleName:IDENTIFIER 113 inputStream inputStream

SimpleName:IDENTIFIER 113 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 114 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 114 inputStream inputStream

SimpleName:IDENTIFIER 114 callGetLength callGetLength

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved4() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLength(28);
    fail();
}

SimpleName:IDENTIFIER 118 expected expected

SimpleName:IDENTIFIER 118 CborException CborException

SimpleName:IDENTIFIER 119 CborException CborException

SimpleName:IDENTIFIER 120 inputStream inputStream

SimpleName:IDENTIFIER 120 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 121 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 121 inputStream inputStream

SimpleName:IDENTIFIER 121 callGetLength callGetLength

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved5() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLength(29);
    fail();
}

SimpleName:IDENTIFIER 125 expected expected

SimpleName:IDENTIFIER 125 CborException CborException

SimpleName:IDENTIFIER 126 CborException CborException

SimpleName:IDENTIFIER 127 inputStream inputStream

SimpleName:IDENTIFIER 127 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 128 TestableAbstractDecoder TestableAbstractDecoder

SimpleName:IDENTIFIER 128 inputStream inputStream

SimpleName:IDENTIFIER 128 callGetLength callGetLength

@Test(expected = CborException.class)
public void shouldThrowExceptionOnReserved6() throws CborException {
    InputStream inputStream = new ByteArrayInputStream(new byte[] {});
    new TestableAbstractDecoder(inputStream).callGetLength(30);
    fail();
}


SimpleName:IDENTIFIER 11 expected expected

SimpleName:IDENTIFIER 11 CborException CborException

SimpleName:IDENTIFIER 12 shouldThrowIfNumeratorIsNull shouldThrowIfNumeratorIsNull

SimpleName:IDENTIFIER 12 CborException CborException

SimpleName:IDENTIFIER 13 RationalNumber RationalNumber

SimpleName:IDENTIFIER 13 UnsignedInteger UnsignedInteger

@Test(expected = CborException.class)
public void shouldThrowIfNumeratorIsNull() throws CborException {
    new RationalNumber(null, new UnsignedInteger(1));
}

package co.nstant.in.cbor.model;

import static org.junit.Assert.assertEquals;
import org.junit.Test;
import co.nstant.in.cbor.CborException;

public class adhoc_RationalNumberTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 16 expected expected

SimpleName:IDENTIFIER 16 CborException CborException

SimpleName:IDENTIFIER 17 shouldThrowIfDenominatorIsNull shouldThrowIfDenominatorIsNull

SimpleName:IDENTIFIER 17 CborException CborException

SimpleName:IDENTIFIER 18 RationalNumber RationalNumber

SimpleName:IDENTIFIER 18 UnsignedInteger UnsignedInteger

@Test(expected = CborException.class)
public void shouldThrowIfDenominatorIsNull() throws CborException {
    new RationalNumber(new UnsignedInteger(1), null);
}

SimpleName:IDENTIFIER 21 expected expected

SimpleName:IDENTIFIER 21 CborException CborException

SimpleName:IDENTIFIER 22 shouldThrowIfDenominatorIsZero shouldThrowIfDenominatorIsZero

SimpleName:IDENTIFIER 22 CborException CborException

SimpleName:IDENTIFIER 23 RationalNumber RationalNumber

SimpleName:IDENTIFIER 23 UnsignedInteger UnsignedInteger

@Test(expected = CborException.class)
public void shouldThrowIfDenominatorIsZero() throws CborException {
    new RationalNumber(new UnsignedInteger(1), new UnsignedInteger(0));
}


SimpleName:IDENTIFIER 503 expected expected

SimpleName:IDENTIFIER 503 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 504 testDeny testDeny

SimpleName:IDENTIFIER 504 Exception Exception

SimpleName:IDENTIFIER 508 subject subject

StringLiteralExpr:LITERAL 508 "anyId" "anyId"

StringLiteralExpr:LITERAL 508 "anyPath" "anyPath"

StringLiteralExpr:LITERAL 508 "jcr:all" "jcr:all"

@Test(expected = UnsupportedOperationException.class)
public void testDeny() throws Exception {
    subject.deny("anyId", "anyPath", "jcr:all");
}

package io.inkstand.scribble.jcr.rules;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import javax.jcr.AccessDeniedException;
import javax.jcr.LoginException;
import javax.jcr.Repository;
import javax.jcr.Session;
import javax.jcr.SimpleCredentials;
import java.net.URL;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.jackrabbit.core.RepositoryImpl;
import org.apache.jackrabbit.core.config.RepositoryConfig;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import io.inkstand.scribble.rules.BaseRule;
import io.inkstand.scribble.rules.BaseRuleHelper;

@RunWith(MockitoJUnitRunner.class)
public class adhoc_ContentRepositoryTest {

    @Rule
    public TemporaryFolder folder = new TemporaryFolder();

    @Mock
    private Repository repository;

    @Mock
    private Session session;

    private ContentRepository subject;

    private AtomicBoolean exceptionInInitialize = new AtomicBoolean(false);

    @Before
    public void setUp() throws Exception {
        subject = new ContentRepository(folder) {

            private URL nodeTypeDefinitions;

            public void setNodeTypeDefinitions(final URL nodeTypeDefinitions) {
                this.nodeTypeDefinitions = nodeTypeDefinitions;
            }

            @Override
            protected void destroyRepository() {
            }

            @Override
            protected Repository createRepository() throws Exception {
                return repository;
            }

            @Override
            protected void initialize() {
                if (exceptionInInitialize.get()) {
                    throw new RuntimeException();
                }
            }
        };
    }

    private void setupInMemoryRepository() throws Throwable {
        final URL configUrl = getClass().getResource("ContentRepositoryTest_repository.xml");
        RepositoryConfig config = RepositoryConfig.create(configUrl.toURI(), folder.getRoot().getAbsolutePath());
        this.repository = RepositoryImpl.create(config);
        subject.before();
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 514 expected expected

SimpleName:IDENTIFIER 514 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 515 testAddUser testAddUser

SimpleName:IDENTIFIER 515 Exception Exception

SimpleName:IDENTIFIER 519 subject subject

SimpleName:IDENTIFIER 519 addUser addUser

StringLiteralExpr:LITERAL 519 "anyName" "anyName"

StringLiteralExpr:LITERAL 519 "anyPassword" "anyPassword"

@Test(expected = UnsupportedOperationException.class)
public void testAddUser() throws Exception {
    subject.addUser("anyName", "anyPassword");
}


SimpleName:IDENTIFIER 525 expected expected

SimpleName:IDENTIFIER 525 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 526 testDeleteUser testDeleteUser

SimpleName:IDENTIFIER 526 Exception Exception

SimpleName:IDENTIFIER 530 subject subject

SimpleName:IDENTIFIER 530 deleteUser deleteUser

StringLiteralExpr:LITERAL 530 "anyName" "anyName"

@Test(expected = UnsupportedOperationException.class)
public void testDeleteUser() throws Exception {
    subject.deleteUser("anyName");
}


SimpleName:IDENTIFIER 536 expected expected

SimpleName:IDENTIFIER 536 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 537 testResetUsers testResetUsers

SimpleName:IDENTIFIER 537 Exception Exception

SimpleName:IDENTIFIER 541 subject subject

SimpleName:IDENTIFIER 541 resetUsers resetUsers

@Test(expected = UnsupportedOperationException.class)
public void testResetUsers() throws Exception {
    subject.resetUsers();
}


SimpleName:IDENTIFIER 132 expected expected

SimpleName:IDENTIFIER 132 JsonNotEqualException JsonNotEqualException

SimpleName:IDENTIFIER 133 testJsonElementShouldMatchNoMatch testJsonElementShouldMatchNoMatch

SimpleName:IDENTIFIER 133 Exception Exception

SimpleName:IDENTIFIER 135 Mockito Mockito

StringLiteralExpr:LITERAL 137 "source" "source"

SimpleName:IDENTIFIER 139 doReturn doReturn

StringLiteralExpr:LITERAL 139 "foobar" "foobar"

SimpleName:IDENTIFIER 139 findJsonElement findJsonElement

StringLiteralExpr:LITERAL 139 "PATH" "PATH"

StringLiteralExpr:LITERAL 139 "FOO" "FOO"

StringLiteralExpr:LITERAL 139 "DATA" "DATA"

StringLiteralExpr:LITERAL 139 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 141 jsonElementShouldMatch jsonElementShouldMatch

StringLiteralExpr:LITERAL 141 "PATH" "PATH"

StringLiteralExpr:LITERAL 141 "reference" "reference"

StringLiteralExpr:LITERAL 141 "FOO" "FOO"

StringLiteralExpr:LITERAL 141 "DATA" "DATA"

StringLiteralExpr:LITERAL 141 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
143
"The element should not have matched"
"The element should not have matched"

@Test(expected = JsonNotEqualException.class)
public void testJsonElementShouldMatchNoMatch() throws Exception {
    JsonPathLibrary spyLib = Mockito.spy(lib);
    String source = "source";
    doReturn("foobar").when(spyLib).findJsonElement(eq(source), eq("PATH"), eq("FOO"), eq("DATA"), eq("CONTENTTYPE"));
    spyLib.jsonElementShouldMatch(source, "PATH", "reference", "FOO", "DATA", "CONTENTTYPE");
    fail("The element should not have matched");
}

package org.wuokko.robot.restlib;

import static org.junit.Assert.*;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.*;
import static org.powermock.api.mockito.PowerMockito.mock;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.io.IOUtils;
import org.apache.http.client.fluent.Request;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import org.wuokko.robot.restlib.exception.JsonElementNotFoundException;
import org.wuokko.robot.restlib.exception.JsonNotEqualException;
import org.wuokko.robot.restlib.exception.JsonNotValidException;
import org.wuokko.robot.restlib.util.PropertiesUtil;
import org.wuokko.robot.restlib.util.RequestUtil;
import com.jayway.jsonpath.JsonPath;
import com.jayway.jsonpath.PathNotFoundException;

@RunWith(PowerMockRunner.class)
@PrepareForTest({ Request.class, JsonPathLibrary.class, PropertiesUtil.class, JsonPath.class })
public class adhoc_JsonPathLibraryTest {

    @Mock
    RequestUtil util;

    @InjectMocks
    JsonPathLibrary lib = new JsonPathLibrary();

    @Before
    public void setUp() throws Exception {
        PowerMockito.mockStatic(Request.class);
        PowerMockito.mockStatic(PropertiesUtil.class);
        PowerMockito.mockStatic(JsonPath.class);
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 147 expected expected

SimpleName:IDENTIFIER 147 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 148 testJsonElementShouldMatchNull testJsonElementShouldMatchNull

SimpleName:IDENTIFIER 148 Exception Exception

StringLiteralExpr:LITERAL 150 "source" "source"

SimpleName:IDENTIFIER 152 jsonElementShouldMatch jsonElementShouldMatch

StringLiteralExpr:LITERAL 152 "PATH" "PATH"

StringLiteralExpr:LITERAL 152 "FOO" "FOO"

StringLiteralExpr:LITERAL 152 "DATA" "DATA"

StringLiteralExpr:LITERAL 152 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
154
"The element should not have matched"
"The element should not have matched"

@Test(expected = IllegalArgumentException.class)
public void testJsonElementShouldMatchNull() throws Exception {
    String source = "source";
    lib.jsonElementShouldMatch(source, "PATH", null, "FOO", "DATA", "CONTENTTYPE");
    fail("The element should not have matched");
}


SimpleName:IDENTIFIER 200 expected expected

SimpleName:IDENTIFIER 200 JsonElementNotFoundException JsonElementNotFoundException

SimpleName:IDENTIFIER 201 testShouldHaveElementCountSingleTooMany testShouldHaveElementCountSingleTooMany

SimpleName:IDENTIFIER 201 Exception Exception

SimpleName:IDENTIFIER 203 Mockito Mockito

JsonPathLibrary spyLib = Mockito.spy(lib)

JsonPathLibrary spyLib = Mockito.spy(lib);

StringLiteralExpr:LITERAL 205 "source" "source"

String path = "$.store.book[0].category"

String path = "$.store.book[0].category";

SimpleName:IDENTIFIER 209 readSource readSource

StringLiteralExpr:LITERAL 209 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 209 "DATA" "DATA"

StringLiteralExpr:LITERAL 209 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 209 thenReturn thenReturn

StringLiteralExpr:LITERAL 209 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 211 JsonPath JsonPath

StringLiteralExpr:LITERAL 211 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 211 thenReturn thenReturn

SimpleName:IDENTIFIER 213 jsonShouldHaveElementCount jsonShouldHaveElementCount

StringLiteralExpr:LITERAL 213 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 213 "DATA" "DATA"

StringLiteralExpr:LITERAL 213 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
215
"Should have gotten exception"
"Should have gotten exception"

@Test(expected = JsonElementNotFoundException.class)
public void testShouldHaveElementCountSingleTooMany() throws Exception {
    JsonPathLibrary spyLib = Mockito.spy(lib);
    String source = "source";
    String path = "$.store.book[0].category";
    when(util.readSource(eq(source), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn("JSONDATA");
    when(JsonPath.read(eq("JSONDATA"), eq(path))).thenReturn("SINGE_ITEM");
    spyLib.jsonShouldHaveElementCount(source, path, 5, "METHOD", "DATA", "CONTENTTYPE");
    fail("Should have gotten exception");
}

SimpleName:IDENTIFIER 219 expected expected

SimpleName:IDENTIFIER 219 JsonNotEqualException JsonNotEqualException

SimpleName:IDENTIFIER 220 testShouldHaveElementCountManyTooSingle testShouldHaveElementCountManyTooSingle

SimpleName:IDENTIFIER 220 Exception Exception

SimpleName:IDENTIFIER 222 Mockito Mockito

JsonPathLibrary spyLib = Mockito.spy(lib)

JsonPathLibrary spyLib = Mockito.spy(lib);

StringLiteralExpr:LITERAL 224 "source" "source"

String path = "$.store.book[0].category"

String path = "$.store.book[0].category";

SimpleName:IDENTIFIER 228 readSource readSource

StringLiteralExpr:LITERAL 228 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 228 "DATA" "DATA"

StringLiteralExpr:LITERAL 228 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 228 thenReturn thenReturn

StringLiteralExpr:LITERAL 228 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 230 JsonPath JsonPath

StringLiteralExpr:LITERAL 230 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 230 thenReturn thenReturn

SimpleName:IDENTIFIER 232 jsonShouldHaveElementCount jsonShouldHaveElementCount

StringLiteralExpr:LITERAL 232 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 232 "DATA" "DATA"

StringLiteralExpr:LITERAL 232 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
234
"Should have gotten exception"
"Should have gotten exception"

@Test(expected = JsonNotEqualException.class)
public void testShouldHaveElementCountManyTooSingle() throws Exception {
    JsonPathLibrary spyLib = Mockito.spy(lib);
    String source = "source";
    String path = "$.store.book[0].category";
    when(util.readSource(eq(source), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn("JSONDATA");
    when(JsonPath.read(eq("JSONDATA"), eq(path))).thenReturn(Arrays.asList("1", "2"));
    spyLib.jsonShouldHaveElementCount(source, path, 1, "METHOD", "DATA", "CONTENTTYPE");
    fail("Should have gotten exception");
}

SimpleName:IDENTIFIER 238 expected expected

SimpleName:IDENTIFIER 238 JsonElementNotFoundException JsonElementNotFoundException

SimpleName:IDENTIFIER 239 testShouldHaveElementCountNotFound testShouldHaveElementCountNotFound

SimpleName:IDENTIFIER 239 Exception Exception

SimpleName:IDENTIFIER 241 Mockito Mockito

JsonPathLibrary spyLib = Mockito.spy(lib)

JsonPathLibrary spyLib = Mockito.spy(lib);

StringLiteralExpr:LITERAL 243 "source" "source"

String path = "$.store.book[0].category"

String path = "$.store.book[0].category";

SimpleName:IDENTIFIER 247 readSource readSource

StringLiteralExpr:LITERAL 247 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 247 "DATA" "DATA"

StringLiteralExpr:LITERAL 247 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 247 thenReturn thenReturn

StringLiteralExpr:LITERAL 247 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 249 JsonPath JsonPath

StringLiteralExpr:LITERAL 249 "JSONDATA" "JSONDATA"

SimpleName:IDENTIFIER 249 thenReturn thenReturn

SimpleName:IDENTIFIER 251 jsonShouldHaveElementCount jsonShouldHaveElementCount

StringLiteralExpr:LITERAL 251 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 251 "DATA" "DATA"

StringLiteralExpr:LITERAL 251 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
253
"Should have gotten exception"
"Should have gotten exception"

@Test(expected = JsonElementNotFoundException.class)
public void testShouldHaveElementCountNotFound() throws Exception {
    JsonPathLibrary spyLib = Mockito.spy(lib);
    String source = "source";
    String path = "$.store.book[0].category";
    when(util.readSource(eq(source), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn("JSONDATA");
    when(JsonPath.read(eq("JSONDATA"), eq(path))).thenReturn(null);
    spyLib.jsonShouldHaveElementCount(source, path, 1, "METHOD", "DATA", "CONTENTTYPE");
    fail("Should have gotten exception");
}


SimpleName:IDENTIFIER 295 expected expected

SimpleName:IDENTIFIER 295 JsonElementNotFoundException JsonElementNotFoundException

SimpleName:IDENTIFIER 296 testFindJsonElementNotFound testFindJsonElementNotFound

SimpleName:IDENTIFIER 296 Exception Exception

SimpleName:IDENTIFIER 298 Mockito Mockito

SimpleName:IDENTIFIER 298 readSource readSource

StringLiteralExpr:LITERAL 298 "SOURCE" "SOURCE"

StringLiteralExpr:LITERAL 298 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 298 "DATA" "DATA"

StringLiteralExpr:LITERAL 298 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 298 thenReturn thenReturn

StringLiteralExpr:LITERAL 298 "JSON" "JSON"

SimpleName:IDENTIFIER 300 Mockito Mockito

SimpleName:IDENTIFIER 300 JsonPath JsonPath

StringLiteralExpr:LITERAL 300 "JSON" "JSON"

StringLiteralExpr:LITERAL 300 "PATH" "PATH"

SimpleName:IDENTIFIER 300 thenThrow thenThrow

SimpleName:IDENTIFIER 300 PathNotFoundException PathNotFoundException

SimpleName:IDENTIFIER 302 findJsonElement findJsonElement

StringLiteralExpr:LITERAL 302 "SOURCE" "SOURCE"

StringLiteralExpr:LITERAL 302 "PATH" "PATH"

StringLiteralExpr:LITERAL 302 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 302 "DATA" "DATA"

StringLiteralExpr:LITERAL 302 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
304
"Should have thrown exception"
"Should have thrown exception"

@Test(expected = JsonElementNotFoundException.class)
public void testFindJsonElementNotFound() throws Exception {
    Mockito.when(util.readSource("SOURCE", "METHOD", "DATA", "CONTENTTYPE")).thenReturn("JSON");
    Mockito.when(JsonPath.read("JSON", "PATH")).thenThrow(new PathNotFoundException(""));
    lib.findJsonElement("SOURCE", "PATH", "METHOD", "DATA", "CONTENTTYPE");
    fail("Should have thrown exception");
}


SimpleName:IDENTIFIER 345 expected expected

SimpleName:IDENTIFIER 345 JsonElementNotFoundException JsonElementNotFoundException

SimpleName:IDENTIFIER 346 testFindJsonElementListNotFound testFindJsonElementListNotFound

SimpleName:IDENTIFIER 346 Exception Exception

SimpleName:IDENTIFIER 348 Mockito Mockito

SimpleName:IDENTIFIER 348 readSource readSource

StringLiteralExpr:LITERAL 348 "SOURCE" "SOURCE"

StringLiteralExpr:LITERAL 348 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 348 "DATA" "DATA"

StringLiteralExpr:LITERAL 348 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 348 thenReturn thenReturn

StringLiteralExpr:LITERAL 348 "JSON" "JSON"

SimpleName:IDENTIFIER 350 Mockito Mockito

SimpleName:IDENTIFIER 350 JsonPath JsonPath

StringLiteralExpr:LITERAL 350 "JSON" "JSON"

StringLiteralExpr:LITERAL 350 "PATH" "PATH"

SimpleName:IDENTIFIER 350 thenThrow thenThrow

SimpleName:IDENTIFIER 350 PathNotFoundException PathNotFoundException

SimpleName:IDENTIFIER 352 findJsonElementList findJsonElementList

StringLiteralExpr:LITERAL 352 "SOURCE" "SOURCE"

StringLiteralExpr:LITERAL 352 "PATH" "PATH"

StringLiteralExpr:LITERAL 352 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 352 "DATA" "DATA"

StringLiteralExpr:LITERAL 352 "CONTENTTYPE" "CONTENTTYPE"

StringLiteralExpr:LITERAL
354
"Should have thrown exception"
"Should have thrown exception"

@Test(expected = JsonElementNotFoundException.class)
public void testFindJsonElementListNotFound() throws Exception {
    Mockito.when(util.readSource("SOURCE", "METHOD", "DATA", "CONTENTTYPE")).thenReturn("JSON");
    Mockito.when(JsonPath.read("JSON", "PATH")).thenThrow(new PathNotFoundException(""));
    lib.findJsonElementList("SOURCE", "PATH", "METHOD", "DATA", "CONTENTTYPE");
    fail("Should have thrown exception");
}


SimpleName:IDENTIFIER 416 expected expected

SimpleName:IDENTIFIER 416 JsonNotEqualException JsonNotEqualException

SimpleName:IDENTIFIER 417 testJsonShouldBeEqualNoMatch testJsonShouldBeEqualNoMatch

SimpleName:IDENTIFIER 417 Exception Exception

StringLiteralExpr:LITERAL
419
"{foo: bar}"
"{foo: bar}"

StringLiteralExpr:LITERAL
420
"{foo: xyz}"
"{foo: xyz}"

SimpleName:IDENTIFIER 422 Mockito Mockito

SimpleName:IDENTIFIER 422 readSource readSource

StringLiteralExpr:LITERAL 422 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 422 "DATA" "DATA"

StringLiteralExpr:LITERAL 422 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 422 thenReturn thenReturn

SimpleName:IDENTIFIER 423 Mockito Mockito

SimpleName:IDENTIFIER 423 readSource readSource

StringLiteralExpr:LITERAL 423 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 423 "DATA" "DATA"

StringLiteralExpr:LITERAL 423 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 423 thenReturn thenReturn

SimpleName:IDENTIFIER 425 jsonShouldBeEqual jsonShouldBeEqual

BooleanLiteralExpr:LITERAL 425 false false

StringLiteralExpr:LITERAL 425 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 425 "DATA" "DATA"

StringLiteralExpr:LITERAL 425 "CONTENTTYPE" "CONTENTTYPE"

@Test(expected = JsonNotEqualException.class)
public void testJsonShouldBeEqualNoMatch() throws Exception {
    String from = "{foo: bar}";
    String to = "{foo: xyz}";
    Mockito.when(util.readSource(eq(from), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(from);
    Mockito.when(util.readSource(eq(to), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(to);
    lib.jsonShouldBeEqual(from, to, false, "METHOD", "DATA", "CONTENTTYPE");
}

SimpleName:IDENTIFIER 429 expected expected

SimpleName:IDENTIFIER 429 JsonNotValidException JsonNotValidException

SimpleName:IDENTIFIER 430 testJsonShouldBeEqualNoMatchBlank testJsonShouldBeEqualNoMatchBlank

SimpleName:IDENTIFIER 430 Exception Exception

SimpleName:IDENTIFIER 435 Mockito Mockito

SimpleName:IDENTIFIER 435 readSource readSource

StringLiteralExpr:LITERAL 435 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 435 "DATA" "DATA"

StringLiteralExpr:LITERAL 435 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 435 thenReturn thenReturn

SimpleName:IDENTIFIER 436 Mockito Mockito

SimpleName:IDENTIFIER 436 readSource readSource

StringLiteralExpr:LITERAL 436 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 436 "DATA" "DATA"

StringLiteralExpr:LITERAL 436 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 436 thenReturn thenReturn

SimpleName:IDENTIFIER 438 jsonShouldBeEqual jsonShouldBeEqual

BooleanLiteralExpr:LITERAL 438 false false

StringLiteralExpr:LITERAL 438 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 438 "DATA" "DATA"

StringLiteralExpr:LITERAL 438 "CONTENTTYPE" "CONTENTTYPE"

@Test(expected = JsonNotValidException.class)
public void testJsonShouldBeEqualNoMatchBlank() throws Exception {
    String from = "";
    String to = "";
    Mockito.when(util.readSource(eq(from), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(from);
    Mockito.when(util.readSource(eq(to), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(to);
    lib.jsonShouldBeEqual(from, to, false, "METHOD", "DATA", "CONTENTTYPE");
}

SimpleName:IDENTIFIER 441 expected expected

SimpleName:IDENTIFIER 441 JsonNotValidException JsonNotValidException

SimpleName:IDENTIFIER 442 testJsonShouldBeEqualNoMatchNull testJsonShouldBeEqualNoMatchNull

SimpleName:IDENTIFIER 442 Exception Exception

StringLiteralExpr:LITERAL 444 "from" "from"

SimpleName:IDENTIFIER 447 Mockito Mockito

SimpleName:IDENTIFIER 447 readSource readSource

StringLiteralExpr:LITERAL 447 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 447 "DATA" "DATA"

StringLiteralExpr:LITERAL 447 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 447 thenReturn thenReturn

SimpleName:IDENTIFIER 448 Mockito Mockito

SimpleName:IDENTIFIER 448 readSource readSource

StringLiteralExpr:LITERAL 448 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 448 "DATA" "DATA"

StringLiteralExpr:LITERAL 448 "CONTENTTYPE" "CONTENTTYPE"

SimpleName:IDENTIFIER 448 thenReturn thenReturn

SimpleName:IDENTIFIER 450 jsonShouldBeEqual jsonShouldBeEqual

BooleanLiteralExpr:LITERAL 450 false false

StringLiteralExpr:LITERAL 450 "METHOD" "METHOD"

StringLiteralExpr:LITERAL 450 "DATA" "DATA"

StringLiteralExpr:LITERAL 450 "CONTENTTYPE" "CONTENTTYPE"

@Test(expected = JsonNotValidException.class)
public void testJsonShouldBeEqualNoMatchNull() throws Exception {
    String from = "from";
    String to = "to";
    Mockito.when(util.readSource(eq(from), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(null);
    Mockito.when(util.readSource(eq(to), eq("METHOD"), eq("DATA"), eq("CONTENTTYPE"))).thenReturn(null);
    lib.jsonShouldBeEqual(from, to, false, "METHOD", "DATA", "CONTENTTYPE");
}


SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 34 testPortCantBeAssigned testPortCantBeAssigned

SimpleName:IDENTIFIER 34 IOException IOException

SimpleName:IDENTIFIER 35 factory factory

SimpleName:IDENTIFIER 35 ServerSocketFactory ServerSocketFactory

SimpleName:IDENTIFIER 36 factory factory

SimpleName:IDENTIFIER 36 createServerSocket createServerSocket

SimpleName:IDENTIFIER 37 thenThrow thenThrow

SimpleName:IDENTIFIER 37 IOException IOException

StringLiteralExpr:LITERAL 37 "Fake" "Fake"

SimpleName:IDENTIFIER 38 RandomPortSupplier RandomPortSupplier

SimpleName:IDENTIFIER 38 factory factory

@Test(expected = IllegalStateException.class)
public void testPortCantBeAssigned() throws IOException {
    ServerSocketFactory factory = mock(ServerSocketFactory.class);
    when(factory.createServerSocket(anyInt())).thenThrow(new IOException("Fake"));
    new RandomPortSupplier(factory).get();
}

package io.arivera.oss.embedded.rabbitmq.util;

import org.junit.Test;
import javax.net.ServerSocketFactory;
import java.io.IOException;
import java.net.ServerSocket;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class adhoc_RandomPortSupplierTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 14 expected expected

SimpleName:IDENTIFIER 14 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 15 isThrowingExceptionWhenFileIsNotFound isThrowingExceptionWhenFileIsNotFound

SimpleName:IDENTIFIER 16 FileUtil FileUtil

SimpleName:IDENTIFIER 16 findFile findFile

StringLiteralExpr:LITERAL 16 "INVALID" "INVALID"

@Test(expected = IllegalArgumentException.class)
public void isThrowingExceptionWhenFileIsNotFound() {
    FileUtil.findFile("INVALID");
}

package test.com.uaihebert.uaimockserver.factory;

import com.uaihebert.uaimockserver.model.UaiFile;
import com.uaihebert.uaimockserver.context.UaiMockServerContext;
import com.uaihebert.uaimockserver.util.FileUtil;
import org.junit.Test;
import java.io.File;
import static org.junit.Assert.assertTrue;

public class adhoc_FileUtilTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 15 expected expected

SimpleName:IDENTIFIER 15 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 16 checkNoActiveConnectionByDefault checkNoActiveConnectionByDefault

SimpleName:IDENTIFIER 17 getActiveConnection getActiveConnection

@Test(expected = IllegalStateException.class)
public void checkNoActiveConnectionByDefault() {
    db.getActiveConnection();
}

package com.github.mjdbc.test;

import com.github.mjdbc.DbConnection;
import com.github.mjdbc.DbPreparedStatement;
import com.github.mjdbc.Mappers;
import java.sql.Statement;
import java.util.HashMap;
import org.junit.Test;

public class adhoc_DbActiveConnectionTest extends DbTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 20 expected expected

SimpleName:IDENTIFIER 20 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 21 checkNoActiveConnectionAfterExecute checkNoActiveConnectionAfterExecute

SimpleName:IDENTIFIER 22 execute execute

SimpleName:IDENTIFIER 23 getActiveConnection getActiveConnection

@Test(expected = IllegalStateException.class)
public void checkNoActiveConnectionAfterExecute() {
    db.execute(c -> null);
    db.getActiveConnection();
}