Example usage for java.util Arrays deepEquals

List of usage examples for java.util Arrays deepEquals

Introduction

In this page you can find the example usage for java.util Arrays deepEquals.

Prototype

public static boolean deepEquals(Object[] a1, Object[] a2) 

Source Link

Document

Returns true if the two specified arrays are deeply equal to one another.

Usage

From source file:com.liferay.mail.service.base.AccountLocalServiceClpInvoker.java

public Object invokeMethod(String name, String[] parameterTypes, Object[] arguments) throws Throwable {
    if (_methodName0.equals(name) && Arrays.deepEquals(_methodParameterTypes0, parameterTypes)) {
        return AccountLocalServiceUtil.addAccount((com.liferay.mail.model.Account) arguments[0]);
    }//from  w  w  w  .  j  a  va2 s.c  o m

    if (_methodName1.equals(name) && Arrays.deepEquals(_methodParameterTypes1, parameterTypes)) {
        return AccountLocalServiceUtil.createAccount(((Long) arguments[0]).longValue());
    }

    if (_methodName2.equals(name) && Arrays.deepEquals(_methodParameterTypes2, parameterTypes)) {
        return AccountLocalServiceUtil.deleteAccount(((Long) arguments[0]).longValue());
    }

    if (_methodName3.equals(name) && Arrays.deepEquals(_methodParameterTypes3, parameterTypes)) {
        return AccountLocalServiceUtil.deleteAccount((com.liferay.mail.model.Account) arguments[0]);
    }

    if (_methodName4.equals(name) && Arrays.deepEquals(_methodParameterTypes4, parameterTypes)) {
        return AccountLocalServiceUtil.dynamicQuery();
    }

    if (_methodName5.equals(name) && Arrays.deepEquals(_methodParameterTypes5, parameterTypes)) {
        return AccountLocalServiceUtil
                .dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery) arguments[0]);
    }

    if (_methodName6.equals(name) && Arrays.deepEquals(_methodParameterTypes6, parameterTypes)) {
        return AccountLocalServiceUtil.dynamicQuery(
                (com.liferay.portal.kernel.dao.orm.DynamicQuery) arguments[0],
                ((Integer) arguments[1]).intValue(), ((Integer) arguments[2]).intValue());
    }

    if (_methodName7.equals(name) && Arrays.deepEquals(_methodParameterTypes7, parameterTypes)) {
        return AccountLocalServiceUtil.dynamicQuery(
                (com.liferay.portal.kernel.dao.orm.DynamicQuery) arguments[0],
                ((Integer) arguments[1]).intValue(), ((Integer) arguments[2]).intValue(),
                (com.liferay.portal.kernel.util.OrderByComparator) arguments[3]);
    }

    if (_methodName8.equals(name) && Arrays.deepEquals(_methodParameterTypes8, parameterTypes)) {
        return AccountLocalServiceUtil
                .dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery) arguments[0]);
    }

    if (_methodName9.equals(name) && Arrays.deepEquals(_methodParameterTypes9, parameterTypes)) {
        return AccountLocalServiceUtil.dynamicQueryCount(
                (com.liferay.portal.kernel.dao.orm.DynamicQuery) arguments[0],
                (com.liferay.portal.kernel.dao.orm.Projection) arguments[1]);
    }

    if (_methodName10.equals(name) && Arrays.deepEquals(_methodParameterTypes10, parameterTypes)) {
        return AccountLocalServiceUtil.fetchAccount(((Long) arguments[0]).longValue());
    }

    if (_methodName11.equals(name) && Arrays.deepEquals(_methodParameterTypes11, parameterTypes)) {
        return AccountLocalServiceUtil.getAccount(((Long) arguments[0]).longValue());
    }

    if (_methodName12.equals(name) && Arrays.deepEquals(_methodParameterTypes12, parameterTypes)) {
        return AccountLocalServiceUtil.getPersistedModel((java.io.Serializable) arguments[0]);
    }

    if (_methodName13.equals(name) && Arrays.deepEquals(_methodParameterTypes13, parameterTypes)) {
        return AccountLocalServiceUtil.getAccounts(((Integer) arguments[0]).intValue(),
                ((Integer) arguments[1]).intValue());
    }

    if (_methodName14.equals(name) && Arrays.deepEquals(_methodParameterTypes14, parameterTypes)) {
        return AccountLocalServiceUtil.getAccountsCount();
    }

    if (_methodName15.equals(name) && Arrays.deepEquals(_methodParameterTypes15, parameterTypes)) {
        return AccountLocalServiceUtil.updateAccount((com.liferay.mail.model.Account) arguments[0]);
    }

    if (_methodName50.equals(name) && Arrays.deepEquals(_methodParameterTypes50, parameterTypes)) {
        return AccountLocalServiceUtil.getBeanIdentifier();
    }

    if (_methodName51.equals(name) && Arrays.deepEquals(_methodParameterTypes51, parameterTypes)) {
        AccountLocalServiceUtil.setBeanIdentifier((java.lang.String) arguments[0]);

        return null;
    }

    if (_methodName56.equals(name) && Arrays.deepEquals(_methodParameterTypes56, parameterTypes)) {

        return AccountLocalServiceUtil.addAccount(((Long) arguments[0]).longValue(),
                (java.lang.String) arguments[1], (java.lang.String) arguments[2],
                (java.lang.String) arguments[3], (java.lang.String) arguments[4],
                ((Integer) arguments[5]).intValue(), ((Boolean) arguments[6]).booleanValue(),
                (java.lang.String) arguments[7], ((Integer) arguments[8]).intValue(),
                ((Boolean) arguments[9]).booleanValue(), (java.lang.String) arguments[10],
                (java.lang.String) arguments[11], ((Boolean) arguments[12]).booleanValue(),
                (java.lang.String) arguments[13], ((Boolean) arguments[14]).booleanValue(),
                (java.lang.String) arguments[15], ((Long) arguments[16]).longValue(),
                ((Long) arguments[17]).longValue(), ((Long) arguments[18]).longValue(),
                ((Long) arguments[19]).longValue(), ((Boolean) arguments[20]).booleanValue());
    }

    Log _log = LogFactory.getLog(AccountLocalServiceClpInvoker.class);
    _log.error("BLAAAA");

    if (_methodName561.equals(name) && Arrays.deepEquals(_methodParameterTypes561, parameterTypes)) {

        return AccountLocalServiceUtil.addAccount(((Long) arguments[0]).longValue(), "chrwegne@uni-potsdam.de",
                (java.lang.String) arguments[2], (java.lang.String) arguments[3], "imap.uni-potsdam.de", 993,
                true, "smtpout.uni-potsdam.de", 465, true, "chrwegne", (java.lang.String) arguments[11],
                ((Boolean) arguments[12]).booleanValue(), (java.lang.String) arguments[13],
                ((Boolean) arguments[14]).booleanValue(), (java.lang.String) arguments[15],
                ((Long) arguments[16]).longValue(), ((Long) arguments[17]).longValue(),
                ((Long) arguments[18]).longValue(), ((Long) arguments[19]).longValue(),
                ((Boolean) arguments[20]).booleanValue());
    }

    if (_methodName57.equals(name) && Arrays.deepEquals(_methodParameterTypes57, parameterTypes)) {
        return AccountLocalServiceUtil.deleteAccount((com.liferay.mail.model.Account) arguments[0]);
    }

    if (_methodName58.equals(name) && Arrays.deepEquals(_methodParameterTypes58, parameterTypes)) {
        return AccountLocalServiceUtil.deleteAccount(((Long) arguments[0]).longValue());
    }

    if (_methodName59.equals(name) && Arrays.deepEquals(_methodParameterTypes59, parameterTypes)) {
        AccountLocalServiceUtil.deleteAccounts(((Long) arguments[0]).longValue());

        return null;
    }

    if (_methodName60.equals(name) && Arrays.deepEquals(_methodParameterTypes60, parameterTypes)) {
        return AccountLocalServiceUtil.getAccount(((Long) arguments[0]).longValue(),
                (java.lang.String) arguments[1]);
    }

    if (_methodName61.equals(name) && Arrays.deepEquals(_methodParameterTypes61, parameterTypes)) {
        return AccountLocalServiceUtil.getAccounts(((Long) arguments[0]).longValue());
    }

    if (_methodName62.equals(name) && Arrays.deepEquals(_methodParameterTypes62, parameterTypes)) {
        return AccountLocalServiceUtil.updateAccount(((Long) arguments[0]).longValue(),
                (java.lang.String) arguments[1], (java.lang.String) arguments[2],
                ((Boolean) arguments[3]).booleanValue(), (java.lang.String) arguments[4],
                ((Boolean) arguments[5]).booleanValue(), (java.lang.String) arguments[6],
                ((Boolean) arguments[7]).booleanValue());
    }

    if (_methodName63.equals(name) && Arrays.deepEquals(_methodParameterTypes63, parameterTypes)) {
        return AccountLocalServiceUtil.updateFolders(((Long) arguments[0]).longValue(),
                ((Long) arguments[1]).longValue(), ((Long) arguments[2]).longValue(),
                ((Long) arguments[3]).longValue(), ((Long) arguments[4]).longValue());
    }

    throw new UnsupportedOperationException();
}

From source file:dao.EntryDaoTest.java

/**
 * Test of getEntryByTitle method, of class EntryDao.
 *///from w w w . j a  v a2  s.  co  m
@Test
public void testGetEntryByTitle() {
    System.out.println("getEntryByTitle with same entries");
    String title = "PAOK";
    Entry expResult = EntryDao.getEntryByTitle("PAOK");
    Entry result = EntryDao.getEntryByTitle(title);

    boolean finalExpResult = true;
    boolean finalActualResult;

    boolean imageResult = expResult.getEntryImages().equals(result.getEntryImages());
    boolean textResult = expResult.getEntryText().equals(result.getEntryText());
    boolean videoResult = expResult.getEntryVideo().toString().equals(result.getEntryVideo().toString());
    boolean entriesListResult = Arrays.deepEquals(expResult.getEntriesList(), result.getEntriesList());
    boolean imageListResult = Arrays.deepEquals(expResult.getImageList(), result.getImageList());
    if (imageResult && textResult && videoResult && entriesListResult && imageListResult)
        finalActualResult = true;
    else
        finalActualResult = false;
    assertEquals(finalExpResult, finalActualResult);
}

From source file:com.datatorrent.contrib.enrich.FixedWidthFSLoader.java

/**
 * Extracts the fields from a fixed width record and returns a map containing
 * field names and values// w  ww  .j  a  va2  s  .  com
 */
@Override
Map<String, Object> extractFields(String line) {
    if (!initialized) {
        init();
        initialized = true;
    }
    String[] values = fixedWidthParser.parseLine(line);
    if (hasHeader && Arrays.deepEquals(values, header)) {
        return null;
    }
    Map<String, Object> map = Maps.newHashMap();
    int i = 0;
    for (FixedWidthField field : fields) {
        map.put(field.getName(), getValue(field, values[i++]));
    }
    return map;
}

From source file:org.apache.apex.malhar.sql.FileEndpointTest.java

@Test
public void testApplicationSelectInsertWithAPI() throws Exception {
    try {//from w  w  w.ja  v a 2s.c om
        LocalMode lma = LocalMode.newInstance();
        Configuration conf = new Configuration(false);
        lma.prepareDAG(new ApplicationSelectInsertWithAPI(), conf);

        LocalMode.Controller lc = lma.getController();
        lc.runAsync();
        /**
         * Wait time is 40 sec to ensure that checkpoint happens. AbstractFileOutputOperators flushes the stream
         * in beforeCheckpoint call.
         */
        Assert.assertTrue(waitTillFileIsPopulated(outputFolder, 40000));
        lc.shutdown();
    } catch (Exception e) {
        Assert.fail("constraint violations: " + e);
    }

    File file = new File(outputFolder);
    File file1 = new File(outputFolder + file.list()[0]);
    List<String> strings = FileUtils.readLines(file1);

    String[] actualLines = strings.toArray(new String[strings.size()]);

    String[] expectedLines = new String[] { "15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4", "",
            "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5", "" };
    Assert.assertTrue(Arrays.deepEquals(actualLines, expectedLines));
}

From source file:com.opengamma.financial.analytics.ircurve.calcconfig.MultiCurveCalculationConfig.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from w ww .  j  a  v a  2 s  . c o m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final MultiCurveCalculationConfig other = (MultiCurveCalculationConfig) obj;
    if (!ObjectUtils.equals(_calculationConfigName, other._calculationConfigName)) {
        return false;
    }
    if (!Arrays.equals(_yieldCurveNames, other._yieldCurveNames)) {
        return false;
    }
    if (!ObjectUtils.equals(_curveExposuresForInstruments, other._curveExposuresForInstruments)) {
        return false;
    }
    if (!ObjectUtils.equals(_target, other._target)) {
        return false;
    }
    if (!ObjectUtils.equals(_calculationMethod, other._calculationMethod)) {
        return false;
    }
    if (_exogenousConfigAndCurveNames != null) {
        if (_exogenousConfigAndCurveNames.size() != other._exogenousConfigAndCurveNames.size()) {
            return false;
        }
        for (final Map.Entry<String, String[]> entry : _exogenousConfigAndCurveNames.entrySet()) {
            if (!other._exogenousConfigAndCurveNames.containsKey(entry.getKey())) {
                return false;
            }
            if (!Arrays.deepEquals(entry.getValue(), _exogenousConfigAndCurveNames.get(entry.getKey()))) {
                return false;
            }
        }
    }
    return true;
}

From source file:com.opengamma.maths.lowlevelapi.datatypes.primitive.DenseMatrixTest.java

@Test
public void testToArray() {
    DenseMatrix tmp = new DenseMatrix(_tallRectangle);
    assertTrue(Arrays.deepEquals(_tallRectangle, tmp.toArray()));
}

From source file:com.softenido.cafedark.io.virtual.ZipVirtualFileSystem.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }/*  w  w  w. ja v  a2s.co  m*/
    if (getClass() != obj.getClass()) {
        return false;
    }
    final ZipVirtualFileSystem other = (ZipVirtualFileSystem) obj;
    if (!Arrays.deepEquals(this.items, other.items)) {
        return false;
    }
    return true;
}

From source file:org.jasig.portal.utils.cache.CacheKey.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    CacheKey other = (CacheKey) obj;/* ww w .j a  v  a 2 s  . c om*/
    if (source == null) {
        if (other.source != null)
            return false;
    } else if (!source.equals(other.source))
        return false;
    if (!Arrays.deepEquals(key, other.key))
        return false;
    return true;
}

From source file:org.eclipse.virgo.ide.jdt.internal.core.util.ClasspathUtils.java

/**
 * Updates the class path container on the given <code>javaProject</code>.
 *///from   w  w  w.j a v a 2s .c om
public static IStatus updateClasspathContainer(IJavaProject javaProject,
        Set<IBundleManifestChangeListener.Type> types, IProgressMonitor monitor) {
    try {

        if (monitor.isCanceled()) {
            return Status.CANCEL_STATUS;
        }

        // only update if something relevant happened
        if (types.contains(IBundleManifestChangeListener.Type.IMPORT_BUNDLE)
                || types.contains(IBundleManifestChangeListener.Type.IMPORT_LIBRARY)
                || types.contains(IBundleManifestChangeListener.Type.IMPORT_PACKAGE)
                || types.contains(IBundleManifestChangeListener.Type.REQUIRE_BUNDLE)) {

            IClasspathContainer oldContainer = ClasspathUtils.getClasspathContainer(javaProject);
            if (oldContainer != null) {
                ServerClasspathContainer container = new ServerClasspathContainer(javaProject);

                container.refreshClasspathEntries();
                if (!Arrays.deepEquals(oldContainer.getClasspathEntries(), container.getClasspathEntries())) {
                    JavaCore.setClasspathContainer(ServerClasspathContainer.CLASSPATH_CONTAINER_PATH,
                            new IJavaProject[] { javaProject }, new IClasspathContainer[] { container },
                            monitor);
                }
            }
        }

        if (types.contains(IBundleManifestChangeListener.Type.EXPORT_PACKAGE)) {
            // Always try to update the depending projects because MANIFEST might have changed
            // without changes to the project's own class path
            updateClasspathContainerForDependingBundles(javaProject);
        }

    } catch (JavaModelException e) {
        JdtCorePlugin.log(e);
    }
    return Status.OK_STATUS;
}

From source file:dao.EntryDaoTest.java

@Test
public void testGetEntryByTitle2() {
    System.out.println("getEntryByTitle with different entries");
    String title = "PAOK";
    Entry expResult = EntryDao.getEntryByTitle("Texnologia2");
    Entry result = EntryDao.getEntryByTitle(title);

    boolean finalExpResult = false;
    boolean finalActualResult;

    boolean imageResult = expResult.getEntryImages().equals(result.getEntryImages());
    boolean textResult = expResult.getEntryText().equals(result.getEntryText());
    boolean videoResult = expResult.getEntryVideo().toString().equals(result.getEntryVideo().toString());
    boolean entriesListResult = Arrays.deepEquals(expResult.getEntriesList(), result.getEntriesList());
    boolean imageListResult = Arrays.deepEquals(expResult.getImageList(), result.getImageList());
    if (imageResult && textResult && videoResult && entriesListResult && imageListResult)
        finalActualResult = true;/*ww w  .j  a  v  a2  s .  c  o m*/
    else
        finalActualResult = false;
    assertEquals(finalExpResult, finalActualResult);
}