@Before
  public void setUp() throws Exception {
    group = GroupTestUtil.addGroup();

    actorUser = UserTestUtil.addUser("actor", group.getGroupId());
    creatorUser = UserTestUtil.addUser("creator", group.getGroupId());

    assetEntry = SocialActivityTestUtil.addAssetEntry(creatorUser, group, null);

    SocialActivityHierarchyEntryThreadLocal.clear();
  }
  @BeforeClass
  public static void setUpClass() throws Exception {
    _user = UserTestUtil.addUser();

    long classNameId = PortalUtil.getClassNameId(LiferayRepository.class.getName());

    _group = GroupTestUtil.addGroup();

    ServiceContext serviceContext = ServiceContextTestUtil.getServiceContext(_group.getGroupId());

    _repository =
        RepositoryLocalServiceUtil.addRepository(
            TestPropsValues.getUserId(),
            _group.getGroupId(),
            classNameId,
            DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
            "Repository A",
            StringPool.BLANK,
            "Test Portlet",
            new UnicodeProperties(),
            true,
            serviceContext);

    Object[] objects = setUp(_group.getGroupId(), StringPool.BLANK, serviceContext);

    _defaultRepositoryFolder = (Folder) objects[0];
    _defaultRepositoryDLFileVersion = (DLFileVersion) objects[1];

    objects = setUp(_repository.getRepositoryId(), "-NewRepository", serviceContext);

    _newRepositoryFolder = (Folder) objects[0];
  }
Exemplo n.º 3
0
  public User addUser(Group group, String... assetTagNames) throws Exception {
    User user1 = UserTestUtil.addUser(group.getGroupId());

    _users.add(user1);

    ServiceContext serviceContext = getServiceContext(group);

    serviceContext.setAssetTagNames(assetTagNames);

    User user2 = UserTestUtil.updateUser(user1, serviceContext);

    List<AssetTag> assetTags =
        AssetTagLocalServiceUtil.getTags(user2.getModelClassName(), user2.getPrimaryKey());

    _assetTags.addAll(assetTags);

    return user2;
  }
  @Before
  public void setUp() throws Exception {
    group = GroupTestUtil.addGroup();
    user = UserTestUtil.addUser();

    serviceContext = ServiceContextTestUtil.getServiceContext(group.getGroupId());

    doSetUp();

    ServiceTestUtil.setUser(user);

    permissionChecker = PermissionThreadLocal.getPermissionChecker();

    addPortletModelViewPermission();
  }
Exemplo n.º 5
0
  @Override
  public void setUp() throws Exception {
    super.setUp();

    _user = UserTestUtil.addUser(null, group.getGroupId());

    _role =
        RoleTestUtil.addRole(
            "Trash Admin",
            RoleConstants.TYPE_REGULAR,
            PortletKeys.TRASH,
            ResourceConstants.SCOPE_COMPANY,
            String.valueOf(TestPropsValues.getCompanyId()),
            ActionKeys.ACCESS_IN_CONTROL_PANEL);

    RoleTestUtil.addResourcePermission(
        RoleConstants.GUEST,
        DLPermission.RESOURCE_NAME,
        ResourceConstants.SCOPE_GROUP_TEMPLATE,
        String.valueOf(GroupConstants.DEFAULT_PARENT_GROUP_ID),
        ActionKeys.VIEW);
  }
  @Before
  public void setUp() throws Exception {
    _group = GroupTestUtil.addGroup();

    _user = UserTestUtil.addGroupUser(_group, RoleConstants.SITE_MEMBER);
  }