@After
  @Override
  public void tearDown() throws Exception {
    if (_fileEntry != null) {
      DLAppServiceUtil.deleteFileEntry(_fileEntry.getFileEntryId());
    }

    super.tearDown();
  }
  @After
  @Override
  public void tearDown() throws Exception {
    ExpandoTable expandoTable =
        ExpandoTableLocalServiceUtil.getDefaultTable(
            PortalUtil.getDefaultCompanyId(), DLFileEntry.class.getName());

    ExpandoTableLocalServiceUtil.deleteTable(expandoTable);

    super.tearDown();
  }
  @Before
  @Override
  public void setUp() throws Exception {
    super.setUp();

    SimpleAction simpleAction = new AddDefaultDocumentLibraryStructuresAction();

    String companyIdString = String.valueOf(TestPropsValues.getCompanyId());

    simpleAction.run(new String[] {companyIdString});

    List<DLFileEntryType> dlFileEntryTypes =
        DLFileEntryTypeLocalServiceUtil.getFileEntryTypes(
            PortalUtil.getCurrentAndAncestorSiteGroupIds(group.getGroupId()));

    for (DLFileEntryType dlFileEntryType : dlFileEntryTypes) {
      String name = dlFileEntryType.getName(LocaleUtil.getSiteDefault());

      if (name.equals(DLFileEntryTypeConstants.NAME_CONTRACT)) {
        _contractDLFileEntryTypeId = dlFileEntryType.getFileEntryTypeId();
      }
    }

    ExpandoTable expandoTable =
        ExpandoTableLocalServiceUtil.addDefaultTable(
            PortalUtil.getDefaultCompanyId(), DLFileEntry.class.getName());

    ExpandoColumnLocalServiceUtil.addColumn(
        expandoTable.getTableId(),
        _EXPANDO_ATTRIBUTE_NAME,
        ExpandoColumnConstants.STRING,
        StringPool.BLANK);

    _serviceContext = getServiceContext();

    FileEntry fileEntry =
        DLAppServiceUtil.addFileEntry(
            group.getGroupId(),
            parentFolder.getFolderId(),
            _SOURCE_FILE_NAME,
            ContentTypes.APPLICATION_OCTET_STREAM,
            _TITLE,
            StringPool.BLANK,
            StringPool.BLANK,
            _DATA_VERSION_1,
            _serviceContext);

    _fileVersion =
        DLFileVersionLocalServiceUtil.getFileVersion(
            fileEntry.getFileEntryId(), DLFileEntryConstants.VERSION_DEFAULT);
  }
  @Before
  @Override
  public void setUp() throws Exception {
    super.setUp();

    _userIds = new long[ServiceTestUtil.THREAD_COUNT];

    for (int i = 0; i < ServiceTestUtil.THREAD_COUNT; i++) {
      User user =
          ServiceTestUtil.addUser(
              "DLAppServiceTest" + (i + 1), false, new long[] {group.getGroupId()});

      _userIds[i] = user.getUserId();
    }
  }
  @Before
  @Override
  public void setUp() throws Exception {
    super.setUp();

    _fileEntry =
        DLAppTestUtil.addFileEntry(
            group.getGroupId(), parentFolder.getFolderId(), false, "Test DLAppService.txt");

    _userIds = new long[ServiceTestUtil.THREAD_COUNT];

    for (int i = 0; i < ServiceTestUtil.THREAD_COUNT; i++) {
      User user = ServiceTestUtil.addUser("DLAppServiceTest" + (i + 1), group.getGroupId());

      _userIds[i] = user.getUserId();
    }
  }